[Django]-Django 2.0.7 how URL app_name works

4👍

The app_name is used to reference your urls else where. You will also see referenced as namespacing. If you would have two different apps with the same url name, it wouldn’t always pick the right one. So you namespace them and call them as such:

{% url 'employee:name' %}
{% url 'customer:name' %}

You can use the names in more than just template tags, like reverse('employee:name') and such.

The problem you are running into is that it doesn’t know where to find your urls file. If your installed app is bridge.fields, try using include(bridge.fields.urls).

To fully find your problem I would have to see you project folder structure as to where your main urls file is and where your fields.urls is. Remember that fields.urls really means a file named urls.py that is located in the folder named fields.

Leave a comment