mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix example config in docs.
This commit is contained in:
parent
fe3f7db88c
commit
d20fd9b411
@ -69,9 +69,9 @@ tmp_upload_dir = None # Set path used to store temporary uploads
|
||||
after_fork=lambda server, worker: server.log.info(
|
||||
"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>
|
||||
</div>
|
||||
<div class="section" id="parameter-descriptions">
|
||||
|
||||
@ -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>
|
||||
<pre class="literal-block">
|
||||
$ cd /path/to/gunicorn/examples/
|
||||
$ gunicorn --workers=2 test:application
|
||||
$ gunicorn --workers=2 test:app
|
||||
</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">
|
||||
$ cd ~/
|
||||
$ gunicorn --workers=12 awesomeproject.wsgi.main:main_app
|
||||
@ -99,13 +99,13 @@ Options:
|
||||
</div>
|
||||
<div class="section" id="django-projects">
|
||||
<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">
|
||||
$ cd $yourdjangoproject
|
||||
$ gunicorn_django --workers=2
|
||||
</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>Add <tt class="docutils literal"><span class="pre">"gunicorn"</span></tt> to INSTALLED_APPS in your settings file:</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">"gunicorn"</tt> to INSTALLED_APPS in your settings file:</p>
|
||||
<pre class="literal-block">
|
||||
INSTALLED_APPS = (
|
||||
...
|
||||
@ -119,12 +119,12 @@ python manage.py run_gunicorn
|
||||
</div>
|
||||
<div class="section" id="paste-compatible-projects">
|
||||
<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">
|
||||
$ cd $yourpasteproject
|
||||
$ gunicorn_paste --workers=2 development.ini
|
||||
</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">
|
||||
[server:main]
|
||||
use = egg:gunicorn#main
|
||||
|
||||
@ -26,9 +26,9 @@ Example gunicorn.conf.py
|
||||
after_fork=lambda server, worker: server.log.info(
|
||||
"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
|
||||
----------------------
|
||||
@ -73,4 +73,4 @@ user:
|
||||
The user as which worker processes will by launched.
|
||||
|
||||
tmp_upload_dir:
|
||||
Set the path used to store temporarily the body of the request.
|
||||
Set the path used to store temporarily the body of the request.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user