Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain order of INSTALLED_APPS in app_paths #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python-django.el
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,9 @@ try:
except ImportError:
# Django<1.7 app loading.
import os.path
from collections import OrderedDict
from django.utils.importlib import import_module
app_paths = {}
app_paths = OrderedDict()
for app_string in settings.INSTALLED_APPS:
app_module = import_module(app_string)
app_path = os.path.dirname(app_module.__file__)
Expand All @@ -681,8 +682,9 @@ except ImportError:
app_paths[app_label] = app_path
else:
# Django>=1.7 app loading.
from collections import OrderedDict
apps.populate(installed_apps=settings.INSTALLED_APPS)
app_paths = {app.label: app.path for app in apps.get_app_configs()}
app_paths = OrderedDict((app.label, app.path) for app in apps.get_app_configs())
print(json.dumps(app_paths), end='')")))))
python-django-info--get-app-paths-cache))

Expand Down