Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
earonesty committed Nov 22, 2019
1 parent 0ad6b37 commit 3baa5f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ site_name: Smx
repo_url: https://github.com/earonesty/python-smx
nav:
- Home: index.md
- Wsgi: wsgi.md
docs_dir: docs
15 changes: 12 additions & 3 deletions wsgi.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
To use SmxWsgi:
## SmxWsgi module

Simplest way to use the SmxWsgi module:

```
SMX_INIT=/path/to/my/config.file SMX_ROOT=/path/to/my/html/ gunicorn -w 4 smx:SmxWsgi
```

* This will serve up files named "index.smx" as directory listings.
* The following macros are availale:
* All cgi env vars are availalbe in %environ()
* %form(x) returns form input data, or query string
* %jq% contains the json posted dict

* %jq(x) contains the json posted dict
* %redirect(url) will redirect
* %redirect(url, 301) will redirect301
* %error(500, msg, body) will throw an error

All smx macros and python are otherwise available.

.smx pages are always parsed
.html pages can optionally contain embedded smx, trigger with %expand% at the top of the page.

0 comments on commit 3baa5f8

Please sign in to comment.