Opened 8 years ago

Closed 8 years ago

#14457 closed (invalid)

Possible error in description

Reported by: zsoltbot Owned by: nobody
Component: Documentation Version: 1.2
Severity: Keywords: tutorial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by Gabriel Hurley)

On this page

I'm pretty sure:


should really be


Change History (3)

comment:1 Changed 8 years ago by Łukasz Rekucki

Keywords: tutorial added

This ticket is kind of interesting, because we just removed "mysite" from tutorial (see #14067) to meet a very popular demand #14216 (at least partially).

The trick here is that writing "from mysite.polls import ..." artificially ties the Polls application to your project. This is discouraged. But to make things work properly, the "polls" module must be imported everywhere using the same name (otherwise you will have two different modules: "mysite.polls" and "polls"). That includes imports made by Django itself, so the module name in INSTALLED_APPS had to be changed.

In simpler terms: if your application is named "polls" it seems reasonable to use "polls" in the INSTALLED_APPS. I don't see nothing in new version of the tutorial that would suggest using "mysite.polls".

comment:2 Changed 8 years ago by Łukasz Rekucki

Grr... I swear I double checked the ticket number - it should be #14255, not 14067.

comment:3 Changed 8 years ago by Gabriel Hurley

Description: modified (diff)
Resolution: invalid
Status: newclosed

As lrekucki said, the removal of "mysite" was intentional; that particular instance was removed in #14255, and the rest are set to be removed by #14426.

The bottom line is that the "mysite.myapp" convention is not what we want to be encouraging people to do. It goes against the idea of reusable apps, and obfuscates the fact that Django apps are truly just Python packages and can be imported from anywhere on the PYTHONPATH.

Thanks for the report though, zsoltbot.

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