[Cherokee] Using virtualenv and uWSGI via a source

11 views
Skip to first unread message

Max Countryman

unread,
Sep 27, 2010, 8:25:11 AM9/27/10
to cher...@lists.octality.com
I've followed a setup for uWSGI previously discussed here and set up an xml file that pretty much contains everything I was doing on the command line (Thanks Roberto!):

wsgi.xml
---
<uwsgi>
<pythonpath>/usr/local/django/voxi/</pythonpath>
<pythonpath>/usr/local/django/</pythonpath>
<env>DJANGO_SETTINGS_MODULE=voxi.settings</env>
<module>django.core.handlers.wsgi.WSGIHandler()</module>
<master/>
<processes>6</processes>
<socket>/tmp/cherokee/voxi.sock</socket>
<chmod/>
</uwsgi>


I'm wondering what, if anything, I need to do to make this work with virtualenv? Is it as simple as running './uwsgi -x wsgi.xml -H voxi'?

_______________________________________________
Cherokee mailing list
Cher...@lists.octality.com
http://lists.octality.com/listinfo/cherokee

Roberto De Ioris

unread,
Sep 27, 2010, 8:44:40 AM9/27/10
to Max Countryman

Il giorno 27/set/2010, alle ore 14.25, Max Countryman ha scritto:

> I've followed a setup for uWSGI previously discussed here and set up an xml file that pretty much contains everything I was doing on the command line (Thanks Roberto!):
>
> wsgi.xml
> ---
> <uwsgi>
> <pythonpath>/usr/local/django/voxi/</pythonpath>
> <pythonpath>/usr/local/django/</pythonpath>
> <env>DJANGO_SETTINGS_MODULE=voxi.settings</env>
> <module>django.core.handlers.wsgi.WSGIHandler()</module>
> <master/>
> <processes>6</processes>
> <socket>/tmp/cherokee/voxi.sock</socket>
> <chmod/>
> </uwsgi>
>
>
> I'm wondering what, if anything, I need to do to make this work with virtualenv? Is it as simple as running './uwsgi -x wsgi.xml -H voxi'?
>
> __

Yes but try to use absolute path for venv.

By the way i suggest you to include the virtualenv in the xml file

<home>/path_to/voxi</home>

--
Roberto De Ioris
http://unbit.it
JID: rob...@jabber.unbit.it

Max Countryman

unread,
Sep 27, 2010, 8:49:39 AM9/27/10
to cher...@lists.octality.com
Perfect! Thanks so much, Roberto.

Max Countryman

unread,
Sep 28, 2010, 5:27:42 PM9/28/10
to cher...@lists.octality.com
I seem to be having an issue with uWSGI parsing:

wsgi.xml
---
<uwsgi>
<home>/srv/python-environments/voxinfinitus/</home>
<pythonpath>/srv/python-environments/voxinfinitus/</pythonpath>
<pythonpath>/srv/python-environments/</pythonpath>
<env>DJANGO_SETTINGS_MODULE=settings</env>


<module>django.core.handlers.wsgi.WSGIHandler()</module>
<master/>
<processes>6</processes>

<socket>/tmp/cherokee/voxi-live.sock</socket>
<chmod/>
</uwsgi>

Have I made a mistake in the XML?

Max Countryman

unread,
Sep 28, 2010, 5:39:32 PM9/28/10
to cher...@lists.octality.com
Actually it seems I had made a mistake on the command line, pointing to the wrong file. Unfortunately I do still have an ImportError:

[uWSGI] parsing config file /srv/python-environments/voxinfinitus/wsgi.xml
*** Starting uWSGI 0.9.6.2 (32bit) on [Tue Sep 28 14:37:22 2010] ***
compiled with version: 4.5.1
Python version: 2.6.5 (r265:79063, Apr 1 2010, 05:22:20)
[GCC 4.4.3 20100316 (prerelease)]
your memory page size is 4096 bytes
allocated 412 bytes (0 KB) for 1 request's buffer.
Setting PythonHome to /srv/python-environments/voxinfinitus/...
binding on UNIX socket: /tmp/cherokee/voxi-live.sock
your server socket listen backlog is limited to 64 connections
added /srv/python-environments/voxinfinitus/ to pythonpath.
added /srv/python-environments/ to pythonpath.
initializing hooks...done.
ImportError: No module named WSGIHandler()

I'm able to import that module in the Python interpreter without an issue. Hmm...

Max Countryman

unread,
Sep 28, 2010, 6:44:31 PM9/28/10
to cher...@lists.octality.com
I'm sorry, I must be half asleep, I made a mistake in the XML, I used a period when I should have used a semicolon:

>> <module>django.core.handlers.wsgi.WSGIHandler()</module>

Should have been:

<module>django.core.handlers.wsgi:WSGIHandler()</module>

My apologies! I wasn't paying close enough attention. All is working now.

Reply all
Reply to author
Forward
0 new messages