mardi 22 avril 2014

python - puis-je utiliser flacon ou bouteille même si j'utilise le modèle utilisateur de webapp2 ? -Débordement de pile


I have a GAE app written in Python 2.7 and I'd like the routing mechanism from flask or bottle i.e. that I can put a routing directly above the function and that I can use a function instead of a whole class to perform http methods.


So I'm wondering whether I can add flask or bottle to my project and use it but if I then will lose all the nice functionality that I get from webapp2 that I alreaedy use, or can that be combined?


My config object looks like this and I wonder if I can still use it if I add flask or bottle to my project?


config = \
{'webapp2_extras.sessions': {'cookie_name': '_simpleauth_sess',
'secret_key': SESSION_KEY},
'webapp2_extras.auth': {'user_attributes': []},
'webapp2_extras.jinja2': {'template_path': 'templates',
'filters': {
'timesince': filters.timesince,
'datetimeformat': filters.datetimeformat,
'slugify_montao': filters.slugify_montao,
'format_datetime_human': filters.format_datetime_human,
'default_if_none': filters.default_if_none,
'datetimeformat_viewad': filters.datetimeformat_viewad,
'datetimeformat_jinja': filters.datetimeformat_jinja,
'format_date_human': filters.format_date_human,
'displayimg': filters.displayimg,
'displayhour': filters.displayhour,
'displayminute': filters.displayminute,
'displaytime': filters.displaytime,
}, 'environment_args': {'extensions': ['jinja2.ext.i18n',
'jinja2htmlcompress.SelectiveHTMLCompress'
]}}}


I have a GAE app written in Python 2.7 and I'd like the routing mechanism from flask or bottle i.e. that I can put a routing directly above the function and that I can use a function instead of a whole class to perform http methods.


So I'm wondering whether I can add flask or bottle to my project and use it but if I then will lose all the nice functionality that I get from webapp2 that I alreaedy use, or can that be combined?


My config object looks like this and I wonder if I can still use it if I add flask or bottle to my project?


config = \
{'webapp2_extras.sessions': {'cookie_name': '_simpleauth_sess',
'secret_key': SESSION_KEY},
'webapp2_extras.auth': {'user_attributes': []},
'webapp2_extras.jinja2': {'template_path': 'templates',
'filters': {
'timesince': filters.timesince,
'datetimeformat': filters.datetimeformat,
'slugify_montao': filters.slugify_montao,
'format_datetime_human': filters.format_datetime_human,
'default_if_none': filters.default_if_none,
'datetimeformat_viewad': filters.datetimeformat_viewad,
'datetimeformat_jinja': filters.datetimeformat_jinja,
'format_date_human': filters.format_date_human,
'displayimg': filters.displayimg,
'displayhour': filters.displayhour,
'displayminute': filters.displayminute,
'displaytime': filters.displaytime,
}, 'environment_args': {'extensions': ['jinja2.ext.i18n',
'jinja2htmlcompress.SelectiveHTMLCompress'
]}}}

0 commentaires:

Enregistrer un commentaire