Browse Source

Update / refresh settings

remotes/origin/feincms
Tomas Gavenciak 10 years ago
parent
commit
cacc5e4c87
  1. 21
      mamweb/settings.py
  2. 88
      mamweb/settings_common.py
  3. 27
      mamweb/settings_prod.py
  4. 23
      mamweb/settings_test.py

21
mamweb/settings.py

@ -2,10 +2,31 @@ from .settings_common import *
# Local development settings # Local development settings
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
INSTALLED_APPS += ( INSTALLED_APPS += (
'debug_toolbar', 'debug_toolbar',
'django_extensions', 'django_extensions',
) )
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ')^u=i65*zmr_k53a*@f4q_+ji^o@!pgpef*5&8c7zzv9l+zo)n'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1']
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db-local.sqlite3'),
}
}

88
mamweb/settings_common.py

@ -12,53 +12,21 @@ https://docs.djangoproject.com/en/1.7/ref/settings/
import os import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ')^u=i65*zmr_k53a*@f4q_+ji^o@!pgpef*5&8c7zzv9l+zo)n'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
AUTHENTICATION_BACKENDS = (
# Needed to login by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by e-mail
'allauth.account.auth_backends.AuthenticationBackend',
)
# Application definition # Application definition
SITE_ID = 1 SITE_ID = 1
ROOT_URLCONF = 'mamweb.urls' ROOT_URLCONF = 'mamweb.urls'
WSGI_APPLICATION = 'mamweb.wsgi.application' WSGI_APPLICATION = 'mamweb.wsgi.application'
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/ # https://docs.djangoproject.com/en/1.7/topics/i18n/
LANGUAGE_CODE = 'cs' LANGUAGE_CODE = 'cs'
TIME_ZONE = 'Europe/Prague' TIME_ZONE = 'Europe/Prague'
USE_I18N = False USE_I18N = False
USE_L10N = True USE_L10N = True
USE_TZ = True USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/ # https://docs.djangoproject.com/en/1.7/howto/static-files/
@ -67,15 +35,17 @@ MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'mamweb', 'static'),
)
STATICFILES_FINDERS = ( STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.FileSystemFinder',
) )
# Modules configuration
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
)
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader', 'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader', 'django.template.loaders.app_directories.Loader',
@ -103,11 +73,8 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.tz', 'django.core.context_processors.tz',
'sekizai.context_processors.sekizai', 'sekizai.context_processors.sekizai',
'django.core.context_processors.static', 'django.core.context_processors.static',
'allauth.account.context_processors.account',
'allauth.socialaccount.context_processors.socialaccount',
) )
INSTALLED_APPS = ( INSTALLED_APPS = (
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
@ -120,52 +87,13 @@ INSTALLED_APPS = (
'sekizai', 'sekizai',
'reversion', 'reversion',
'allauth',
'allauth.account',
'allauth.socialaccount',
# 'allauth.socialaccount.providers.facebook',
# 'allauth.socialaccount.providers.openid',
'allauth.socialaccount.providers.google',
'mamweb', 'mamweb',
'seminar', 'seminar',
) )
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'mam',
# 'USER': 'mam',
# },
# 'test': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
SOCIALACCOUNT_QUERY_EMAIL = True
SOCIALACCOUNT_PROVIDERS = {
'google': {
'SCOPE': ['profile', 'email'],
'AUTH_PARAMS': { 'access_type': 'online' }
},
'facebook': {
'SCOPE': ['email', 'publish_stream'],
'METHOD': 'js_sdk',
'VERIFIED_EMAIL': True,
}
}
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
ACCOUNT_EMAIL_REQUIRED = True
SOCIALACCOUNT_EMAIL_REQUIRED = True
# MaM specific # MaM specific
SEMINAR_RESENI_DIRNAME = 'reseni' SEMINAR_RESENI_DIR = os.path.join(BASE_DIR, 'media', 'reseni')

27
mamweb/settings_prod.py

@ -1,5 +1,30 @@
from .settings_common import * from .settings_common import *
# Specific settings for remote production # Specific settings for remote production
# ...
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
INSTALLED_APPS += (
)
# SECURITY WARNING: keep the secret key used in production secret!
#SECRET_KEY = TODO
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['mam.mff.cuni.cz']
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'mamweb',
'USER': 'mamweb',
},
}

23
mamweb/settings_test.py

@ -1,13 +1,34 @@
from .settings_common import * from .settings_common import *
# Specific settings for remote test site # Specific settings for remote test site
# ...
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
INSTALLED_APPS += ( INSTALLED_APPS += (
'debug_toolbar', 'debug_toolbar',
'django_extensions', 'django_extensions',
) )
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ')^u=i65*zmr_k53a*@f4q_+ji^o@!pgpef*5&8c7zzv9l+zo)n'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['test.mam.mff.cuni.cz']
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db-test.sqlite3'),
}
}

Loading…
Cancel
Save