I got
does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import error .
I wrote in urls.py of child app
from django.conf.urls import url
from django.contrib.views import login,logout
urlpatterns = [
url(r'^login/$', login,
name='login'),
url(r'^logout/$', logout, name='logout')
]
in urls.py of parent app,
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^accounts/', include('accounts.urls')),
url(r'^api/', include('UserToken.urls')),
url(r'^UserDataAPI/', include('UserDataAPI.urls', namespace='UserDataAPI')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
I am thinking urls.py of child or parent app,but I do not know how to fix it. What should I do?
Your import is incorrect. The views.py
containing login
and logout
is in the django.contrib.auth
app:
from django.contrib.auth.views import login, logout
It is caused by errors in views.py file as code code redirect link isn't properly working. so,Check views file to remove error
just check whether urlpattern and change into patterns
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With