Mercurial > wikked
comparison docs/pages/05_deployment.md @ 397:dcaa41b39c23
docs: Add more nice graphics.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 21 Oct 2015 22:48:19 -0700 |
parents | 3a61f45702cb |
children |
comparison
equal
deleted
inserted
replaced
396:2a70f537337d | 397:dcaa41b39c23 |
---|---|
1 --- | 1 --- |
2 title: Deployment | 2 title: Deployment |
3 icon: server | 3 icon: server |
4 header_img: wizard.png | |
4 --- | 5 --- |
5 | 6 |
6 Wikked runs by default with an "easy" configuration, _i.e._ something that will | 7 Wikked runs by default with an "easy" configuration, _i.e._ something that will |
7 "just work" when you play around locally. In this default setup, it uses | 8 "just work" when you play around locally. In this default setup, it uses |
8 [SQLite][] for the cache, and [Whoosh][] for the full-text search, all running | 9 [SQLite][] for the cache, and [Whoosh][] for the full-text search, all running |
25 some more advanced configurations for those with special requirements. | 26 some more advanced configurations for those with special requirements. |
26 | 27 |
27 [flaskdeploy]: http://flask.pocoo.org/docs/deploying/ | 28 [flaskdeploy]: http://flask.pocoo.org/docs/deploying/ |
28 | 29 |
29 | 30 |
30 ## Apache and WSGI | 31 ## Public facing wiki |
31 | 32 |
32 A simple way to run Wikked on a production server is to use [Apache][] with | 33 A simple way to run Wikked on a production server (_i.e._ a server accessible |
33 [`mod_wsgi`][wsgi]. For a proper introduction to the matter, you can see | 34 from the internet) is to use [Apache][] with [`mod_wsgi`][wsgi]. For a proper |
34 [Flask's documentation on the subject][flask_wsgi]. Otherwise, you can probably | 35 introduction to the matter, you can see [Flask's documentation on the |
35 reuse the following examples. | 36 subject][flask_wsgi]. Otherwise, you can probably reuse the following examples. |
36 | 37 |
37 [apache]: https://httpd.apache.org/ | 38 [apache]: https://httpd.apache.org/ |
38 [wsgi]: http://code.google.com/p/modwsgi/ | 39 [wsgi]: http://code.google.com/p/modwsgi/ |
39 [flask_wsgi]: http://flask.pocoo.org/docs/deploying/mod_wsgi/ | 40 [flask_wsgi]: http://flask.pocoo.org/docs/deploying/mod_wsgi/ |
40 | 41 |
81 > your installed Wikked package. So if you installed it with `virtualenv`, it | 82 > your installed Wikked package. So if you installed it with `virtualenv`, it |
82 > would be something like: | 83 > would be something like: |
83 > `/path/to/your/wiki/venv/lib/python/site-packages/wikked/static`. | 84 > `/path/to/your/wiki/venv/lib/python/site-packages/wikked/static`. |
84 | 85 |
85 | 86 |
86 ## Background updates | 87 ## Advanced configurations |
87 | 88 |
88 The second thing to do is to enable background wiki updates. Good news: they're | 89 ### Background updates |
89 already enabled if you used the `get_wsgi_app` function from the previous | 90 |
90 section (you can disable it by passing `async_update=False` if you really need | 91 By default, when you edit a page, Wikked will invalidate any page with a query |
91 to). | 92 in it. That page will be re-computed the next time you visit it. But this may |
93 not work very well if you have a lot of queries. As an alternative, Wikked can | |
94 run background updates. | |
95 | |
96 First you enable background updates in the `get_wsgi_app` function from the previous | |
97 section. You just need to pass `async_update=True`. | |
92 | 98 |
93 > If you want to use background updates locally, you can do `wk runserver | 99 > If you want to use background updates locally, you can do `wk runserver |
94 > --usetasks`. | 100 > --usetasks`. |
95 | 101 |
96 However, you'll still need to run a separate process that, well, runs those | 102 Now, you'll need to run a separate process that, well, runs those updates in the |
97 updates in the background. To do this: | 103 background. To do this: |
98 | 104 |
99 cd /path/to/my/wiki | 105 cd /path/to/my/wiki |
100 wk runtasks | 106 wk runtasks |
101 | 107 |
102 > The background task handling is done with [Celery][]. By default, Wikked will | 108 > The background task handling is done with [Celery][]. By default, Wikked will |
104 | 110 |
105 [celery]: http://www.celeryproject.org/ | 111 [celery]: http://www.celeryproject.org/ |
106 [celerysqlite]: http://docs.celeryproject.org/en/latest/getting-started/brokers/sqlalchemy.html | 112 [celerysqlite]: http://docs.celeryproject.org/en/latest/getting-started/brokers/sqlalchemy.html |
107 | 113 |
108 | 114 |
109 ## Backend options | 115 ### Backend options |
110 | |
111 **This is for advanced use only** | |
112 | 116 |
113 If you want to use a different storage than SQLite, set the `database_url` | 117 If you want to use a different storage than SQLite, set the `database_url` |
114 setting in your `wikirc` to an [SQLAlchemy-supported database URL][SQLAlchemy]. | 118 setting in your `wikirc` to an [SQLAlchemy-supported database URL][SQLAlchemy]. |
115 For instance, if you're using MySQL with `pymsql` installed: | 119 For instance, if you're using MySQL with `pymsql` installed: |
116 | 120 |