![]() ![]() Personally I chose Nginx + uWSGI over Apache + mod_wsgi for a few performance reasons but also the configuration options. However this is not suitable for a production environment. Importing this file is easy too _object( 'ttings') For example I use 'settings.py' with a 'DEBUG = True' option. You can also use a separate configuration file to manage all your setup if you need be. The werkzeug debugger already has an 'auto reload' function available that can be enabled by doing one of the following: app.run(debug= True) Or, from the shell: $ export FLASK_DEBUG= 1Īnswer 3: In test/development environments It will auto-reload the flask app when a code change happens. If you are talking about test/dev environments, then just use the debug option. More options are available with: $ flask run - helpįLASK_APP can also be set to module:app or module:create_app instead of module.py. If you want different port than the default ( 5000) add -port option.Įxample: $ FLASK_APP=main.py FLASK_ENV=development flask run -port 8080 Or in one command: $ FLASK_APP=main.py FLASK_ENV=development flask run The current recommended way is with the flask command line utility. Is there some way how to cause reload when I edit some of the app's py files? Or, I am expected to use IDE that refreshes the. wsgi file causes reloading (even without WSGIScriptReloading On in the apache config file), but I still have to prod it manually (ie, insert extra linebreak, save). However, I'd like to speed up the development routine by making the site automatically reload upon any changes in py or template files I make. So, now I've set up an Apache server with mod_wsgi, and my test site is running fine. Time will tell if this was the right choice. Since I don't want some high-order structures to get in my way, my choice fell on the lightweight Flask framework. I'm investigating how to develop a decent web app with Python. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |