I\'m using Flask for developing a website and while in development I run flask using the following file:
#!/usr/bin/env python
from datetime import datetime
From Flask 0.11, it's recommended to run your app with flask run
rather than python application.py
. Using the latter could result in running your code twice.
As stated here :
... from Flask 0.11 onwards the flask method is recommended. The reason for this is that due to how the reload mechanism works there are some bizarre side-effects (like executing certain code twice...)