Commit f5608fb2 by Őry Máté

django: lint settings.base

parent 50e66336
# coding=utf8 # coding=utf8
# Django base settings for cloud project. # Django base settings for cloud project.
from os.path import join, abspath, dirname
import os import os
import subprocess import subprocess
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name, default=None): def get_env_variable(var_name, default=None):
""" Get the environment variable or return exception/default """ """ Get the environment variable or return exception/default """
try: try:
...@@ -95,7 +95,7 @@ STATICFILES_DIRS = ( ...@@ -95,7 +95,7 @@ STATICFILES_DIRS = (
STATICFILES_FINDERS = ( STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
) )
# Make this unique, and don't share it with anybody. # Make this unique, and don't share it with anybody.
...@@ -105,7 +105,7 @@ SECRET_KEY = get_env_variable('DJANGO_SECRET_KEY') ...@@ -105,7 +105,7 @@ SECRET_KEY = get_env_variable('DJANGO_SECRET_KEY')
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',
# 'django.template.loaders.eggs.Loader', # 'django.template.loaders.eggs.Loader',
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
...@@ -138,8 +138,8 @@ TEMPLATE_CONTEXT_PROCESSORS = ( ...@@ -138,8 +138,8 @@ TEMPLATE_CONTEXT_PROCESSORS = (
) )
TEMPLATE_DIRS = ( TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Put strings here, like "/home/html/django_templates" or
# Always use forward slashes, even on Windows. # "C:/www/django/templates". Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths. # Don't forget to use absolute paths, not relative paths.
) )
...@@ -167,7 +167,7 @@ INSTALLED_APPS = ( ...@@ -167,7 +167,7 @@ INSTALLED_APPS = (
# the site admins on every HTTP 500 error when DEBUG=False. # the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for # See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration. # more details on how to customize your logging configuration.
from logging.handlers import SysLogHandler # from logging.handlers import SysLogHandler
LOGGING = { LOGGING = {
'version': 1, 'version': 1,
...@@ -183,8 +183,8 @@ LOGGING = { ...@@ -183,8 +183,8 @@ LOGGING = {
'filters': ['require_debug_false'], 'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler' 'class': 'django.utils.log.AdminEmailHandler'
}, },
'syslog':{ 'syslog': {
'level':'WARNING', 'level': 'WARNING',
'class': 'logging.handlers.SysLogHandler', 'class': 'logging.handlers.SysLogHandler',
'address': '/dev/log', 'address': '/dev/log',
}, },
...@@ -202,7 +202,7 @@ LOGGING = { ...@@ -202,7 +202,7 @@ LOGGING = {
}, },
} }
} }
LOGIN_URL="/login" LOGIN_URL = "/login"
AUTH_PROFILE_MODULE = 'school.Person' AUTH_PROFILE_MODULE = 'school.Person'
import djcelery import djcelery
...@@ -212,7 +212,8 @@ CELERY_CACHE_BACKEND = "default" ...@@ -212,7 +212,8 @@ CELERY_CACHE_BACKEND = "default"
CELERY_RESULT_BACKEND = "amqp" CELERY_RESULT_BACKEND = "amqp"
CELERY_TASK_RESULT_EXPIRES = 3600 CELERY_TASK_RESULT_EXPIRES = 3600
BROKER_URL = get_env_variable('DJANGO_BROKER_URL', 'amqp://nyuszi:teszt@localhost:5672/django') BROKER_URL = get_env_variable(
'DJANGO_BROKER_URL', 'amqp://nyuszi:teszt@localhost:5672/django')
CELERY_ROUTES = { CELERY_ROUTES = {
'firewall.tasks.ReloadTask': {'queue': 'local'}, 'firewall.tasks.ReloadTask': {'queue': 'local'},
'firewall.tasks.reload_dns_task': {'queue': 'dns'}, 'firewall.tasks.reload_dns_task': {'queue': 'dns'},
...@@ -262,8 +263,9 @@ FIREWALL_SETTINGS = { ...@@ -262,8 +263,9 @@ FIREWALL_SETTINGS = {
SITE_NAME = "IK Cloud" SITE_NAME = "IK Cloud"
DEFAULT_FROM_EMAIL = "noreply@cloud.ik.bme.hu" DEFAULT_FROM_EMAIL = "noreply@cloud.ik.bme.hu"
DELETE_VM = False DELETE_VM = False
EMAIL_HOST='152.66.243.92' # giccero ipv4 EMAIL_HOST = '152.66.243.92' # giccero ipv4
CLOUD_URL='https://cloud.ik.bme.hu/' CLOUD_URL = 'https://cloud.ik.bme.hu/'
RELEASE = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '--abbrev-ref', 'HEAD']) RELEASE = subprocess.check_output(
['git', 'rev-parse', '--symbolic-full-name', '--abbrev-ref', 'HEAD'])
# vim: et sw=4 ai fenc=utf8 smarttab : # vim: et sw=4 ai fenc=utf8 smarttab :
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment