Deploying a flag site / application on pythonanywhere.com

I have a working example of a site with a file system as such ( https://github.com/alvations/APE ):

APE \app \templates base.html index.html instance.html __init__.py hamlet.py config.py run.py 

I created a jar project at https://www.pythonanywhere.com , and the file system as such:

 /home/alvations/ /Dropbox/ /mysite/ /templates base.html index.html instance.html flask_app.py /web2py/ 

enter image description here

Where to put my run.py in my pythonanywhere project?

How to use the same file structure as my project in my Github, on pythonanywhere?

+5
source share
1 answer

PythonAnywhere dev is here - you don't need run.py on PythonAnywhere . The code that usually goes into it is to start the local Flask server, which can serve your application - which is all processed for you by our system.

Instead, you need to modify the WSGI file (associated with the Web tab) to import the appropriate application module. So, since the sample site you have on github,

 from app import app app.run(debug=True) 

... on PythonAnywhere in the WSGI file you will need to do this:

 from app import app as application 

One thing you need to know about - if I understand your file lists correctly, you don't have the entire github application installed - just the templates. You will need __init__.py , hamlet.py and config.py , and they must be in the same directory structure as the original.

+7
source

Source: https://habr.com/ru/post/1207024/


All Articles