Skip to content

Instantly share code, notes, and snippets.

@kdungs
Created August 18, 2012 19:50
Show Gist options
  • Save kdungs/3389337 to your computer and use it in GitHub Desktop.
Save kdungs/3389337 to your computer and use it in GitHub Desktop.
Example settings for tippspiel.
# Django settings for bundesliga project.
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
from os.path import dirname, join
ROOT = dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
#('Kevin D.', '[email here]'),
)
MANAGERS = ADMINS
AUTH_PROFILE_MODULE = 'tippspiel.Player'
LOGIN_URL = '/tippspiel/login/'
LOGIN_REDIRECT_URL = '/tippspiel/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '3306',
}
}
TIME_ZONE = 'Europe/Berlin'
LANGUAGE_CODE = 'en'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
USE_TZ = True
ugettext = lambda s: s
LANGUAGES = (
('de', ugettext('German')),
('en', ugettext('English')),
)
MEDIA_ROOT = join(ROOT, 'assets/')
MEDIA_URL = '/assets/'
STATIC_ROOT = join(ROOT, 'static/')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
SECRET_KEY = 'add a secret key here'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'bundesliga.urls'
WSGI_APPLICATION = 'bundesliga.wsgi.application'
TEMPLATE_DIRS = (
join(ROOT, 'templates/')
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'tippspiel',
)
TEMPLATE_CONTEXT_PROCESSORS += (
'django.core.context_processors.request',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic import RedirectView
admin.autodiscover()
urlpatterns = patterns('',
(r'^$', RedirectView.as_view(url='/tippspiel/')),
url(r'^tippspiel/', include('tippspiel.urls')),
url(r'^admin/', include(admin.site.urls)),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment