[Flask] load different templates for mobile website

Karsten Goen karsten.goen at googlemail.com
Thu Oct 13 16:57:15 EDT 2016


hello together,
first of all I do not want to use responsive webdesign, so I need two
versions of my website since the mobile website shall become a easy
controllable menu with collapsed menu entries.
I am really stuck how do I tell flask that it should choose the
templates out of the mobile folder when detecting a mobile device. I
already tried this https://flask-mobility.readthedocs.io/en/latest/
which is very good until that point when you include templates into
your templates. I think I more need some general loader like:
when mobile version-> use this template folder (I would use the same
template names). Would that be the direction to go?
Another option would be to write a backend api and make two different
flask-app for each type of website. I think it would not be a big deal
when using blueprints on the other hand I would prefer one handler in
my current app which is easy to load and easy to remove when things in
the app change.
What you people think? I am open to totally new ideas how to structure
mobile / desktop website? What would be the best way without rewriting
"anything".


Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20161013/5a1ac81d/attachment.html>


More information about the Flask mailing list