Skip to content

Commit 3b26031

Browse files
committed
update settings
1 parent cbd8dac commit 3b26031

File tree

5 files changed

+47
-28
lines changed

5 files changed

+47
-28
lines changed

Pipfile

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ goodconf = {extras = ["yaml"],version = "*"}
2222
easyconf = "*"
2323
django-registration-redux = "*"
2424
django-mix = {git = "https://github.com/zodman/django-mix.git"}
25+
dj-email-url = "*"
2526

2627
[requires]
2728
python_version = "3.6"

Pipfile.lock

+24-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/app/conf.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ class Config(GoodConf):
99
"Configuration for My App"
1010
DEBUG = Value(default=True, help="Toggle debugging.")
1111

12-
DATABASE_CONF = Value(default={
12+
EMAIL_URL = Value(
13+
default='console://',
14+
initial='smtp://[email protected]:[email protected]:465/?ssl=True',
15+
),
16+
DATABASE_CONF = Value(
17+
default={
1318
'ENGINE': 'django.db.backends.sqlite3',
1419
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
1520
},
@@ -21,11 +26,7 @@ class Config(GoodConf):
2126
help="Used for cryptographic signing. "
2227
"https://docs.djangoproject.com/en/2.0/ref/settings/#secret-key")
2328
STATIC_ROOT = Value(
24-
default=os.path.join(BASE_DIR, "static"),
25-
help="static directory"
26-
)
29+
default=os.path.join(BASE_DIR, "static"), help="static directory")
2730

2831

29-
config = Config(
30-
default_files=["tmech_conf.yaml"]
31-
)
32+
config = Config(default_files=["tmech_conf.yaml"])

app/app/settings.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
'djangomix',
4040
'autofixture',
4141
'active_link',
42-
42+
'django_webserver',
4343
]
4444

4545
if "test" in sys.argv:
@@ -135,6 +135,15 @@
135135
REGISTRATION_AUTO_LOGIN = True # Automatically log the user in.
136136

137137
SITE_ID=1
138-
139-
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
140-
USE_THOUSAND_SEPARATOR = True
138+
import dj_email_url
139+
email_config = dj_email_url.parse(config.EMAIL_URL)
140+
EMAIL_HOST_USER = email_config['EMAIL_HOST_USER']
141+
EMAIL_HOST_PASSWORD = email_config['EMAIL_HOST_PASSWORD']
142+
EMAIL_HOST = email_config['EMAIL_HOST']
143+
EMAIL_PORT = email_config['EMAIL_PORT']
144+
EMAIL_BACKEND = email_config['EMAIL_BACKEND']
145+
EMAIL_USE_TLS = email_config['EMAIL_USE_TLS']
146+
EMAIL_USE_SSL = email_config['EMAIL_USE_SSL']
147+
148+
149+
USE_THOUSAND_SEPARATOR = True

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
include_package_data=True,
1111
entry_points={
1212
'console_scripts': [
13-
"manage.py = app.conf.config.django_manage",
13+
"manage.py = app.conf.config:config.django_manage",
1414
]
1515
})

0 commit comments

Comments
 (0)