close

[Solved] Django – is not a registered namespace

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Django – is not a registered namespace in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Django – is not a registered namespace Error Occurs?

Today I get the following error Django – is not a registered namespace in python.

How To Solve Django – is not a registered namespace Error ?

  1. How To Solve Django – is not a registered namespace Error ?

    To Solve Django – is not a registered namespace Error In your main project, open url.py first. Then check, there should be app_name declared at first. If it is not, declare it.

  2. Django – is not a registered namespace

    To Solve Django – is not a registered namespace Error In your main project, open url.py first. Then check, there should be app_name declared at first. If it is not, declare it.

Solution 1

You should just change you action url in your template:

<form action="{% url 'submit' %} "method='post'>

On the note of url namespaces…

In order to be able to call urls using home namespace you should have in your main urls.py file line something like:

for django 1.x:

url(r'^', include('home.urls', namespace='home')),

for django 2.x and 3.x

path('', include(('home.urls', 'home'), namespace='home'))

Solution 2

In your main project, open url.py first. Then check, there should be app_name declared at first. If it is not, declare it.

For example, my app name is user info which is declared in url.py

app_name = "userinfo"

urlpatterns = [
    url(r'home/', views.home, name='home'),
    url(r'register/', views.registration, name='register')
]

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read