> How do you can make sure that you can install all the libs your Django app, 
> or any dependencies you may have are installed correctly?
> 
I'm installing dependencies in virtualenv.
> How you do setup static file serving? 
> 

I'm shipping Nginx binary and config along with app. Static files are collected 
and archived on build server, then shipped with app and Nginx.
> How you plan to run your Django app itself?
> 
I've posted this in my first message, currently I'm running Django with 
gunicorn with virtualenv's Python.

> Also, how you can set LD_LIBRARY_PATH if you don't know if there is even 
> libpq5 in the system, or is it even a correct version?

I'm not relying on system's libpq5, that's why I copy it to venv/lib and use 
LD_LIBRARY_PATH. So it would be loaded from venv/lib and not from the system.

To clarify, my current setup works in hostile environments where I could only 
rely on OS distro. What I'm looking for is alternative to virtualenv.


> On 20 Oct 2016, at 09:15, Jani Tiainen <rede...@gmail.com> wrote:
> 
> Hi,
> 
> If that's truely the case that you don't control anything, deploying Django 
> will be really a hard problem. 
> How do you can make sure that you can install all the libs your Django app, 
> or any dependencies you may have are installed correctly?
> 
> How you do setup static file serving? 
> How you plan to run your Django app itself?
> Also, how you can set LD_LIBRARY_PATH if you don't know if there is even 
> libpq5 in the system, or is it even a correct version?
> 
> On 19.10.2016 16:18, GMail wrote:
>> In fact I do have to use LD_LIBRARY_PATH. Mostly because of libpq5.
>> And again, I have no control over production server, I don't even know in 
>> which directory my virtualenv will land.
>> 
>>> On 19 Oct 2016, at 16:02, Avraham Serour <tovm...@gmail.com 
>>> <mailto:tovm...@gmail.com>> wrote:
>>> 
>>> using a virtualenv is common and suggested, but don't need to mess with 
>>> LD_LIBRARY_PATH 
>>> 
>>> you can create the virtualenv in your home directory or the application 
>>> directory and run the python executable from the virtualenv, no need to 
>>> touch LD_LIBRARY_PATH 
>>> 
>>> 
>>> 
>>> On Wed, Oct 19, 2016 at 3:41 PM, GMail <robosl...@gmail.com 
>>> <mailto:robosl...@gmail.com>> wrote:
>>> Thanks for replies!
>>> 
>>> I'm aware of Docker solution, but it's not quite what I'm looking for.
>>> I don't have any control of a production server, I don't have sudo and I 
>>> can't install any packages. It also concerns Docker, since it could be not 
>>> installed.
>>> And yes, OS is always Ubuntu Linux in my case, but version is not fixed, so 
>>> two servers could have different Ubuntu versions.
>>> 
>>> I'm looking for something universal, like Go programs - you get one binary 
>>> with all libraries included. It seems to me that utils like cx_freeze or 
>>> py2exe do that, but they don't work with Django, since you need to expose 
>>> WSGI application to WSGI server (gunicron/uWSGI/etc).
>>> 
>>> Like I said in first letter, virtualenv does provide a solution for this 
>>> setup, but there's too much work to be done and you have to explicitly set 
>>> LD_LIBRARY_PATH on production server.
>>> 
>>>> On 19 Oct 2016, at 12:40, Jani Tiainen <rede...@gmail.com 
>>>> <mailto:rede...@gmail.com>> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> 
>>>> Like someone else already pointed out, Docker containers are quite 
>>>> powerful feature to do deterministic deployments to unix-like machines. 
>>>> Only pre-requirement is to have Docker running on target machine but 
>>>> otherwise you're free to build your containers as you wish. This also 
>>>> eliminates quite nicely "works for me" problems.
>>>> 
>>>> On 18.10.2016 21:45, Александр Христюхин wrote:
>>>>> Hi!
>>>>> 
>>>>> 
>>>>> I would like to ask community about methods of shipping Django in 
>>>>> production.
>>>>> 
>>>>> 
>>>>> 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 
>>>>> Django?
>>>>> 
>>>>> 
>>>>> I did ask practically the same question on StackOverflow 
>>>>> <http://stackoverflow.com/questions/39913847/is-there-a-way-to-compile-python-application-into-static-binary/>
>>>>>  couple 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 
>>>>> <mailto:django-users+unsubscr...@googlegroups.com>.
>>>>> To post to this group, send email to django-users@googlegroups.com 
>>>>> <mailto:django-users@googlegroups.com>.
>>>>> Visit this group at https://groups.google.com/group/django-users 
>>>>> <https://groups.google.com/group/django-users>.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/django-users/51a3ef5f-800a-48db-9697-03d069238834%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/django-users/51a3ef5f-800a-48db-9697-03d069238834%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>>>> For more options, visit https://groups.google.com/d/optout 
>>>>> <https://groups.google.com/d/optout>.
>>>> 
>>>> -- 
>>>> Jani Tiainen
>>>> 
>>>> -- 
>>>> 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 
>>>> <mailto:django-users+unsubscr...@googlegroups.com>.
>>>> To post to this group, send email to django-users@googlegroups.com 
>>>> <mailto:django-users@googlegroups.com>.
>>>> Visit this group at https://groups.google.com/group/django-users 
>>>> <https://groups.google.com/group/django-users>.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/2d22ef8d-57ff-687b-d355-b4cdaf7c4f4d%40gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/2d22ef8d-57ff-687b-d355-b4cdaf7c4f4d%40gmail.com?utm_medium=email&utm_source=footer>.
>>>> For more options, visit https://groups.google.com/d/optout 
>>>> <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 django-users+unsubscr...@googlegroups.com 
>>> <mailto:django-users+unsubscr...@googlegroups.com>.
>>> To post to this group, send email to django-users@googlegroups.com 
>>> <mailto:django-users@googlegroups.com>.
>>> Visit this group at https://groups.google.com/group/django-users 
>>> <https://groups.google.com/group/django-users>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/35FCB771-1696-4C24-B5AB-ADB862EF701B%40gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/35FCB771-1696-4C24-B5AB-ADB862EF701B%40gmail.com?utm_medium=email&utm_source=footer>.
>>> 
>>> For more options, visit https://groups.google.com/d/optout 
>>> <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 django-users+unsubscr...@googlegroups.com 
>>> <mailto:django-users+unsubscr...@googlegroups.com>.
>>> To post to this group, send email to django-users@googlegroups.com 
>>> <mailto:django-users@googlegroups.com>.
>>> Visit this group at https://groups.google.com/group/django-users 
>>> <https://groups.google.com/group/django-users>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAFWa6tJk7u0k3%3De5Vww_FevZKCLhQFMmDc2fV2_jGov3613tHg%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/CAFWa6tJk7u0k3%3De5Vww_FevZKCLhQFMmDc2fV2_jGov3613tHg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>>> For more options, visit https://groups.google.com/d/optout 
>>> <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 django-users+unsubscr...@googlegroups.com 
>> <mailto:django-users+unsubscr...@googlegroups.com>.
>> To post to this group, send email to django-users@googlegroups.com 
>> <mailto:django-users@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/django-users 
>> <https://groups.google.com/group/django-users>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/FDF7452A-7204-48B2-9C41-F95C8AC9C387%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/FDF7452A-7204-48B2-9C41-F95C8AC9C387%40gmail.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> -- 
> Jani Tiainen
> 
> -- 
> 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 
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com 
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users 
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/046959dc-7cb3-2c1a-0633-df9026e57b48%40gmail.com
>  
> <https://groups.google.com/d/msgid/django-users/046959dc-7cb3-2c1a-0633-df9026e57b48%40gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/69EE59E6-E7D2-4FD6-9B6C-F545F83574B7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to