Linode Django uwsgi Nginx
NickName:Shane G Ask DateTime:2016-11-29T08:27:05

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), but they don't use systemd, so things are a bit different.

https://www.linode.com/docs/websites/nginx/deploy-django-applications-using-uwsgi-and-nginx-on-ubuntu-14-04

I am using Linode with Fedora24. I have installed my virutalenv at /home/ofey/djangoenv and activated it, Django is installed using pip at /home/ofey/qqiProject Into the virtualenv I've installed uwsgi. Firstly, /etc/systemd/system/uwsgi.service

[Unit]
Description=uWSGI Emperor service
After=syslog.target

[Service]
ExecStart=/home/ofey/djangoenv/bin/uwsgi --emperor /etc/uwsgi/sites
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target

This executes,

/etc/uwsgi/sites/qqiProject.ini

[uwsgi]
project = qqiProject
base = /home/ofey

chdir = %(base)/%(project)
home = %(base)/djangoenv
module = %(project).wsgi:application

master = true
processes = 2

socket = %(base)/%(project)/%(project).sock
chmod-socket = 664
vacuum = true

Also,

/etc/nginx/sites-available/qqiProject

server {
    listen 80;
    server_name qqiresources.com www.qqiresources.com;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/django/qqiProject;
    }

    location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/home/django/qqiProject/qqiProject.sock;
    }
}

The file /etc/nginx/nginx.conf has not been changed.

The user is ofey, I've used,

$ sudo systemctl daemon-reload
$ sudo systemctl restart nginx
$ sudo systemctl start uwsgi.service

Started Django with,

$ python manage.py runserver

To Django's settings.py I turned off debugging and added a host

DEBUG = False

ALLOWED_HOSTS = ['qqiresources.com']

I have also created a symbolic link,

sudo ln -s /etc/nginx/sites-available/qqiProject /etc/nginx/sites-enabled

Any help would be greatly appreciated,

Thanks

Copyright Notice:Content Author:「Shane G」,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/40855861/linode-django-uwsgi-nginx

More about “Linode Django uwsgi Nginx” related questions

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

Basic uwsgi configuration with Linode

I am following a tutorial on configuring Django, nginx and uwsgi. https://gist.github.com/evildmp/3094281 The first part of which involves configuring uwsgi to run this python file /home/ofey/dja...

Show Detail

Serving django with nginx and uWSGI

I followed this post to serve my django project. The project runs well with manage.py runserver and I want to set it up for production. Here are my setting files: nginx.conf: upstream django {

Show Detail

Trouble with using Nginx with django and uwsgi

I follow the steps in http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html but when all the steps done without any error I visit 127.0.0.1:8000, it response with a time-out, my

Show Detail

django nginx uwsgi not working

i ve created a django application not using virtual environment. I ve installed nginx and trying to integrate them via uwsgi application. Here my configurations files. [uwsgi] chdir = /home/elastic/

Show Detail

Django uWSGI Nginx

I am following this tutorial but i am having a problem I'm getting a 502 Nginx error. tutorial link Ive check the error logs and it says uwsgi.log ImportError: No module named khcards.wsgi my

Show Detail

Internal Server Error for Django with uwsgi / nginx on Debian8.7

I'm pretty beginner in server technologies and I'm struggling to deploy a Django app to Debian8 server. I've been following : this tutorial but I couldn't start uWSGI service so I followed this

Show Detail

How to deploy django with nginx and uwsgi

i have a problem to deploy my django server with uwsgi and nginx. The command dev_ralph runserver 0.0.0.0:8000 starts the development server and works fine. But my goal now is to deploy a production

Show Detail

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

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