Edgewall Software

Changes between Version 12 and Version 13 of Gunicorn


Ignore:
Timestamp:
Jan 19, 2016, 2:50:52 PM (4 years ago)
Author:
figaro
Comment:

Further cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • Gunicorn

    v12 v13  
    33[http://gunicorn.org/ Gunicorn] (Green Unicorn) is a Python WSGI HTTP Server for UNIX. It is a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy.
    44
    5 1. Install gunicorn
     5'''1. Install Gunicorn'''
    66
    7 Gunicorn is a Python project which lives on pypi, so we can use easy_install or pip to install Gunicorn:
     7Gunicorn is a Python project which can be found on [pypi:gunicorn PyPi], so we can use `easy_install` or `pip` to install:
    88{{{#!sh
    99$> pip install gunicorn
     
    1212I prefer to use a [pypi:virtualenv], to not have to install Gunicorn in a system wide fashion.
    1313
    14 2. Write your wsgi file
     14'''2. Write your wsgi file'''
    1515
    16 Gunicorn is [http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface WSGI compliant], so we need a simple Python script `tracwsgi.py` that functions as an entry point:
     16Gunicorn is [wikipedia:Web_Server_Gateway_Interface WSGI compliant], so we need a Python script `tracwsgi.py` that functions as an entry point:
    1717
    1818{{{#!python
     
    2222sys.stdout = sys.stderr
    2323
    24 #put here your ENV's Variables
     24# put here your ENV variables
    2525# here is an example with multiple instances
    2626os.environ['TRAC_ENV_PARENT_DIR'] = '/home/repos/trac/'
     
    2929import trac.web.main
    3030application = trac.web.main.dispatch_request
    31 
    3231}}}
    3332
     
    4544How it works: Gunicorn is looking for a method called "application" in the tracwsgi.py file.
    4645
    47 3. Configure Nginx
     46'''3. Configure Nginx'''
    4847
    4948Now we will make it work with Nginx, which will redirect Trac requests to Gunicorn: