librelist archives

« back to archive

Larger Application

Larger Application

From:
Yannick Le Teigner
Date:
2012-06-20 @ 21:02
Hi there,

I read the larger application page (
http://flask.pocoo.org/docs/patterns/packages/) but still can't make my app
work.
I want some URL paths to be processed by yourapplication and some others
processed by yourapplication2.
I thought I could use the following layout:

/yourapplication
    /runserver.py
    /yourapplication
        /__init__.py
        /views.py
        /static
            /style.css
        /templates
            layout.html
            index.html
            login.html
            ...
    /yourapplication2
        /__init__.py
        /views.py
        /static
            /style.css
        /templates
            layout.html
            index.html
            login.html
            ...

But obviously, I cannot do the following in runserver.py:
from yourapplication import app
from yourapplication2 import app
app.run('0.0.0.0', debug=True)

What other options do I have?

Thanks!
Yannick

Re: [flask] Larger Application

From:
Brice Leroy
Date:
2012-06-20 @ 21:17
Hi Yannick,

I wished I had more time to work on it but it already contains some
informations you might need:
https://github.com/mitsuhiko/flask/wiki/Large-app-how-to



2012/6/20 Yannick LE TEIGNER <yannick.leteigner@gmail.com>

> Hi there,
>
> I read the larger application page (
> http://flask.pocoo.org/docs/patterns/packages/) but still can't make my
> app work.
> I want some URL paths to be processed by yourapplication and some others
> processed by yourapplication2.
> I thought I could use the following layout:
>
> /yourapplication
>     /runserver.py
>     /yourapplication
>         /__init__.py
>         /views.py
>         /static
>             /style.css
>         /templates
>             layout.html
>             index.html
>             login.html
>             ...
>     /yourapplication2
>         /__init__.py
>         /views.py
>         /static
>             /style.css
>         /templates
>             layout.html
>             index.html
>             login.html
>             ...
>
> But obviously, I cannot do the following in runserver.py:
> from yourapplication import app
> from yourapplication2 import app
> app.run('0.0.0.0', debug=True)
>
> What other options do I have?
>
> Thanks!
> Yannick
>

Re: [flask] Larger Application

From:
Redouane Zait
Date:
2012-06-20 @ 21:50
use blueprints and register them by a single app instead of instantiating
two apps.

On Wed, Jun 20, 2012 at 10:17 PM, Brice Leroy <bbrriiccee@gmail.com> wrote:

> Hi Yannick,
>
> I wished I had more time to work on it but it already contains some
> informations you might need:
> https://github.com/mitsuhiko/flask/wiki/Large-app-how-to
>
>
>
>
> 2012/6/20 Yannick LE TEIGNER <yannick.leteigner@gmail.com>
>
>> Hi there,
>>
>> I read the larger application page (
>> http://flask.pocoo.org/docs/patterns/packages/) but still can't make my
>> app work.
>> I want some URL paths to be processed by yourapplication and some others
>> processed by yourapplication2.
>> I thought I could use the following layout:
>>
>> /yourapplication
>>     /runserver.py
>>     /yourapplication
>>         /__init__.py
>>         /views.py
>>         /static
>>             /style.css
>>         /templates
>>             layout.html
>>             index.html
>>             login.html
>>             ...
>>     /yourapplication2
>>         /__init__.py
>>         /views.py
>>         /static
>>             /style.css
>>         /templates
>>             layout.html
>>             index.html
>>             login.html
>>             ...
>>
>> But obviously, I cannot do the following in runserver.py:
>> from yourapplication import app
>> from yourapplication2 import app
>> app.run('0.0.0.0', debug=True)
>>
>> What other options do I have?
>>
>> Thanks!
>> Yannick
>>
>
>
>

Re: [flask] Larger Application

From:
Yannick Le Teigner
Date:
2012-06-21 @ 15:40
Thanks Brice, Zait. I went the blueprint road, and it seems to work just
fine. :)

On Wed, Jun 20, 2012 at 5:50 PM, Redouane Zait <unrealdz@gmail.com> wrote:

> use blueprints and register them by a single app instead of instantiating
> two apps.
>
>
> On Wed, Jun 20, 2012 at 10:17 PM, Brice Leroy <bbrriiccee@gmail.com>wrote:
>
>> Hi Yannick,
>>
>> I wished I had more time to work on it but it already contains some
>> informations you might need:
>> https://github.com/mitsuhiko/flask/wiki/Large-app-how-to
>>
>>
>>
>>
>> 2012/6/20 Yannick LE TEIGNER <yannick.leteigner@gmail.com>
>>
>>> Hi there,
>>>
>>> I read the larger application page (
>>> http://flask.pocoo.org/docs/patterns/packages/) but still can't make my
>>> app work.
>>> I want some URL paths to be processed by yourapplication and some others
>>> processed by yourapplication2.
>>> I thought I could use the following layout:
>>>
>>> /yourapplication
>>>     /runserver.py
>>>     /yourapplication
>>>         /__init__.py
>>>         /views.py
>>>         /static
>>>             /style.css
>>>         /templates
>>>             layout.html
>>>             index.html
>>>             login.html
>>>             ...
>>>     /yourapplication2
>>>         /__init__.py
>>>         /views.py
>>>         /static
>>>             /style.css
>>>         /templates
>>>             layout.html
>>>             index.html
>>>             login.html
>>>             ...
>>>
>>> But obviously, I cannot do the following in runserver.py:
>>> from yourapplication import app
>>> from yourapplication2 import app
>>> app.run('0.0.0.0', debug=True)
>>>
>>> What other options do I have?
>>>
>>> Thanks!
>>> Yannick
>>>
>>
>>
>>
>