Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Once you have created an dJango application. Just follow these steps:</p> <p><strong>STEP 1.</strong> Create a file say uwsgi.ini in your Django Project Directory. i.e besides manage.py</p> <pre><code>[uwsgi] # set the http port http = :&lt;port_no&gt; # change to django project directory chdir = &lt;project directory&gt; # add /var/www to the pythonpath, in this way we can use the project.app format pythonpath = /var/www # set the project settings name env = DJANGO_SETTINGS_MODULE=&lt;project_name&gt;.settings # load django module = django.core.handlers.wsgi:WSGIHandler() </code></pre> <p><strong>STEP 2.</strong> Under <strong><em>/etc/nginx/sites-available</em></strong> add .conf file</p> <pre><code>server { listen 84; server_name example.com; access_log /var/log/nginx/sample_project.access.log; error_log /var/log/nginx/sample_project.error.log; # https://docs.djangoproject.com/en/dev/howto/static-files/#serving-static-files-in-production location /static/ { # STATIC_URL alias /home/www/myhostname.com/static/; # STATIC_ROOT expires 30d; } } </code></pre> <p><strong>STEP 3.</strong> In nginx.conf, pass the request to your Django application</p> <p>Under the server { } block, </p> <pre><code>location /yourapp { include uwsgi_params; uwsgi_pass &lt;your app address, eg.localhost&gt;:&lt;portno&gt;; } </code></pre> <p><strong>STEP 4.</strong> Run the uwsgi.ini</p> <pre><code>&gt; uwsgi --ini uwsgi.ini </code></pre> <p>Now any request to your nGINX will pass the request to your Django App via uwsgi.. Enjoy :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload