# Common Django settings for all environments for project {{ project_name }}. # # This file contains common settings shared amongst all environments of a # project. Do not put any environment-specific settings here. # import os # Determine the root and assets project directories. PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ASSETS_ROOT = os.path.normpath(os.path.join(PROJECT_ROOT, "assets")) # Applications installed in the project. INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) # Middleware classes enabled in the project. MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', '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', ) # URL configuration for the project. ROOT_URLCONF = '{{ project_name }}.urls' # Templates configuration for the project. 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', ], }, }, ] # Python dotted path to the WSGI application used by Django's runserver command. WSGI_APPLICATION = '{{ project_name }}.wsgi.application' # Language, internationalisation, and time configuration LANGUAGE_CODE = 'en-us' USE_I18N = True USE_L10N = True USE_TZ = True # URLs for serving the static and media files. STATIC_URL = '/static/' MEDIA_URL = '/media/' # Absolute filesystem path to the directory that will hold user-uploaded # files. Calculated based on assets root. MEDIA_ROOT = os.path.normpath(os.path.join(ASSETS_ROOT, "media")) # Absolute path to the directory static files should be collected to. Calculated # based on project assets root. STATIC_ROOT = os.path.normpath(os.path.join(ASSETS_ROOT, "static")) # Additional locations for static files. Useful for project-wide overrides of # default static files. STATICFILES_DIRS = ( os.path.normpath(os.path.join(PROJECT_ROOT, "static")), )