Python Forum

Full Version: How to deploy flask on wamp
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,

I have a python project written in flask using python3.6. Now i have a team of 4-5 people who are going to use it, how can i deploy my python flask app on wamp server.

Methods i tried:

1 st method: https://www.youtube.com/watch?v=N3XfGXi4ifE
1 .In this i have to change denied text to granted text
2. second add +ExceCGI in the line (Options +Indexes +FollowSymLinks +Multiviews +ExceCGI)
3. Add handler .py

and then restart wamp and run the localhost/filename.py and it prints the file text as it is and does not open's in my friends system.


second method:

method is listed here
https://www.storehubs.com/Blog/deploy-py...ws-server/

but i am unable to LoadModule wsgi_module modules/mod_wsgi.so , as link mentioned in the reading is of apache vc10,

i have installed mod_wsgi using python but when i run mod_wsgi-express module-config , it sends an output like :
Error:
LoadFile "c:/python36/python36.dll" LoadModule wsgi_module "c:/python36/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd" WSGIPythonHome "c:/python36
and then i add this into httd.conf and what to do next?


is there any such guidance anyone of you can provide on that how to run flask on wampserver

or any server which is on windows 10?
Using wamp make no sense for Flask or Python.
Use the build in web server for all local development,if a team use a GitHub/BitBucket Repo.
As a example in my tutorial here,so do i have a Repo.
So if other want to run my flask app, git clone repo_url
Example:
E:\div_code
λ git clone https://bitbucket.org/snippsat/weather-app.git
Cloning into 'weather-app'...
remote: Counting objects: 60, done.
remote: Total 60 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (60/60), done.
Checking connectivity... done.

E:\div_code
λ cd weather-app\

E:\div_code\weather-app (master)
λ python app.py
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 334-187-997
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
When finish local deployment,i would advice Gunicorn and Nginx(better and easier to setup than Apache).
DigitalOcean has good tutorial about this,as you start on a blank eg Ubuntu 18.04.
How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu 18.04