Reputation: 133
I have the following error and I can't figure out what to change in my urls.py to fix this:
django.core.exceptions.ImproperlyConfigured: The included URLconf 'MLtest.urls' 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.
Here's what my urls.py looks like:
from django.contrib import admin
from django.urls import path, include
from MLT import views
import debug_toolbar
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.thankYou),
path(r'^__debug__', include(debug_toolbar.urls)),
]
views.py:
from django.shortcuts import render
from django.template import RequestContext
from django.utils.translation import gettext as _
def thankYou(request):
text = _("this is some random text")
return render(request, 'thank_you.html', {'text': text})
Upvotes: 0
Views: 108
Reputation: 3392
correct your url as below:
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.thankYou),
path('__debug__/', include(debug_toolbar.urls)),
]
Upvotes: 2