5👍
path was introduced in django since Django 2.0. So, if you are using Django 1.11, then you can’t use it. You need to define urls like this:
from django.conf.urls import url, include
urlpatterns = [
# rest of the urls
url(r'^$', HomeView.as_view()),
]
- [Django]-Django queryset specific order by based on values of foreign key
- [Django]-Python/Django date field in html input tag
- [Django]-How to join multiple params dynamically for django Q object
0👍
This code will work for you.
from django.urls import path
from django.contrib import admin
urlpatterns = [
path('admin/', admin.site.urls),
]
- [Django]-Django-Haystack/Whoosh – Rebuild Index Error
- [Django]-How can I disable a third party API when executing Django unit tests?
- [Django]-How to avoid repeated values retrieved from database?
Source:stackexchange.com