I just clone the chatterbot
api and tried to run the django_app
from examples as python manage.py runserver
. I'm facing this issue. 'chatterbot' is not a registered namespace
Can any one explain the error and what should I do?
app.html:
var chatterbotUrl = '{% url "chatterbot:chatterbot" %}';
urls.py:
from django.conf.urls import url
from django.contrib import admin
from chatterbot.ext.django_chatterbot import urls as chatterbot_urls
from example_app.views import ChatterBotAppView, ChatterBotApiView
urlpatterns = [
url(r'^$', ChatterBotAppView.as_view(), name='main'),
url(r'^admin/', admin.site.urls, name='admin'),
url(r'^api/chatterbot/', ChatterBotApiView.as_view(), name='chatterbot'),
]
Further info:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 2.1.2
Exception Type: NoReverseMatch
Exception Value:
'chatterbot' is not a registered namespace
Python Version: 3.6.7
Note: I have already checked this link but of no use.
For future reference to others.
I was able to resolve the issue. In nav.html
replace this 21-line i.e., <a class="nav-link" href="{% url 'chatterbot:chatterbot' %}">API</a>
with <a class="nav-link" href="{% url 'chatterbot' %}">API</a>
. This will sort out the issue and NO NEED TO CHANGE ANY PART OF CODE EXPECT THIS LINE, KEEP THE CODE AS IT IS CLONED.