Re: Deployment and user libraries (builds on the Django tutorial)

32 views
Skip to first unread message

Alex Mandel

unread,
Jan 17, 2013, 6:35:53 PM1/17/13
to django...@googlegroups.com
On 01/17/2013 12:11 PM, Frederik T wrote:
> I've worked my way through the Django tutorial successfully, up to
> https://docs.djangoproject.com/en/dev/intro/reusable-apps/ which worked for
> the development test server.
> I have refactored out the polls application and turned it into a python
> package, as suggested, which I then installed as a local user library via "p
> ython setup.py install --user"
> This worked for the dev server as well.
>
> After that I set up apache and mod_wsgi and configured apache to bind the
> path to the application to /test/
> (WSGIScriptAlias /test/ /tmp/test/apache/django.wsgi, chowned to
> apache:apache)
> which also worked.
> What did not work, however, was apache, or python/django finding the polls
> package.
>
> I am pretty new to python/django but I am pretty sure that I should
> relocate the polls package.
> (currently @ /home/me/.local/lib/python2.7/site-packages/)
> Where is the best place to put it?
> Is there a better way to do this altogether?
>
>
>

If you're going to install it as a python package, either install it to
the system or to the user that mod_wsgi executes under or into a python
virtualenv. Basically you need to ensure that it's on the python path
for the user running the wsgi. You can add additional paths to the wsgi
to make sure it gets picked up too.

I also assume that the django site that your wsgi script points at has
your app in the settings.py under Installed Apps.

Enjoy,
Alex

Frederik T

unread,
Jan 19, 2013, 7:11:57 AM1/19/13
to django...@googlegroups.com, te...@wildintellect.com

If you're going to install it as a python package, either install it to
the system or to the user that mod_wsgi executes under or into a python
virtualenv. Basically you need to ensure that it's on the python path
for the user running the wsgi. You can add additional paths to the wsgi
to make sure it gets picked up too.
I will try to install it for the apache user first, then I'll try the other options.
I also assume that the django site that your wsgi script points at has
your app in the settings.py under Installed Apps.
Yes, that's all set correct. When I place the app into the folder directly then it all works out fine.
Thanks for your time, especially since I am aware that this could have passed as a stupid/no-brainer question, but it was a roadblock to me but if this works out then I don't see any major problems anytime soon.
Cheers!
Reply all
Reply to author
Forward
0 new messages