Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Closed
Open
Issue #235 opened Aug 03, 2014 by Őry Máté@orymate 
  • Report abuse
  • New issue
Report abuse New issue

fix production settings

diff --git a/circle/circle/settings/base.py b/circle/circle/settings/base.py
index e90c6ba..d146238 100644
--- a/circle/circle/settings/base.py
+++ b/circle/circle/settings/base.py
@@ -211,8 +211,8 @@ TEMPLATE_LOADERS = (

 # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
 TEMPLATE_DIRS = (
+    normpath(join(SITE_ROOT, '../../site-circle/templates')),
     normpath(join(SITE_ROOT, 'templates')),
-    join(dirname(SITE_ROOT), 'site-circle/templates'),
 )
 ########## END TEMPLATE CONFIGURATION

diff --git a/circle/circle/settings/production.py b/circle/circle/settings/production.py
index 5d6fe6f..4710111 100644
--- a/circle/circle/settings/production.py
+++ b/circle/circle/settings/production.py
@@ -24,18 +24,10 @@ from os import environ
 from base import *  # noqa


-def get_env_setting(setting):
-    """ Get the environment setting or return exception """
-    try:
-        return environ[setting]
-    except KeyError:
-        error_msg = "Set the %s env variable" % setting
-        raise ImproperlyConfigured(error_msg)
-
 ########## HOST CONFIGURATION
 # See: https://docs.djangoproject.com/en/1.5/releases/1.5/
 #      #allowed-hosts-required-in-production
-ALLOWED_HOSTS = get_env_setting('DJANGO_ALLOWED_HOSTS').split(',')
+ALLOWED_HOSTS = get_env_variable('DJANGO_ALLOWED_HOSTS').split(',')
 ########## END HOST CONFIGURATION

 ########## EMAIL CONFIGURATION
@@ -44,18 +36,18 @@ EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

 try:
     # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host
-    EMAIL_HOST = environ.get('EMAIL_HOST')
+    EMAIL_HOST = get_env_variable('EMAIL_HOST')
 except ImproperlyConfigured:
-    pass
+    EMAIL_HOST = 'localhost'
 else:
     # https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password
-    EMAIL_HOST_PASSWORD = environ.get('EMAIL_HOST_PASSWORD', '')
+    EMAIL_HOST_PASSWORD = get_env_variable('EMAIL_HOST_PASSWORD', '')

     # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-user
-    EMAIL_HOST_USER = environ.get('EMAIL_HOST_USER', 'your_email@example.com')
+    EMAIL_HOST_USER = get_env_variable('EMAIL_HOST_USER', 'your_email@example.com')

     # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port
-    EMAIL_PORT = environ.get('EMAIL_PORT', 587)
+    EMAIL_PORT = get_env_variable('EMAIL_PORT', 587)

     # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls
     EMAIL_USE_TLS = True
@@ -64,7 +56,8 @@ else:
 EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_NAME

 # See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email
-SERVER_EMAIL = EMAIL_HOST_USER
+DEFAULT_FROM_EMAIL = get_env_variable('DEFAULT_FROM_EMAIL')
+SERVER_EMAIL = get_env_variable('SERVER_EMAIL', DEFAULT_FROM_EMAIL)
 ########## END EMAIL CONFIGURATION


@@ -83,5 +76,14 @@ CACHES = {

 ########## SECRET CONFIGURATION
 # See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
-SECRET_KEY = get_env_setting('SECRET_KEY')
+SECRET_KEY = get_env_variable('SECRET_KEY')
 ########## END SECRET CONFIGURATION
+
+level = environ.get('LOGLEVEL', 'ERROR')
+LOGGING['handlers']['console'] = {'level': level,
+                                  'class': 'logging.StreamHandler',
+                                  'formatter': 'simple'}
+for i in LOCAL_APPS:
+    LOGGING['loggers'][i] = {'handlers': ['console', 'syslog'], 'level': level}
+LOGGING['loggers']['djangosaml2'] = {'handlers': ['console', 'syslog'],
+                                     'level': 'DEBUG'}
  • Őry Máté @orymate

    mentioned in merge request !154 (merged)

    Aug 08, 2014

    mentioned in merge request !154 (merged)

    mentioned in merge request !154
    Toggle commit list
  • Őry Máté @orymate

    Status changed to closed by commit d88a74

    Aug 12, 2014

    Status changed to closed by commit d88a74

    Status changed to closed by commit d88a74
    Toggle commit list
  • Write
  • Preview
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
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
No due date
0
Labels
None
Assign labels
  • View labels
1
1 participant
Reference: circle/cloud#235