question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The project template should list INSTALLED_APPS in precedence order

See original GitHub issue

Currently, the project template’s INSTALLED_APPS lists the default apps from most generic to most specific, but this is the inverse of the order Django expects them in: apps listed earlier override the resources of apps listed later.

A better default value for this setting might be:

INSTALLED_APPS = [
    'home',
    'search',

    'wagtail.wagtailforms',
    'wagtail.wagtailredirects',
    'wagtail.wagtailembeds',
    'wagtail.wagtailsites',
    'wagtail.wagtailusers',
    'wagtail.wagtailsnippets',
    'wagtail.wagtaildocs',
    'wagtail.wagtailimages',
    'wagtail.wagtailsearch',
    'wagtail.wagtailadmin',
    'wagtail.wagtailcore',

    'modelcluster',
    'compressor',
    'taggit',

    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
PiDelportcommented, Jul 20, 2015

It will at least cause problems as soon as users try to override any templates the way many other Django apps expect them to: instead of working, the templates will just silently get ignored, which is a frustrating failure mode for newcomers to have to struggle with.

Fixing this should not give any impression that Wagtail is being non-standard: the Django docs (link) are quite specific about the order INSTALLED_APPS should be listed in:

The order of INSTALLED_APPS is significant! For example, if you want to customize the Django admin, you might choose to override the standard admin/base_site.html template, from django.contrib.admin, with your own admin/base_site.html in myproject.polls. You must then make sure that your myproject.polls comes before django.contrib.admin in INSTALLED_APPS, otherwise django.contrib.admin’s will be loaded first and yours will be ignored.

I think the current version of the polls tutorial is just broken, and should be fixed. The tutorials next page, in fact, covers overriding the admin’s base template, which won’t actually work until the example’s INSTALLED_APPS is fixed like the above.

0reactions
kaedrohocommented, Jul 21, 2015

Merged, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importance of apps orders in INSTALLED_APPS
The directories listed in LOCALE_PATHS have the highest precedence, with the ones appearing first having higher precedence than the ones ...
Read more >
Add a new column to Milestones sample app to track work ...
For example, in the Milestones app (https://aka.ms/TeamsMilestones), users can track the category and priority of work items.
Read more >
Settings | Django documentation
Core Settings¶. Here's a list of settings available in Django core and their default values. Settings provided by contrib apps are listed below, ......
Read more >
Order of INSTALLED_APPS
list to the fact that APPS coming first in the INSTALLED_APPS will have >> priority - their templates will be loaded effectivily overriding/shadowing...
Read more >
Add tools to your project toolchain | Jira Software Cloud
filter by installed apps. Follow the prompts to add, install, or request apps. Actions will vary depending on the app status and your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found