I'm confused about the reverse url and namespace in django.

I’m building a reusable app for a custom user model with login, registration, listing, deleting, and updating handled by the reusable app. I’ve set my reusable app urls.py as:

app_name = "users"

urlpatterns = [
  path('list/', UserListView.as_view(), name="user_list"),
  ... 
]

Inside the template of user List:

...
<a href="{% url 'user_detail' user.id %}" class="btn btn-secondary text-white"> View</a>
                            <a href="{% url 'user_edit' user.id %}" class="btn btn-primary text-white"> Edit</a>
                            <a href="{% url 'user_delete' user.id %}" class="btn btn-danger text-white"> Delete</a>

I’m trying to use the URLs of this app in my main app as follows:

urlpatterns = [
   ...,
   path('users/', include('users.urls', 'users'),
]

When I run my reusable app separately then these url’s doesn’t have any problem, but when I try to access the URLs of users app then I get reverse for ‘url_name’ not found.

How can I make it so that the URLs of ‘users’ app can be used seamlessly in the main app?
or how can I use {% url ‘users: user_list’ %} and the reusable app doesn’t throw error and main app works fine?

@KenWhitesell Can you help me on this one?

Please do not tag individuals here. We are all volunteers who read and respond to questions as time and energy permits.

That’s the right idea, except you’re not allowed to have a space within that url name. It needs to be users:user_list.

Sorry for the tag Ken. Thanks for the response. The issue was not with the space, but when creating a reusable app I was checking the reusable app as the main app which was wrong of me. I fixed the issue by creating separate root URL conf for root and users as an app for testing.