Hi peeps,
I'm a beginner at coding in Python. I've just followed this tutorial to the letter: https://alysivji.github.io/flask-part2-building-a-flask-web-application.html. The app is working perfectly on my local machine. I am now trying to publish the app using pythonanywhere. The problem I have is I am unable to provision the WSGI file correctly to get the app to run?
The application is structured as follows:
/home/res/MyApp/
├── app.py
├── models.py
├── static
│ ├── css
│ │ ├── main.css
│ │ ├── normalize.css
│ │ └── normalize.min.css
│ └── js
│ ├── main.js
│ └── vendor
│ ├── jquery-1.11.2.min.js
│ └── modernizr-2.8.3-respond-1.4.2.min.js
├── status
└── templates
├── 404.html
├── all-dates.html
├── all-subreddits.html
├── base.html
├── by-subreddit.html
└── index.html
On my local machine I simply type $ python app.py. and the application runs locally.
I have tried different variations on the WSGI file but i'm not even sure if I should be pointing it to the app.py file or if I need to restructure the application?
Here is the current WSGI as it stands (i've kept all other files the same):
# /var/www/res_pythonanywhere_com_wsgi.py
import sys
path = '/res'
if path not in sys.path:
sys.path.insert(0,"/MyApp/app.py")
sys.path.append('/home/res/')
from MyApp import app as application
Any suggestions ?