5

I'm building an app in pythonanywhere using the Flask Mega Tutorial and it works fine when I run in on my pc. When I upload it to PA it gets a 404 error.

my structure

/microblog /flask (virtualenv setup) /app __init__.py views.py 

my wsgi file

import sys project_home = u'/home/thefritobandit/microblog/app' if project_home not in sys.path: sys.path = [project_home] + sys.path from __init__ import app as application 

my init.py file

from flask import Flask app = Flask(__name__) from app import views 

my views.py file

from app import app @app.route('/') @app.route('/index') def index(): return "Hello World!" 

I'm sure it's something stupid but any help would be greatly appreciated! Thanks!

--edit-- forgot to copy over the import at the bottom of my init file

1 Answer 1

5

change
project_home = u'/home/thefritobandit/microblog/app
to
project_home = u'/home/thefritobandit/microblog

and in your wsgi file change
from __init__ import app as application
to
from app import app as application.

Sign up to request clarification or add additional context in comments.

5 Comments

sorry, just forgot to copy that over from my file...edited my post to include the last line. thanks
@thefritobandit: see the updated post. And why do you want to set up flask in virtualenv on PAW? Its already installed there.
i'm pretty new at this so i'm just following the tutorial. would you recommend that i just drop that portion?
@thefritobandit yes delete that part! and reload the web app after applying above mentioned change.
that was it! thank you! i would upvote you but i don't have the required 15 reputation. sorry

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.