diff --git a/birding/settings.py b/birding/settings.py index bed3fe8321d4449479c205e5d2f2dd4f7cd9e7a9..115f9443fe4340548153f73dc5ab995f0aa58683 100644 --- a/birding/settings.py +++ b/birding/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'bootstrap3', 'clades', ] @@ -56,7 +57,7 @@ ROOT_URLCONF = 'birding.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': ['templates'], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/birding/urls.py b/birding/urls.py index 16109f9cd865e9adf01701de531fe64d22ecbd35..964dd17c9f39870bc398bb531c31d2ab23ae8f05 100644 --- a/birding/urls.py +++ b/birding/urls.py @@ -15,7 +15,9 @@ Including another URLconf """ from django.conf.urls import url from django.contrib import admin +from django.views.generic.base import TemplateView urlpatterns = [ + url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'), url(r'^admin/', admin.site.urls), ] diff --git a/requirements.txt b/requirements.txt index 2b21c4a16e77d33b3962b07626cb414fb4035cec..bde7c9ec2e196317fdf61b84807028b4c2c7dcef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ Django<1.10 +django-bootstrap3 diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000000000000000000000000000000000000..b1248ca445124763bb3dd8cff274fd29b7a79c54 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +{% load staticfiles i18n bootstrap3 %} +<html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>{% block page_title %}{% include "page_title.html" %}{% endblock %}</title> + {% bootstrap_css %}{% block css %}{% endblock %} +</head> +<body> + <div class="container"> + <h1>{% include "page_title.html" %}</h1> + {% bootstrap_messages %} + {% block content %} + {% endblock content %} + </div> + {% bootstrap_javascript jquery=1 %}{% block js %}{% endblock %} +</body> +</html> diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000000000000000000000000000000000000..c8fca267e6e7feead0207f98a77d72c3e0436129 --- /dev/null +++ b/templates/home.html @@ -0,0 +1,6 @@ +{% extends "base.html" %}{% load i18n %} +{% block content %} +<ul> + <li><a href="{% url 'admin:index' %}">{% trans "Admin" %}</a></li> +</ul> +{% endblock content %} diff --git a/templates/page_title.html b/templates/page_title.html new file mode 100644 index 0000000000000000000000000000000000000000..9829a2257dad8242a4166d54e9b538dda3f56e34 --- /dev/null +++ b/templates/page_title.html @@ -0,0 +1,4 @@ +{% load i18n %} +{% if page_title %} +{{page_title}} +{% else %}{%trans "Birding Application"%}{% endif %}