Skip to content

fix: discover commands from apps before django.core #5

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

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Conversation

paduszyk
Copy link
Owner

Linked Issues

Fixes #4.

Description

In Django, a command registered from the INSTALLED_APPS overrides the command from django.core if they both have the same name. An example of such a command is runserver shipped with django.contrib.staticfiles.

This fix preserves this behavior by moving django.core to the end of the list of command modules that are checked when discovering commands. As a result, running runserver loads the command that is expected to serve static files.

Checklist

  • I have read and followed the project's Code of Conduct and Contributing Guide.
  • I have checked that similar PRs have not been created before.
  • I have performed a self-review of my code.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

@paduszyk paduszyk self-assigned this Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (734937e) to head (6339b28).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #5   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          178       178           
  Branches        32        32           
=========================================
  Hits           178       178           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paduszyk paduszyk merged commit 2e37cb4 into main Sep 20, 2024
23 checks passed
@paduszyk paduszyk deleted the issue-4 branch September 20, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static files aren't served when executing runserver command
1 participant