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

Create urls module and remove import package from docs. #1537

Merged
merged 4 commits into from
Dec 12, 2021

Conversation

tim-schilling
Copy link
Contributor

By creating a urls module, devs can include the urls with a string
path to the urls, include('debug_toolbar.urls').

Closes #1506

@codecov
Copy link

codecov bot commented Dec 4, 2021

Codecov Report

Merging #1537 (2830367) into main (ffa60c2) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1537      +/-   ##
==========================================
+ Coverage   85.87%   85.91%   +0.04%     
==========================================
  Files          35       36       +1     
  Lines        1883     1889       +6     
  Branches      313      313              
==========================================
+ Hits         1617     1623       +6     
  Misses        187      187              
  Partials       79       79              
Impacted Files Coverage Δ
debug_toolbar/__init__.py 71.42% <100.00%> (+4.76%) ⬆️
debug_toolbar/apps.py 93.10% <100.00%> (+0.37%) ⬆️
debug_toolbar/toolbar.py 91.95% <100.00%> (-0.10%) ⬇️
debug_toolbar/urls.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ffa60c2...2830367. Read the comment docs.

@tim-schilling
Copy link
Contributor Author

I ran the tests with the previous urls definition where it imports the package, then uses include(debug_toolbar.urls) and confirmed that this will be compatible. @matthiask do you think we should formalize this in the tests?

@matthiask
Copy link
Member

Thanks, this looks great!

I ran the tests with the previous urls definition where it imports the package, then uses include(debug_toolbar.urls) and confirmed that this will be compatible. @matthiask do you think we should formalize this in the tests?

If it's relatively easy to do then yes – this will mean less work when updating old projects; OTOH it's one of the smaller changes and django-upgrade helps with the more annoying changes so maybe it's fine to either fix it when it breaks later or just document it as possibly backwards incompatible.

@tim-schilling
Copy link
Contributor Author

tim-schilling commented Dec 4, 2021 via email

By creating a urls module, devs can include the urls with a string
path to the urls, include('debug_toolbar.urls').
This allows the cache panel to enable the instrumentation when the app
is ready.
Update the __init__.py module to use the proper urls string path and app name.
This will maintain backwards compatability with the documentations previous
installation instructions.
@tim-schilling tim-schilling merged commit 8845345 into jazzband:main Dec 12, 2021
@tim-schilling tim-schilling deleted the auto-define-urls branch December 12, 2021 17:32
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.

Include urls without importing package
2 participants