Documentation for deployment on OpenShift Origin

88 views
Skip to first unread message

James Pic

unread,
Mar 15, 2016, 5:42:31 PM3/15/16
to django-d...@googlegroups.com
Hi,

OpenShift Origin is an Open Source PaaS system based on cool stuff
like kubernetes, docker, ansible, golang ... developed mostly by
RedHat. It's probably comparable to Heroku, but more flexible and
completely Open Source (thanks RedHat !!).

I use OpenShift every day, including for a few open source projects
such as the political-memory project (mempol and compotista) and
django-autocomplete-light's test_project which are deployed by travis
when tests succeed. It's really changed my life as a django developer
and I'd like to share it with the community (reminds me about my post
on uWSGI on this list in 2011 heh).

I'd like to contribute documentation about deployment of Django
projects on OpenShift, would that be useful ?

Thanks

Best

--
http://yourlabs.org

Tim Graham

unread,
Mar 15, 2016, 6:27:06 PM3/15/16
to Django developers (Contributions to Django itself)
Does OpenShift have some suitable docs you can contribute to? I don't think the Django docs are the right place for specific deployment scenarios like this.

James Pic

unread,
Mar 15, 2016, 6:37:45 PM3/15/16
to django-d...@googlegroups.com
Perhaps, should we also start moving mod_python / uwsgi docs upstream ?

Tim Graham

unread,
Mar 15, 2016, 7:04:50 PM3/15/16
to Django developers (Contributions to Django itself)
I don't mind maintaining the instructions for these common platforms and if Django's docs didn't have any deployment instructions that might be a bit odd.

For what it's worth, the uwsgi docs do have some nice (at a very quick glance) looking instructions: https://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

James Pic

unread,
Mar 15, 2016, 7:24:19 PM3/15/16
to django-d...@googlegroups.com
Pretty nice docs they have nowadays I recon !

Perhaps we don't need documentation for all open source PaaS out there
(ie. DEIS, the open source heroku-ish PaaS for CoreOs). Having at
least one could help though.

The only documentation about deploying django apps is in their blog
and it's not very good: it assumes the reader knows OpenShift very
well already on one hand, and it doesn't do Django very well on the
other hand (confused staticfiles configuration for example). A
documentation targeted at Django users who want to try to deploy on
OpenShift is missing IMHO.

I'm already doing some PRs to fix their example project which is the
official only thing I could find they have that would relate to
documentation so far, I also asked on their IRC channel if there's
anywhere I could contribute actual documentation.

Thanks for your feedback !

James Pic

unread,
Mar 15, 2016, 8:00:31 PM3/15/16
to django-d...@googlegroups.com
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 ;)

James Pic

unread,
Mar 16, 2016, 2:59:18 PM3/16/16
to django-d...@googlegroups.com

Hi all!

Perhaps the wiki is the best place for this kind of things?

Thanks for your feedback

Best

James

Reply all
Reply to author
Forward
0 new messages