I'd like to illustrate why I think having official documentation about
deployment on PaaS would be great.
What I mean by "there is confusion", is that IMHO on a PaaS SECRET_KEY
should be managed by settings.py in an automatically created file in a
private and persistent directory.
For example:
https://github.com/political-memory/political_memory/blob/master/memopol/settings.py#L38-L46
You might be tempted to store it in an environment variable, but
that's not safe because environment variables are dumped in deployment
logs, like in their first example:
https://github.com/openshift/django-ex/blob/master/project/settings.py#L24-L28
In their other example (oh I found out they have two examples, more
confusion for users !), they use some sort of system to store the
secret key in a json file, that's a lot more complicated than it
should:
https://github.com/openshift/django-example/blob/master/wsgi/myproject/myproject/settings.py#L19-L28
By more complicated, I mean that it doesn't even work because it uses
a module that's not even in the repo anymore, so that won't even work.
For DEBUG, there's one example where they do DEBUG =
os.environ.get('DEBUG') == True, what happens if DEBUG is not set as
an environment variable ?
For static files, it's a bit more complicated on PaaS because you get
one persistent directory, where you want MEDIA_ROOT to be, and one
public directory, which is not served by the httpd. Their
configuration doesn't even include MEDIA_ROOT support BTW, again
there's only one way that works IMHO it's to symlink media from the
persistent dir into the "public" dir, and have STATIC_ROOT in a subdir
of the public dir - which again is not what they have.
And I could go on like this for a while heheh
Anyway, I'll try to contribute a new page about Django in the
devcenter repo (
https://github.com/openshift/devcenter ) and hope
they will want to merge it else I'll ask here again and as last resort
post it on my blog which I can't even get on djangoplanet even though
I asked several times in the past yearS.
Best ;)