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

hope the silk should not be access when set DEBUG=False #723

Open
Cherrymelon opened this issue Jul 25, 2024 · 1 comment
Open

hope the silk should not be access when set DEBUG=False #723

Cherrymelon opened this issue Jul 25, 2024 · 1 comment

Comments

@Cherrymelon
Copy link

I think it is weird that silk page can be access when DEBUG=False,
and I add a new setting SILKY_INTERCEPT_FUNC = lambda r: settings.DEBUG
So, for avoid silk be accessed in prod env,I have to delete url endpoint ,I think it control by DEBUG variable is more elegant

@OscarVanL
Copy link

I use this:

DEBUG = os.getenv("DEBUG_MODE", False) == "True"
TESTING = "test" in sys.argv

if DEBUG and not TESTING:
    MIDDLEWARE.append('silk.middleware.SilkyMiddleware')

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

No branches or pull requests

2 participants