Changeset - ab300f858903
[Not reviewed]
0 2 0
Branko Majic (branko) - 10 years ago 2015-09-13 22:09:20
branko@majic.rs
MDT-1: Use better pathfinding for development environment when locating the sqlite3 database. Set a saner default for redirect after login (redirect to 'index' view, whatever it may be).
2 files changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
project/project_name/settings/base.py
Show inline comments
 
@@ -34,48 +34,51 @@ MIDDLEWARE_CLASSES = (
 
)
 

	
 
# 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")),
 
)
 

	
 
# Redirect user to specified view after login.
 
LOGIN_REDIRECT_URL = "index"
project/project_name/settings/development.py
Show inline comments
 
# Development environment settings for project {{ project_name }}.
 

	
 
#
 
# This configuration file is used to define settings for the development
 
# environment.
 
#
 

	
 
# Import the exception for signaling invalid configuration. No other
 
# Django-specific definitions should be imported here.
 
from django.core.exceptions import ImproperlyConfigured
 

	
 
# Import the base settings.
 
from .base import *
 

	
 
# Import the credentials.
 
try:
 
    from .credentials import DATABASE_PASSWORDS
 
except ImportError:
 
    raise ImproperlyConfigured("Please configure the DATABASE_PASSWORDS in credentials.py.")
 

	
 
try:
 
    from .credentials import SECRET_KEY
 
except ImportError:
 
    raise ImproperlyConfigured("Please configure the SECRET_KEY in credentials.py.")
 

	
 
# Debugging is useful for development.
 
DEBUG = True
 
for template_config in TEMPLATES:
 
    template_config['OPTIONS']['debug']=True
 

	
 
# Site administrators and managers.
 
ADMINS = (
 
    # ('Your Name', 'your_email@example.com'),
 
)
 
MANAGERS = ADMINS
 

	
 
# Database configuration. sqlite3 is used for development for convenience. See
 
# testing/production environment settings and official Django documentation if a
 
# proper database should be used.
 
DATABASES = {
 
    'default': {
 
        'ENGINE': 'django.db.backends.sqlite3',
 
        'NAME': 'development.sqlite3',
 
        'NAME': os.path.join(PROJECT_ROOT, 'development.sqlite3'),
 
    }
 
}
 

	
 
# Hosts that are valid for accessing this site. For development, empty list is
 
# sufficient.
 
ALLOWED_HOSTS = []
 

	
 
# Local time zone for development environment.
 
TIME_ZONE = 'Europe/Stockholm'
0 comments (0 inline, 0 general)