Commit 3ac7bdf757491787e646967f0a7edc6a9b8ce975
1 parent
8ab8cc75
Exists in
master
and in
39 other branches
New settings scheme
Showing
8 changed files
with
185 additions
and
10 deletions
Show diff stats
.gitignore
manage.py
| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | +from settings import * | |
| 2 | + | |
| 3 | +DEBUG = False | |
| 4 | + | |
| 5 | +TEMPLATE_DEBUG = False | |
| 6 | + | |
| 7 | +TIME_ZONE = 'America/Sao_Paulo' | |
| 8 | + | |
| 9 | +gettext = lambda s: s | |
| 10 | +LANGUAGES = ( | |
| 11 | + ('en', gettext('English')), | |
| 12 | + ('es', gettext('Spanish')), | |
| 13 | + ('pt-BR', gettext('Portuguese')), | |
| 14 | +) | |
| 15 | + | |
| 16 | +INSTALLED_APPS = INSTALLED_APPS + ( | |
| 17 | + # Not standard apps | |
| 18 | + 'south', | |
| 19 | + 'cliauth', | |
| 20 | + | |
| 21 | + # Own apps | |
| 22 | + 'api', | |
| 23 | + 'super_archives', | |
| 24 | + 'rss', | |
| 25 | +) | |
| 26 | + | |
| 27 | +LOGGING = { | |
| 28 | + 'version': 1, | |
| 29 | + 'disable_existing_loggers': False, | |
| 30 | + 'handlers': { | |
| 31 | + 'mail_admins': { | |
| 32 | + 'level': 'ERROR', | |
| 33 | + 'class': 'django.utils.log.AdminEmailHandler', | |
| 34 | + 'include_html': True, | |
| 35 | + } | |
| 36 | + }, | |
| 37 | + 'loggers': { | |
| 38 | + 'django.request': { | |
| 39 | + 'handlers': ['mail_admins'], | |
| 40 | + 'level': 'ERROR', | |
| 41 | + 'propagate': True, | |
| 42 | + }, | |
| 43 | + } | |
| 44 | +} | |
| 45 | + | |
| 46 | +SERVER_EMAIL = '"Colab Interlegis" <noreply@interlegis.leg.br>' | |
| 47 | +EMAIL_HOST_USER = SERVER_EMAIL | |
| 48 | + | |
| 49 | +#SOLR_HOSTNAME = 'solr.interlegis.leg.br' | |
| 50 | +SOLR_HOSTNAME = '10.1.2.154' | |
| 51 | +SOLR_PORT = '8080' | |
| 52 | +SOLR_SELECT_PATH = '/solr/select' | |
| 53 | + | |
| 54 | +SOLR_COLAB_URI = 'http://colab.interlegis.leg.br' | |
| 55 | +SOLR_BASE_QUERY = """ | |
| 56 | + ((Type:changeset OR Type:ticket OR Type:wiki OR Type:thread) AND Title:["" TO *]) | |
| 57 | +""" | |
| 58 | + | |
| 59 | +try: | |
| 60 | + from settings_local import * | |
| 61 | +except ImportError: | |
| 62 | + pass | ... | ... |
| ... | ... | @@ -0,0 +1,84 @@ |
| 1 | +""" | |
| 2 | +Django settings for colab project. | |
| 3 | + | |
| 4 | +For more information on this file, see | |
| 5 | +https://docs.djangoproject.com/en/dev/topics/settings/ | |
| 6 | + | |
| 7 | +For the full list of settings and their values, see | |
| 8 | +https://docs.djangoproject.com/en/dev/ref/settings/ | |
| 9 | +""" | |
| 10 | + | |
| 11 | +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | |
| 12 | +import os | |
| 13 | +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) | |
| 14 | + | |
| 15 | + | |
| 16 | +# Quick-start development settings - unsuitable for production | |
| 17 | +# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ | |
| 18 | + | |
| 19 | +# SECURITY WARNING: keep the secret key used in production secret! | |
| 20 | +SECRET_KEY = 'd%gy$gfn4z2=z414qvqouyd2h6_i8nr_m4zmlxqklu15u!8&^@' | |
| 21 | + | |
| 22 | +# SECURITY WARNING: don't run with debug turned on in production! | |
| 23 | +DEBUG = True | |
| 24 | + | |
| 25 | +TEMPLATE_DEBUG = True | |
| 26 | + | |
| 27 | +ALLOWED_HOSTS = [] | |
| 28 | + | |
| 29 | + | |
| 30 | +# Application definition | |
| 31 | + | |
| 32 | +INSTALLED_APPS = ( | |
| 33 | + 'django.contrib.admin', | |
| 34 | + 'django.contrib.auth', | |
| 35 | + 'django.contrib.contenttypes', | |
| 36 | + 'django.contrib.sessions', | |
| 37 | + 'django.contrib.messages', | |
| 38 | + 'django.contrib.staticfiles', | |
| 39 | +) | |
| 40 | + | |
| 41 | +MIDDLEWARE_CLASSES = ( | |
| 42 | + 'django.contrib.sessions.middleware.SessionMiddleware', | |
| 43 | + 'django.middleware.common.CommonMiddleware', | |
| 44 | + 'django.middleware.csrf.CsrfViewMiddleware', | |
| 45 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
| 46 | + 'django.contrib.messages.middleware.MessageMiddleware', | |
| 47 | + 'django.middleware.clickjacking.XFrameOptionsMiddleware', | |
| 48 | +) | |
| 49 | + | |
| 50 | +ROOT_URLCONF = 'colab.urls' | |
| 51 | + | |
| 52 | +WSGI_APPLICATION = 'colab.wsgi.application' | |
| 53 | + | |
| 54 | + | |
| 55 | +# Database | |
| 56 | +# https://docs.djangoproject.com/en/dev/ref/settings/#databases | |
| 57 | + | |
| 58 | +DATABASES = { | |
| 59 | + 'default': { | |
| 60 | + 'ENGINE': 'django.db.backends.sqlite3', | |
| 61 | + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | |
| 62 | + } | |
| 63 | +} | |
| 64 | + | |
| 65 | +# Internationalization | |
| 66 | +# https://docs.djangoproject.com/en/dev/topics/i18n/ | |
| 67 | + | |
| 68 | +LANGUAGE_CODE = 'en-us' | |
| 69 | + | |
| 70 | +TIME_ZONE = 'UTC' | |
| 71 | + | |
| 72 | +USE_I18N = True | |
| 73 | + | |
| 74 | +USE_L10N = True | |
| 75 | + | |
| 76 | +USE_TZ = True | |
| 77 | + | |
| 78 | + | |
| 79 | +# Static files (CSS, JavaScript, Images) | |
| 80 | +# https://docs.djangoproject.com/en/dev/howto/static-files/ | |
| 81 | + | |
| 82 | +STATIC_URL = '/static/' | |
| 83 | + | |
| 84 | +from custom_settings import * | ... | ... |
| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | +from django.conf.urls import patterns, include, url | |
| 2 | + | |
| 3 | +from django.contrib import admin | |
| 4 | +admin.autodiscover() | |
| 5 | + | |
| 6 | +urlpatterns = patterns('', | |
| 7 | + # Examples: | |
| 8 | + # url(r'^$', 'colab.views.home', name='home'), | |
| 9 | + # url(r'^blog/', include('blog.urls')), | |
| 10 | + | |
| 11 | + url(r'^admin/', include(admin.site.urls)), | |
| 12 | +) | ... | ... |
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +""" | |
| 2 | +WSGI config for colab project. | |
| 3 | + | |
| 4 | +It exposes the WSGI callable as a module-level variable named ``application``. | |
| 5 | + | |
| 6 | +For more information on this file, see | |
| 7 | +https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/ | |
| 8 | +""" | |
| 9 | + | |
| 10 | +import os | |
| 11 | +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colab.settings") | |
| 12 | + | |
| 13 | +from django.core.wsgi import get_wsgi_application | |
| 14 | +application = get_wsgi_application() | ... | ... |
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | +#!/usr/bin/env python | |
| 2 | +import os | |
| 3 | +import sys | |
| 4 | + | |
| 5 | +if __name__ == "__main__": | |
| 6 | + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "colab.settings") | |
| 7 | + | |
| 8 | + from django.core.management import execute_from_command_line | |
| 9 | + | |
| 10 | + execute_from_command_line(sys.argv) | ... | ... |