Tuesday, April 24, 2012

Re: Django nginx uWSGI

OK finally got back to it, I did what you said in part. The examples on the uWSGI page show how to get a django app to function but the part that they don't show is the static files config. I did do the rebuild and that did help out with part of the original problem, and I also had to add 1 more depth of folder to the folder reference for the settings file. Now I think I am almost there but now I get a bad gateway reference. So I am going to have to figure this out. I also tried it with http instead of the socket and I get the same bad gateway response. 

thanks for your help I knew there might be a version clash and I didn't know how to force the one version, because I could see django in the python2.7 site-packages directory. 

--jerry

On Sun, Apr 22, 2012 at 2:01 PM, Roberto De Ioris <roberto@unbit.it> wrote:

> 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
> import sys
> import os
> import django.core.handlers.wsgi
> sys.path.append("/Eclipse/")
> os.environ['DJANGO_SETTINGS_MODULE'] = 'projectX.settings'
> application = django.core.handlers.wsgi.WSGIHandler()
>
>

I suggest you to follow official docs/quickstart

http://projects.unbit.it/uwsgi/wiki/Quickstart

Most of the blog-posts out-there refer to very particular configs that could
make mess in your mind.

By the way, it looks like you have built uWSGI for a different python
version.

From its source directory do

make clean
python2.7 uwsgiconfig.py --build

to be sure the correct python version is used (the first command is used
for cleaning files from the previous build)

When uWSGi starts it print a good amount of log-lines, try to always read
(or report) them to fastly get help.


--
Roberto De Ioris
http://unbit.it

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--

Gerald Klein DBA

ContactMe@geraldklein.com

www.geraldklein.com

jk@zognet.com

708-599-0352


Linux registered user #548580 



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment