You are not logged in.
Pages: 1
Hi, I am attempting to get nginx and uwsgi running on my local box, I followed any number of tutorials and this one had the most complete information.
http://gekicstart.ca/tech-posts/nginxuwsgidjango-stack/
It is written for Debian\Ubuntu so I had to transpose a bit. I got through most of it and I got to the section on creating the daemon for uwsgi that loads a specific project. It creates a /etc/init/projectX.conf file that it loads the uwsgi specific information from. I didn't know enough to create a daemon in arch so I opted for running the command by cli.
/usr/bin/uwsgi socket /root/Workspace/Eclipse/sockets/projectX.sock --chmod-socket --module wsgi_app --pythonpath /root/Workspace/Eclipse/projectX/uwsgi -p 1
I also extended the relative paths to absolute from the example code, so far so good. but when it loads the below file.
when I run this it craps on the django import
#!/usr/bin/python2.7
2 import sys
3 import os
4 import django.core.handlers.wsgi
5 sys.path.append("/Eclipse/")
6 os.environ['DJANGO_SETTINGS_MODULE'] = 'projectX.settings'
7 application = django.core.handlers.wsgi.WSGIHandler()
It can't find django, I tested by reducing the statement
import django.core.handlers.wsgi
section by section, in other words I tested 'import django.core.handlers', 'import django.core' etc. each time it couldn't find the reference, I know that django is loaded in python2.7/site-packages.
Further I also opened up a python2.7 prompt and used the same import statement successfully. I tried changing the declaration for the python script to
#!/usr/bin/python
#!/usr/bin/python2
#!/usr/bin/python2.7
None has solved the problem. Does anyone have an idea why it can't see django? The python prompt sees it no problem.
thanks in advance for your help.
--jerry
Last edited by jk121960 (2012-04-24 11:29:21)
Arch Awesome, Ranger & Vim the coding triple threat.
Offline
And what happens if you do the following before importing django (when running the script, not from within the interpreter:
print(sys.path)
coder formally known as EnvoyRising
Offline
Hi, I finally figured it out and I meant to reply yesterday, but what I did was recompile with a python2.7 option, this solved the immediate problem. I am still dealing with some others but hopefully I will figure those out also.
thanks for your post and your help .
--jerry
Arch Awesome, Ranger & Vim the coding triple threat.
Offline
Pages: 1