Mercurial > piecrust2
annotate piecrust/wsgiutil/cwdapp.py @ 853:f070a4fc033c
core: Continue PieCrust3 refactor, simplify pages.
The asset pipeline is still the only function pipeline at this point.
* No more `QualifiedPage`, and several other pieces of code deleted.
* Data providers are simpler and more focused. For instance, the page iterator
doesn't try to support other types of items.
* Route parameters are proper known source metadata to remove the confusion
between the two.
* Make the baker and pipeline more correctly manage records and record
histories.
* Add support for record collapsing and deleting stale outputs in the asset
pipeline.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 21 May 2017 00:06:59 -0700 |
parents | d40b744a9d99 |
children |
rev | line source |
---|---|
376
21687b933193
serve: Add a WSGI utility module for easily getting a default app.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
1 # This is a utility module that can be used with any WSGI-compatible server |
21687b933193
serve: Add a WSGI utility module for easily getting a default app.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
2 # like Werkzeug or Gunicorn. It returns a WSGI app for serving a PieCrust |
21687b933193
serve: Add a WSGI utility module for easily getting a default app.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
3 # website located in the current working directory. |
21687b933193
serve: Add a WSGI utility module for easily getting a default app.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
4 import os |
379
d40b744a9d99
serve: Add a generic WSGI app factory.
Ludovic Chabant <ludovic@chabant.com>
parents:
378
diff
changeset
|
5 from piecrust.wsgiutil import get_app |
376
21687b933193
serve: Add a WSGI utility module for easily getting a default app.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
6 |
21687b933193
serve: Add a WSGI utility module for easily getting a default app.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
7 |
21687b933193
serve: Add a WSGI utility module for easily getting a default app.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
8 root_dir = os.getcwd() |
379
d40b744a9d99
serve: Add a generic WSGI app factory.
Ludovic Chabant <ludovic@chabant.com>
parents:
378
diff
changeset
|
9 app = get_app(root_dir) |
378
fe8a58817088
serve: Compatibility with `mod_wsgi`.
Ludovic Chabant <ludovic@chabant.com>
parents:
376
diff
changeset
|
10 # Add this for `mod_wsgi`. |
fe8a58817088
serve: Compatibility with `mod_wsgi`.
Ludovic Chabant <ludovic@chabant.com>
parents:
376
diff
changeset
|
11 application = app |
376
21687b933193
serve: Add a WSGI utility module for easily getting a default app.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
12 |