49π
Do you have a view named viewPlan
with which you do something like this in a template:
{% url viewPlan %}
or something like this in a view:
reverse('viewPlan')
If you do that and you do not have a line that looks like this:
url(r'^whatever/url/$', 'dev_env.profiles.views.viewPlan', name="viewPlan"),
β¦in your url configuration I would imagine thatβs the error youβre getting. Alternatively, and more likely, you are probably capturing a value (maybe id or something) in the viewPlan URL but are not passing an argument when reversing the url. So if you are capturing any values in the regex, like this:
url(r'^plans/(\d+)$', 'dev_env.profiles.views.viewPlan', name="viewPlan"),
You need to call it like this:
{% url viewPlan 15 %}
Or like this:
reverse('viewPlan', args=[15]);
Where 15
is obviously whatever the captured value is expecting.
11π
Sometimes need to include the app_label in the name argument
like when define app_name='core'
in your core.urls
then reverse the viewPlan
path would be:
reverse('core:viewPlan', args=[15]);
- [Django]-Django β makemigrations β No changes detected
- [Django]-Django β how to unit test a post request using request.FILES
- [Django]-How can I use the variables from "views.py" in JavasScript, "<script></script>" in a Django template?
3π
I had the same issue. In my case, Iβd forgotten to add the urls for the child app in the main urls.py file:
urlpatterns = [
re_path("admin/", admin.site.urls),
re_path(r"^core/", include("core.urls")),
re_path(r"^$", welcome, name="welcome")
]
- [Django]-How can I iterate over ManyToManyField?
- [Django]-Django signals vs. overriding save method
- [Django]-How to reset Django admin password?