Forums

Newbie Falcon deployment

I am getting 'Something went wrong'.....

I am trying to use the images example from Falcon's tutorial and I have done this:

1) Created a 'rest' directory in my home dir. 2) Created app.py & images.py as per tutorial. 3) On Web Tab: set both Source Code & Working Dir to: <home>/rest 4) in my wsgi file I have everything commented out and added:

import sys
import app
#
path = '/home/<my home>/rest'
if path not in sys.path:
    sys.path.append(path)
from app import application

Error log tells me: No module named 'app'

Any help would be much appreciated!

Are you using a VirtualEnv?

Why don't you have import falcon in there?

No - not using VE

Can I take a look at your files? We can see them from our side, but we always ask for permission first.

of course - please go ahead

Right now your WSGI file has this:

path = '/home/tua/rest/app.py'

The app.py shouldn't be there -- it should be like you have it in your original post in this forum thread. Try changing it back, then reload the website.

That gives me a 404 on http://<my account>.pythonanywhere.com and a 405 on http://<my account>.pythonanywhere.com/images

That sounds like your webapp is working.

Going to your webapp, the 404 not found on the front page is coming as a json. Which is probably what your webapp is returning if it doesn't have anything setup for what to do when a request comes in asking for the front page. The 405 method not allowed seems to be that your code is disallowing a normal get method (perhaps you are only allowing posts etc?)

I have same problem my wsgi file :

import sys
import app
#
path = '/home/falcontexample/.virtualenvs/restvenv/restful-falcon-pypy-mysql/app.py'
if path not in sys.path:
    sys.path.append(path)
from app import application

We have a page with tips for debugging wsgi file errors -- maybe one of them helps?