I try to understand why my "or not" have no effect:
def maintenance_tween_factory(handler, registry):
# Return a tween callable.
# 'handler' is the next tween or the WSGI application.
# Deployment settings are in 'registry.settings'.
def maintenance_tween(request):
Thank you!
I think I finally got it. Now I would like to allow only 2 routes:
- one is my "maintenance" because I want to use a jinja template instead
of returning the HTTPException
- one is "dbmigration" because I still need to call my Cornice API
For the moment the maintenance mode
I get 'No module named 'maintenance_tween'. Should I separate the two
functions in 2 different files, both of them being in the same module?
Le vendredi 8 janvier 2021 à 13:04:57 UTC+1, tfl...@gmail.com a écrit :
> Hi Cedric,
> You just have to include your package from Pyramid main
Hi Cedric,
You just have to include your package from Pyramid main configuration file,
using the "includes" section...
The "includeme" function will then be called automatically to register your
tween!
Thierry
--
https://www.ulthar.net -- http://pyams.readthedocs.io
Le ven. 8 janv. 2021 à
I fixed my code by returning the function inside. But I still need to
understand where to call theses functions to set everything up.
def maintenance_tween_factory(handler, registry):
# Return a tween callable.
# 'handler' is the next tween or the WSGI application.
# Deployment settings are in
To everybody: thanks a lot for your answers. Sorry for the delay: I am
living in France.
Bay the way I am still interested in the Pyramid CMS solution steps.
Mike,
I have created a file named maintenance.py in my utils module.
It contains:
import pyramid
def includeme(config):
# Calculate