Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You would be using <code>makeserver</code> for test deployment. In this case you often wrap a little runserver-Script, like this (as the tutorial also points out):</p> <pre><code>#!/bin/env python from wsgiref.simple_server import make_server from yourapp.core import app # whereever your wsgi app lives if __name__ == '__main__': server = make_server('0.0.0.0', 6547, app) print ('Starting up server on http://localhost:6547') server.serve_forever() </code></pre> <p>If you want to deploy to Apache you need the mod_wsgi module. I would recommend getting a hoster with nginx or lighthttpd support. WSGI applications can very conveniently deployed using the uwsgi module in combination with virtualenv.</p> <p>If your hoster doesn't allow you to open ports, you can configure uwsgi to use unix sockets.</p> <p>I wrote a blog post explaining how to deploy Django behind uwsgi + nginx once, you might want to use this as a starting point for playing around with deployment settings: <a href="http://blog.johannesklug.de/2012/11/27/deploying-django-behind-nginx-with-uwsgi-and-virtualenv/" rel="nofollow">http://blog.johannesklug.de/2012/11/27/deploying-django-behind-nginx-with-uwsgi-and-virtualenv/</a></p> <p>Note: the same app object you feed into make_server will you used by uwsgi to start its worker process and open a socket.</p> <p>A sample configuration (not tested but excerpted from my blog post) for uwsgi: </p> <pre><code># uwsgi.ini [uwsgi] # path to where you put your project code chdir=/home/project/project # if the app object resides in core.py module=core:app # this switch tells uwsgi to spawn a master process, # that will dynamically spawn new child processes for # server requests master=True # uwsgi stores the pid of your master process here pidfile=/home/project/master.pid vacuum=True # path to your virtual environment, you should be using virtualenv home=/home/project/env/ # path to log file daemonize=/home/project/log # this is where you need to point nginx to, # if you chose to put this in project home make # sure the home dir is readable and executable by # nginx socket=/tmp/uwsgi.sock </code></pre> <p>Sample config for nginx: </p> <pre><code>server { listen 80; server_name yourserver.example.org; location / { uwsgi_pass unix:///tmp/uwsgi.sock; include uwsgi_params; } } </code></pre>
    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. This table or related slice is empty.
    1. VO
      singulars
      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