Skip to content

Commit

Permalink
update wsgi doc
Browse files Browse the repository at this point in the history
  • Loading branch information
keotl committed Dec 5, 2019
1 parent f1f18f3 commit 4c1e72c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/quickstart/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ We will therefore move our resource classes into their own files, and use Jivago
.. literalinclude:: simple_resource.py
:language: python

*application.py*
*main.py*

.. literalinclude:: minimal_wsgi.py
:language: python
Expand All @@ -41,12 +41,12 @@ We will therefore move our resource classes into their own files, and use Jivago
└── resources
├── __init__.py
└── hello_resource.py
application.py
main.py
Note that, when creating the JivagoApplication object, a reference to the application's root package is passed as the first argument. The root package should contain *all* Jivago-annotated classes. (i.e. ``@Resource``, ``@Component``, etc.)

**The app object should be outside of the explored package.**
**The app object (main.py) should be outside of the explored package.**

**Warning :** Since all python files are imported at run-time, any lines of code outside a class or a function will be executed before the application is started. It is therefore highly advised to avoid having any line of code outside a declarative block.

Expand Down
4 changes: 1 addition & 3 deletions docs/quickstart/minimal_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
app = JivagoApplication(my_hello_world_application)

if __name__ == '__main__':
from werkzeug.serving import run_simple

run_simple('localhost', 4000, app)
app.run_dev()

0 comments on commit 4c1e72c

Please sign in to comment.