jobsta/reportbro-lib

Cannot install at Pythonanywhere

fyarepo opened this issue · 3 comments

Hi
We start Django web at Pythonanywhere.
However the Pythonanywhere created mytsite as app source app folder.
Select the python 3.8.0
Follow through steps in Readme.rst
and then http://abc.pythonanywhere.com/albums

Error message is here
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
admin/
The current path, albums, didn't match any of these.

What can we do?

This is not really an issue with reportbro but more a general problem with app deployment on Pythonanywhere.

You should follow the documentation https://help.pythonanywhere.com/pages/DeployExistingDjangoProject and check your error log if it still does not work.

Did you manage to install the app on PythonAnywhere in the meantime?

I just made a test setup on PythonAnywhere for the django demoapp and it works fine. Basically you have to follow the instructions from the link above.

In django_demoapp/settings.py you have to enter your url in ALLOWED_HOSTS, e.g.
ALLOWED_HOSTS = ['myuser.pythonanywhere.com']
and set STATIC_ROOT accordingly:
STATIC_ROOT = '/home/myuser/albumapp-django/albums/static'

On the PythonAnywhere 'Web' Page you have to make sure everything is configured as described (Source code and working dir, wsgi file, virtualenv). The wsgi file looks something like this:

import os
import sys

path = '/home/myuser/albumapp-django'
if path not in sys.path:
    sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_demoapp.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

For 'Static files' you enter the following mapping:

URL: /static/
Directory: /home/myuser/albumapp-django/albums/static

Reload the application and that's basically it.

The Readme of the django demo app was also updated with installation instructions for PythonAnywhere.