librelist archives

« back to archive

How to serve static files from template directory instead of /flaskapp/static directory?

How to serve static files from template directory instead of /flaskapp/static directory?

From:
Anuj Kumar
Date:
2012-12-22 @ 11:02
I have posted this question on stackoverflow :

http://stackoverflow.com/questions/14002178/flask-how-to-serve-static-files-from-template-directory

In nutshell, what I want to do is that instead of serving static files from
/flaskapp/static/ directory I want to serve static files using
/flaskapp/userdata/<user>/<current-template>/static/ directory where <user>
and <current-template> will be determined dynamically at run time.

-- 
Regards,
Anuj Kumar

E-mail      : anuj.kk@gmail.com
Website   : http://www.anujkumar.com
<http://blog.anujkumar.com/>
Facebook : http://www.facebook.com/anujkrk
Twitter      : http://twitter.com/#!/anujkkk

Re: [flask] How to serve static files from template directory instead of /flaskapp/static directory?

From:
pronoyc@gmail.com
Date:
2012-12-22 @ 11:09
http://flask.pocoo.org/docs/api/#flask.send_from_directory This might help.


On Sat, Dec 22, 2012 at 4:32 PM, Anuj Kumar <anuj.kk@gmail.com> wrote:

> I have posted this question on stackoverflow :
> 
http://stackoverflow.com/questions/14002178/flask-how-to-serve-static-files-from-template-directory
>
> In nutshell, what I want to do is that instead of serving static files
> from /flaskapp/static/ directory I want to serve static files using
> /flaskapp/userdata/<user>/<current-template>/static/ directory where
> <user> and <current-template> will be determined dynamically at run time.
>
> --
> Regards,
> Anuj Kumar
>
> E-mail      : anuj.kk@gmail.com
> Website   : http://www.anujkumar.com
> <http://blog.anujkumar.com/>
> Facebook : http://www.facebook.com/anujkrk
> Twitter      : http://twitter.com/#!/anujkkk
>



-- 
Regards,

Pronoy Chopra
http://blog.pronoy.in <http://www.pronoy.in/about>/
http://www.twitter.com/pronoyc