Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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.

Change History (1)

comment:1 by Carlton Gibson, 4 years ago

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top