uwsgi nginx django ubuntu 14.04 virtualenv
NickName:Joe Lin Ask DateTime:2015-06-21T11:23:08

uwsgi nginx django ubuntu 14.04 virtualenv

I am trying to run my simple django project on uwsgi and nginx, I use ubuntu 14.04 server.

I have followed the uWSGI doc,since here it works ok,but when it comes to this part it won't work for me ,I do not know why?here is the mysite_nginx.conf:

# mysite_nginx.conf

# the upstream component nginx needs to connect to
upstream django {
    #server unix:///home/ubuntu/d18/mysite/mysite.sock; # for a file socket
    server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}

# configuration of the server
server {
    # the port your site will be served on
    listen      8000;
    # the domain name it will serve for
    server_name 123.123.123.123; # this just my example IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 75M;   # adjust to taste

    # Django media
    location /media  {
        alias /path/to/your/mysite/media;  # your Django project's media files - amend as required
    }

    location /static {
        alias /path/to/your/mysite/static; # your Django project's static files - amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        uwsgi_pass  django;
        include     /home/ubuntu/d18/mysite/uwsgi_params; # the uwsgi_params file you installed
    }
}

I did not do the "python manage.py collectstatic", because I thought I just wanna see the sample mysite run on the nginx and uwsgi, however it just not work. Can someone tell me why?

Copyright Notice:Content Author:「Joe Lin」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30960980/uwsgi-nginx-django-ubuntu-14-04-virtualenv

More about “uwsgi nginx django ubuntu 14.04 virtualenv” related questions

uwsgi nginx django ubuntu 14.04 virtualenv

I am trying to run my simple django project on uwsgi and nginx, I use ubuntu 14.04 server. I have followed the uWSGI doc,since here it works ok,but when it comes to this part it won't work for me ...

Show Detail

Getting Django / NGINX / uWSGI to work on Ubuntu 14.04

I've setup my digitalocean droplet with Ubuntu 14.04. NGINX, uWSGI and a django application which i'm trying to get running. Could someone please help me out? I think i've had almost every tutoria...

Show Detail

How to get Django 1.7 working on Ubuntu 14.04 with nginx and virtualenv using python 2.7 while having python 3.4 installed?

I am a newbie to Django and Python installation. Intermediate with Ubuntu 14.04. These are my installations so far in my Ubuntu 14.04. apt-get install python3-setuptools --force-yes -y ## for py...

Show Detail

No module named django.core.wsgi with nginx, uwsgi and virtualenv

uwsgi.ini [uwsgi] vhost = true plugin = python socket = /tmp/pjwards.sock master = true enable-threads = true processes = 2 wsgi-file = /home/ubuntu/workspace/ward/www/fb_archive/wsgi.py virtualen...

Show Detail

Django, uwsgi, nginx, virtualenv, ImportError: No module named site

I have a Django app and a virtual env and I try to run it under nginx+uwsgi. I've configured the whole system as is described here. I have the CentOS 7 as well. However, I get the famous "ImportEr...

Show Detail

Linode Django uwsgi Nginx

The following setup is only letting me see the default Nginx html page. How can I get to Django? I've been following Linode's documentation on how to set this up (and numerous other tutorials), bu...

Show Detail

Deploying Django with uwsgi and nginx, uwsgi ok but nginx not working

I am trying to run my site, when i run uwsgi --socket 0.0.0.0:8080 --protocol=http --chdir /opt/virtualenv/landivarpj/ --wsgi-file /opt/virtualenv/landivarpj/landivarpj/wsgi.py i can access 192....

Show Detail

How to get uwsgi working with nginx and Django 1.7?

This is what I tried: I have a django.conf inside /etc/nginx/sites-available/ upstream django { server unix:///tmp/uwsgi.sock; } server { listen 80; server_name

Show Detail

nginx gives 502 error with uwsgi for running django on ubuntu 18.04 LTS

Note: I am new to django and its deployment. Deployed django through uwsgi and nginx according to the steps mentioned in this guide - except the emperor-vassal configuration and without any virtual

Show Detail

Django, Virtualenv, nginx + uwsgi import module wsgi error

Im trying to setup my django project on a staging server with nginx, virtualenv, and uwsgi, but I keep getting an import module wsgi error. If theres a community I can find an answer is here... Th...

Show Detail