Hi John,
We absolutely agree that the Pecan docs need some attention. That's at
the top of the list for the sprint we have coming up in early March.
In the meantime, here are some pointers:
Implementing Pecan using Nginx
Pecan is a standard WSGI framework, so you would run it behind Nginx
just like any other WSGI framework (e.g., Pylons, TurboGears). Your
options are basically to run it directly within Nginx using its WSGI
module (
http://wiki.nginx.org/NgxWSGIModule) or have Nginx proxy to
one or more Python WSGI servers running Pecan (e.g., Paste, CherryPy).
Lock pages if not authenticated
You would use pecan.secure.SecureController for that. For example:
from pecan.secure import SecureController, unlocked
from yourapp.some.lib import get_current_user
class AccountSettingsController(SecureController):
@classmethod
def check_permissions(cls):
if get_current_user() is None:
return False
return True
@expose('index.mak')
def index(self):
# only logged in users can access this
return dict()
@unlocked
@expose('login.mak')
def login(self):
# all users can access this
return dict()
Pecan and Celery
Check out the pecancelery project on GitHub for information on how to
do this:
https://github.com/ryanpetrello/pecancelery.
Hope that helps!