I've rebuilded my virtualenv using this https://help.pythonanywhere.com/pages/RebuildingVirtualenvs due "classic" system image end-of-life and i'm getting this error:
2022-12-14 18:09:54,218: ImportError: No module named 'django.urls' 2022-12-14 18:09:54,218: File "/home/louvordaceu/gsdb/myenv/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 170, in call 2022-12-14 18:09:54,219:
self.load_middleware() 2022-12-14 18:09:54,219: 2022-12-14 18:09:54,219: File "/home/louvordaceu/gsdb/myenv/lib/python3.5/site-packages/django/core/handlers/base.py", line 50, in load_middleware 2022-12-14 18:09:54,219: mw_class = import_string(middleware_path) 2022-12-14 18:09:54,219: 2022-12-14 18:09:54,219: File "/home/louvordaceu/gsdb/myenv/lib/python3.5/site-packages/django/utils/module_loading.py", line 26, in import_string 2022-12-14 18:09:54,219: module = import_module(module_path) 2022-12-14 18:09:54,220: 2022-12-14 18:09:54,220: File "/home/louvordaceu/gsdb/myenv/lib/python3.5/site-packages/whitenoise/middleware.py", line 9, in <module> 2022-12-14 18:09:54,220: from django.urls import get_script_prefix
I'm using python 3.5 and django 1.8.19
urls.py:
"""gsdb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
#from django.urls import include, path
from django.contrib import admin
from gospelsongsdb import views
urlpatterns = [
url(r'^$', views.index),
url(r'^admin/', include(admin.site.urls)),
url(r'^log/', views.Log.as_view(), name='log'),
url(r'^mais_tocadas/', views.MostPlayed.as_view(), name='log'),
]