Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c76657ed
authored
Aug 08, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
settings: fix production mailing settings
parent
e691f1f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
circle/circle/settings/production.py
+9
-16
No files found.
circle/circle/settings/production.py
View file @
c76657ed
...
@@ -24,18 +24,10 @@ from os import environ
...
@@ -24,18 +24,10 @@ from os import environ
from
base
import
*
# noqa
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
########## HOST CONFIGURATION
# See: https://docs.djangoproject.com/en/1.5/releases/1.5/
# See: https://docs.djangoproject.com/en/1.5/releases/1.5/
# #allowed-hosts-required-in-production
# #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
########## END HOST CONFIGURATION
########## EMAIL CONFIGURATION
########## EMAIL CONFIGURATION
...
@@ -44,18 +36,18 @@ EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
...
@@ -44,18 +36,18 @@ EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
try
:
try
:
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host
# 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
:
except
ImproperlyConfigured
:
pass
EMAIL_HOST
=
'localhost'
else
:
else
:
# https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password
# 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
# 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
# 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
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls
EMAIL_USE_TLS
=
True
EMAIL_USE_TLS
=
True
...
@@ -64,7 +56,8 @@ else:
...
@@ -64,7 +56,8 @@ else:
EMAIL_SUBJECT_PREFIX
=
'[
%
s] '
%
SITE_NAME
EMAIL_SUBJECT_PREFIX
=
'[
%
s] '
%
SITE_NAME
# See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email
# 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
########## END EMAIL CONFIGURATION
...
@@ -83,5 +76,5 @@ CACHES = {
...
@@ -83,5 +76,5 @@ CACHES = {
########## SECRET CONFIGURATION
########## SECRET CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# 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
########## END SECRET CONFIGURATION
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment