15👍
One defines the list of url patterns in a variable named urlpatterns
, not , as is specified in the documentation on URL dispatching [Django-doc]:urls
(…)
Django loads that Python module and looks for the variable
urlpatterns
. This should be a Python list ofdjango.urls.path()
and/ordjango.urls.re_path()
instances.(…)
So the system thus raises an error that you appear to have forgotton something. You can fix it by renaming urls
to urlpatterns
:
# account/urls.py
from django.contrib.auth import views
from . import views
urlpatterns = [
path('login/', views.user_login, name='login'),
]
4👍
If your urls.py imports a class-based view that uses reverse()
, you will get this error; using reverse_lazy()
will fix it.
- Django-allauth change user email with/without verification
- Docker + Django + Postgres Add-on + Heroku
- My PostGIS database looks fine but GeoDjango thinks otherwise… why?
- Submit button no longer works with django crispy forms
0👍
In my case, I had ImproperlyConfigured
error due to the fact that I was using the same virtual environment for two projects, executed command
pip install -r requirements.txt
for these two projects. I created new virtual environment and error has gone.
- AWS Elastic Beanstalk health check issue
- Type object 'User' has no attribute 'objects django
- Django Admin, accessing reverse many to many
- Django filter on date difference between columns