12-factor: Get config variables from the environment. #145
Conversation
Add dj-database-url, django-cache-url, and python-decouple deps.
@jgmize more 12factorization when you get time. I feel like maybe you've looked at some of this already, but I could be wrong. |
default='.allizom.org, basket.mozilla.com, basket.mozilla.org', | ||
cast=Csv()) | ||
SESSION_COOKIE_SECURE = config('SESSION_COOKIE_SECURE', True, cast=bool) | ||
CSRF_COOKIE_SECURE = config('CSRF_COOKIE_SECURE', True, cast=bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer the explicit kwarg default=True
to the positional True
for readability, but either way works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking at a big block of defaults lower down, I changed my mind. I prefer your way now :)
Yes, I had looked at most of this before. I didn't see any blockers to merge into the 12factor branch; your call on whether it would be better to provide defaults for the settings I mentioned. r+, nice work :) |
CACHES = { | ||
'default': config('CACHE_URL', | ||
default='locmem://', | ||
cast=django_cache_url.parse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked out django-cache-url
? It seems quite good, and supports django-redis
which I plan on using in the deis deploy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And for multiple servers you just have to comma separate them. e.g. memcached://server1:11211,server2:11211
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked out django-cache-url? It seems quite good, and supports django-redis which I plan on using in the deis deploy.
And for multiple servers you just have to comma separate them. e.g. memcached://server1:11211,server2:11211
I looked at it before and liked it, but somehow I missed the option to specify multiple servers with commas. Nice.
a17239c
to
e606008
Compare
e606008
to
9338a37
Compare
Settings moved. Feels good. If you agree I'll merge this (or just FF merge) into |
Add dj-database-url, django-cache-url, and python-decouple deps.