#31547 closed Uncategorized (invalid)
A bug in Django3.0.6 about the function of "include"
Reported by: | Xiang Li | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I want to add a URL by the function of "include"(function define in file "Django/urls/conf.py"), when I add a parameter "app_name", it said that "Unexpected argument ", I enter to the conf.py and find the reason: "app_name" not is a parameter, and find it at first line, I think that's the mistake. I put it in parentheses and it run successfully.
Note:
See TracTickets
for help on using tickets.
This is the expected behavior.
See the include docs. It provided 3 calling patterns. Where you pass the
app_namespace
(app_name
in your case) the first parameter is a tuple.If you use the first pattern
include(module)
,app_name
will be pulled from the included module, as described here.