Flask doesn't have a set way for doing this. You can place them anywhere
your application can import them. It's up to you to decide.

For this structure:

/yourapp
/yourapp/app.py
/yourapp/static/style.css
/yourapp/templates/index.html

You could do:

/yourapp/views/__init__.py
/yourapp/views/admin.py
/yourapp/views/frontend.py

Then in app.py import:

from views.admin import AdminView
from views.frontend import FrontendView

Or alongside app.py:

/yourapp/admin.py
/yourapp/frontend.py

Then import:

from admin import AdminView
from frontend import FrontendView

Or you could store them all in one file:

/yourapp/views.py

Then import:

from views import AdminView, FrontendView

You might also look at other peoples' projects to see how they're doing it:

https://github.com/sean-/flask-skeleton
https://github.com/imwilsonxu/fbone/tree/master/fbone

And these pages:

http://flask.pocoo.org/docs/0.10/patterns/packages/
https://github.com/mitsuhiko/flask/wiki/Large-app-how-to

-Steve

On Fri, Nov 7, 2014 at 6:13 AM, ngangsia akumbo <[email protected]> wrote:

> Hi everyone,
>
> I just started going through the flask tutorials today.
>
> I was forced to use flask because i have to write a simple application
> that can send and receive SMS to and fro from mobile fones.
>
> i am using twilio, i found out flask is easy to implement this with twilio
>
> please looking at this..
>
> /yourapplication
>     /yourapplication.py
>     /static
>         /style.css
>     /templates
>         layout.html
>         index.html
>         login.html
>
> where do i place in the views files?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "pocoo-libs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pocoo-libs.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pocoo-libs.
For more options, visit https://groups.google.com/d/optout.

Reply via email to