While I haven't personally dealt with such a situation with my Django
code, I have worked with people who had this issue (un-deterministic
production servers). They used Docker to solve this issue. Essentially
you're looking for deterministic deploys, and Docker is the first thing
that jumps to my mind for something like this.
Is that a possibility that you can consider? If not, then I'm sure there
will be better answers to your question from other people in this group.
Asad Jibran Ahmed <surfer...@gmail.com>
On Tue, Oct 18, 2016 at 10:45 PM, Александр Христюхин <robosl...@gmail.com>
> I would like to ask community about methods of shipping Django in
> I do have some limitations, one of which is I don't know what packages are
> installed on production server (for example, postgres dev libraries or
> specific version of python).
> Right now my method is to create venv with specific version of Python,
> make venv relocatable, copy missing libraries into venv/lib, pack it into
> archive and ship to production servers.
> On application launch server has to unpack archive and run it somewhat
> like that:
>> $ LD_LIBRARY_PATH=venv/lib venv/bin/python venv/bin/gunicorn -c
>> gunicorn.conf myapp.wsgi:application
> In my case LD_LIBRARY_PATH is required for libpython and libpq (PostgreSQL
> query library).
> This does work, but I have to go through a lot of stuff.
> What I want to do is pack my application with specific python and
> libraries into one binary (on build server) and only ship this binary to
> production server. So application launch will look somewhat like that:
>> $ my-awesome-python-bin gunicorn -c gunicorn.conf myapp.wsgi:application
> Or if I could go even further and describe some startup logic:
>> def startup():
>> args = argparser.parse()
>> config = args.config
>> gunicorn.server(config, myapp.wsgi, 'application').run()
> ...and then:
>> $ my-awesome-bin -c myapp.conf
> Is there any way of doing that?
> Or could you suggest any easier (well, more convenient) way of shipping
> I did ask practically the same question on StackOverflow
> weeks ago, but none of given answers provide simple solution for my
> problem. I've tried nuitka, pyinstalled and cx_freeze with no success.
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to firstname.lastname@example.org.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.