librelist archives

« back to archive

Flask App starting twice?

Flask App starting twice?

From:
Daniel Alan Miller
Date:
2013-03-11 @ 18:11
Howdy all,

For some reason my Flask application starts twice, I've pasted the code
where the dev server is setup and run.

http://hastebin.com/kilenayafa.py

Without having the use_reloader=False in the run section, for some reason
Flask will start twice and have an output like this when I start it.

'''
=========================
DEV SERVER SETTINGS ENABLED
=========================

Enabling Debug Toolbar
 * Detected change in 'run.py', reloading
 * Restarting with reloader
=========================
DEV SERVER SETTINGS ENABLED
=========================

Enabling Debug Toolbar
'''

What sort of things would be causing the reloader to trigger? Has anyone
else experienced this?

Daniel

Re: [flask] Flask App starting twice?

From:
Robert Moskal
Date:
2013-03-11 @ 18:19
One thing that does it if you restart your app in another module. For
example, I have some celery tasks in another module that reload the app.

Robert
___________
Robert Moskal
Most Media
Brooklyn, USA
214-799-1268


On Mon, Mar 11, 2013 at 2:11 PM, Daniel Alan Miller
<dalan.miller@gmail.com>wrote:

> Howdy all,
>
> For some reason my Flask application starts twice, I've pasted the code
> where the dev server is setup and run.
>
> http://hastebin.com/kilenayafa.py
>
> Without having the use_reloader=False in the run section, for some reason
> Flask will start twice and have an output like this when I start it.
>
> '''
> =========================
> DEV SERVER SETTINGS ENABLED
> =========================
>
> Enabling Debug Toolbar
>  * Detected change in 'run.py', reloading
>  * Restarting with reloader
> =========================
> DEV SERVER SETTINGS ENABLED
> =========================
>
> Enabling Debug Toolbar
> '''
>
> What sort of things would be causing the reloader to trigger? Has anyone
> else experienced this?
>
> Daniel
>

Re: [flask] Flask App starting twice?

From:
Daniel Alan Miller
Date:
2013-03-11 @ 20:20
I am running the SocketIOServer from gevent-socketio which wraps the
application, but it's only supposed to use that server on production, so
I'm not sure why it would do so in development mode.


On Mon, Mar 11, 2013 at 11:19 AM, Robert Moskal <rmoskal@mostmedia.com>wrote:

> One thing that does it if you restart your app in another module. For
> example, I have some celery tasks in another module that reload the app.
>
> Robert
> ___________
> Robert Moskal
> Most Media
> Brooklyn, USA
> 214-799-1268
>
>
> On Mon, Mar 11, 2013 at 2:11 PM, Daniel Alan Miller <
> dalan.miller@gmail.com> wrote:
>
>> Howdy all,
>>
>> For some reason my Flask application starts twice, I've pasted the code
>> where the dev server is setup and run.
>>
>> http://hastebin.com/kilenayafa.py
>>
>> Without having the use_reloader=False in the run section, for some reason
>> Flask will start twice and have an output like this when I start it.
>>
>> '''
>> =========================
>> DEV SERVER SETTINGS ENABLED
>> =========================
>>
>> Enabling Debug Toolbar
>>  * Detected change in 'run.py', reloading
>>  * Restarting with reloader
>> =========================
>> DEV SERVER SETTINGS ENABLED
>> =========================
>>
>> Enabling Debug Toolbar
>> '''
>>
>> What sort of things would be causing the reloader to trigger? Has anyone
>> else experienced this?
>>
>> Daniel
>>
>
>