Fix example config in docs.

This commit is contained in:
Paul J. Davis 2010-03-25 20:02:18 -04:00
parent fe3f7db88c
commit d20fd9b411
3 changed files with 12 additions and 12 deletions

View File

@ -69,9 +69,9 @@ tmp_upload_dir = None # Set path used to store temporary uploads
after_fork=lambda server, worker: server.log.info( after_fork=lambda server, worker: server.log.info(
"Worker spawned (pid: %s)" % worker.pid), "Worker spawned (pid: %s)" % worker.pid),
before_fork=lambda server, worker: True, before_fork=lambda server, worker: True
before_exec=lambda server: server.log.info("Forked child, reexecuting" before_exec=lambda server: server.log.info("Forked child, reexecuting")
</pre> </pre>
</div> </div>
<div class="section" id="parameter-descriptions"> <div class="section" id="parameter-descriptions">

View File

@ -59,9 +59,9 @@
<p>Thirty seconds to launch the <a class="reference external" href="http://github.com/benoitc/gunicorn/blob/master/examples/test.py">example application</a> packaged with Gunicorn:</p> <p>Thirty seconds to launch the <a class="reference external" href="http://github.com/benoitc/gunicorn/blob/master/examples/test.py">example application</a> packaged with Gunicorn:</p>
<pre class="literal-block"> <pre class="literal-block">
$ cd /path/to/gunicorn/examples/ $ cd /path/to/gunicorn/examples/
$ gunicorn --workers=2 test:application $ gunicorn --workers=2 test:app
</pre> </pre>
<p>The module <tt class="docutils literal"><span class="pre">test:application</span></tt> specifies the complete module name and WSGI callable. You can replace it with anything that is available on your <tt class="docutils literal"><span class="pre">PYTHONPATH</span></tt> like such:</p> <p>The module <tt class="docutils literal">test:app</tt> specifies the complete module name and WSGI callable. You can replace it with anything that is available on your <tt class="docutils literal">PYTHONPATH</tt> like such:</p>
<pre class="literal-block"> <pre class="literal-block">
$ cd ~/ $ cd ~/
$ gunicorn --workers=12 awesomeproject.wsgi.main:main_app $ gunicorn --workers=12 awesomeproject.wsgi.main:main_app
@ -99,13 +99,13 @@ Options:
</div> </div>
<div class="section" id="django-projects"> <div class="section" id="django-projects">
<h1>Django Projects</h1> <h1>Django Projects</h1>
<p><a class="reference external" href="http://djangoproject.com">Django</a> projects can be handled easily by Gunicorn using the <tt class="docutils literal"><span class="pre">gunicorn_django</span></tt> command:</p> <p><a class="reference external" href="http://djangoproject.com">Django</a> projects can be handled easily by Gunicorn using the <tt class="docutils literal">gunicorn_django</tt> command:</p>
<pre class="literal-block"> <pre class="literal-block">
$ cd $yourdjangoproject $ cd $yourdjangoproject
$ gunicorn_django --workers=2 $ gunicorn_django --workers=2
</pre> </pre>
<p>But you can also use the <tt class="docutils literal"><span class="pre">run_gunicorn</span></tt> <a class="reference external" href="http://docs.djangoproject.com/en/dev/howto/custom-management-commands/">admin command</a> like the other <tt class="docutils literal"><span class="pre">management.py</span></tt> commands.</p> <p>But you can also use the <tt class="docutils literal">run_gunicorn</tt> <a class="reference external" href="http://docs.djangoproject.com/en/dev/howto/custom-management-commands/">admin command</a> like the other <tt class="docutils literal">management.py</tt> commands.</p>
<p>Add <tt class="docutils literal"><span class="pre">&quot;gunicorn&quot;</span></tt> to INSTALLED_APPS in your settings file:</p> <p>Add <tt class="docutils literal">&quot;gunicorn&quot;</tt> to INSTALLED_APPS in your settings file:</p>
<pre class="literal-block"> <pre class="literal-block">
INSTALLED_APPS = ( INSTALLED_APPS = (
... ...
@ -119,12 +119,12 @@ python manage.py run_gunicorn
</div> </div>
<div class="section" id="paste-compatible-projects"> <div class="section" id="paste-compatible-projects">
<h1>Paste-compatible projects</h1> <h1>Paste-compatible projects</h1>
<p>For <a class="reference external" href="http://pythonpaste.org/script/">Paste</a> compatible projects (<a class="reference external" href="http://pylonshq.com/">Pylons</a>, <a class="reference external" href="http://turbogears.org/2.0/">TurboGears 2</a>, ...) use the <tt class="docutils literal"><span class="pre">gunicorn_paste</span></tt> command:</p> <p>For <a class="reference external" href="http://pythonpaste.org/script/">Paste</a> compatible projects (<a class="reference external" href="http://pylonshq.com/">Pylons</a>, <a class="reference external" href="http://turbogears.org/2.0/">TurboGears 2</a>, ...) use the <tt class="docutils literal">gunicorn_paste</tt> command:</p>
<pre class="literal-block"> <pre class="literal-block">
$ cd $yourpasteproject $ cd $yourpasteproject
$ gunicorn_paste --workers=2 development.ini $ gunicorn_paste --workers=2 development.ini
</pre> </pre>
<p>To use the <tt class="docutils literal"><span class="pre">paster</span></tt> command add a sever section for Gunicorn:</p> <p>To use the <tt class="docutils literal">paster</tt> command add a sever section for Gunicorn:</p>
<pre class="literal-block"> <pre class="literal-block">
[server:main] [server:main]
use = egg:gunicorn#main use = egg:gunicorn#main

View File

@ -26,9 +26,9 @@ Example gunicorn.conf.py
after_fork=lambda server, worker: server.log.info( after_fork=lambda server, worker: server.log.info(
"Worker spawned (pid: %s)" % worker.pid), "Worker spawned (pid: %s)" % worker.pid),
before_fork=lambda server, worker: True, before_fork=lambda server, worker: True
before_exec=lambda server: server.log.info("Forked child, reexecuting" before_exec=lambda server: server.log.info("Forked child, reexecuting")
Parameter Descriptions Parameter Descriptions
---------------------- ----------------------