3👍
✅
if may caused by wsgi.py configuration issues in pythonanywhere,in local env,django handle python path and static files well.
According to this part in pythonanywhere deploy doc:
- adding the right path to sys.path in wsgi.py
assuming your Django settings file is at /home/my_username/projects/my_project/settings.py’
path = '/home/my_username/projects'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'my_project.settings'
from my_project.myapp.models import Kitchen, Sink
please note:my_project prefix is needed.
2.static files should handle well
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()
check this two points according to document should fix that
1👍
Had the exact same problem with my app… the issue turned out to be file permissions. If the app directory doesn’t have execute permissions, it failed to be imported.
- [Django]-How insecure is this?
- [Django]-Django-notifications-hq: cannot show notifications
- [Django]-Use non model django fields in django filter
- [Django]-"invalid literal for int() with base 10:" But can't see why it is accessing an integer
Source:stackexchange.com