Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 100 characters in body
Source Link
BradleyMoore
  • 145
  • 2
  • 2
  • 14

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

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__) 

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!

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

Source Link
BradleyMoore
  • 145
  • 2
  • 2
  • 14

pythonanywhere 404 error

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__) 

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!