diff --git a/project_name/settings.py b/project_name/settings.py index c9563e8..496eb73 100644 --- a/project_name/settings.py +++ b/project_name/settings.py @@ -1,21 +1,23 @@ """ Django settings for {{ project_name }} project. +Generated by 'django-admin startproject' using Django {{ django_version }}. + For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/ """ + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os from configurations import Configuration, values class Common(Configuration): - - # Build paths inside the project like this: os.path.join(BASE_DIR, ...) - BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/ @@ -26,11 +28,8 @@ class Common(Configuration): # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True - TEMPLATE_DEBUG = True - ALLOWED_HOSTS = [] - # Application definition INSTALLED_APPS = ( @@ -47,14 +46,31 @@ class Common(Configuration): 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.security.SecurityMiddleware', ) ROOT_URLCONF = '{{ project_name }}.urls' - WSGI_APPLICATION = '{{ project_name }}.wsgi.application' + TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, + ] + WSGI_APPLICATION = '{{ project_name }}.wsgi.application' # Database # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases @@ -76,7 +92,6 @@ class Common(Configuration): USE_TZ = True - # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/ diff --git a/project_name/urls.py b/project_name/urls.py index f03a294..665085b 100644 --- a/project_name/urls.py +++ b/project_name/urls.py @@ -1,12 +1,21 @@ -from django.conf.urls import patterns, include, url +"""{{ project_name }} URL Configuration +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/{{ docs_version }}/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Add an import: from blog import urls as blog_urls + 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) +""" +from django.conf.urls import include, url from django.contrib import admin -admin.autodiscover() - -urlpatterns = patterns('', - # Examples: - # url(r'^$', '{{ project_name }}.views.home', name='home'), - # url(r'^blog/', include('blog.urls')), +urlpatterns = [ url(r'^admin/', include(admin.site.urls)), -) +] diff --git a/requirements.txt b/requirements.txt index d286d27..584f349 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -django-configurations>=0.4 -Django>=1.6,<1.7 -dj-database-url==0.2.2 \ No newline at end of file +django-configurations==1.0 +Django>=1.8,<1.9 +dj-database-url==0.3