1. Chris Hasenpflug
  2. django-project-template

Commits

Chris Hasenpflug  committed 1c3507d

Make changes to base settings.

  • Participants
  • Parent commits a42b044
  • Branches master

Comments (0)

Files changed (1)

File project_name/settings/base.py

View file
 # Django settings for {{ project_name }} project.
+import os
 
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
+
+PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
+PROJECT_DIR = os.path.join(PROJECT_ROOT, '{{ project_name }}')
 
 ADMINS = (
     # ('Your Name', 'your_email@example.com'),
 
 # Absolute filesystem path to the directory that will hold user-uploaded files.
 # Example: "/home/media/media.lawrence.com/media/"
-MEDIA_ROOT = ''
+MEDIA_ROOT = os.path.join(PROJECT_ROOT, "media")
 
 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
 # trailing slash.
 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
-MEDIA_URL = ''
+MEDIA_URL = '/media/'
 
 # Absolute path to the directory static files should be collected to.
 # Don't put anything in this directory yourself; store your static files
 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
 # Example: "/home/media/media.lawrence.com/static/"
-STATIC_ROOT = ''
+STATIC_ROOT = os.path.join(PROJECT_ROOT, "static")
 
 # URL prefix for static files.
 # Example: "http://media.lawrence.com/static/"
 )
 
 # Make this unique, and don't share it with anybody.
-SECRET_KEY = 'g%f@)m$y$ah&kkava9+-j939na&e#d*lj&7iy(7_zceoq5nqdj'
+SECRET_KEY = '"{{ secret_key }}"'
 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
+    os.path.join(PROJECT_DIR, 'templates'),
 )
 
 INSTALLED_APPS = (
     'django.contrib.sites',
     'django.contrib.messages',
     'django.contrib.staticfiles',
-    # Uncomment the next line to enable the admin:
-    # 'django.contrib.admin',
+    'django.contrib.admin',
     # Uncomment the next line to enable admin documentation:
     # 'django.contrib.admindocs',
 )