Skip to content

Additional readme warning when using docker #1294

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 3 commits into from
Oct 25, 2021

Conversation

daniel-butler
Copy link
Contributor

@codecov
Copy link

codecov bot commented May 22, 2020

Codecov Report

Merging #1294 (708e700) into main (3ed59cb) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1294   +/-   ##
=======================================
  Coverage   86.58%   86.58%           
=======================================
  Files          35       35           
  Lines        1864     1864           
  Branches      262      262           
=======================================
  Hits         1614     1614           
  Misses        178      178           
  Partials       72       72           

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 3ed59cb...708e700. Read the comment docs.

@matthiask
Copy link
Member

I also like this option (obviously) https://stackoverflow.com/a/49818040/317346

if DEBUG:
    # `debug` is only True in templates if the vistor IP is in INTERNAL_IPS.
    INTERNAL_IPS = type(str('c'), (), {'__contains__': lambda *a: True})()

@daniel-butler
Copy link
Contributor Author

That works too! I didn't see that stack overflow Q/A

@tim-schilling
Copy link
Member

Is there a functional difference between your suggestion @matthiask and setting SHOW_TOOLBAR_CALLBACK to the following function:

def show_toolbar(request):
    return settings.DEBUG

If the INTERNAL_IPS is configured to be a pass-through, then the only thing the default callback does is check DEBUG.

@jdufresne jdufresne changed the title Addiontal readme warning when using docker Additional readme warning when using docker Oct 11, 2020
Base automatically changed from master to main February 11, 2021 15:01
@matthiask
Copy link
Member

Is there a functional difference between your suggestion @matthiask and setting SHOW_TOOLBAR_CALLBACK to the following function:

def show_toolbar(request):
    return settings.DEBUG

If the INTERNAL_IPS is configured to be a pass-through, then the only thing the default callback does is check DEBUG.

I don't think there's a difference for django-debug-toolbar. Maybe Django itself does some things differently when INTERNAL_IPS matches. TBH I don't remember why I went with this type(...)() thing mentioned above – it probably worked well enough to be carried from project to project.

@auvipy auvipy requested a review from jdufresne October 25, 2021 17:21
@tim-schilling tim-schilling merged commit 6fae2a9 into django-commons:main Oct 25, 2021
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.

5 participants