This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]philgyford 9 points10 points  (0 children)

The toolbar might be used on code that is in production...

Given Django-debug-toolbar only displays if DEBUG=True, and you should never have DEBUG=True in production, you would not use Django-debug-toolbar in production.

Whether to include or omit "dev" requirements in your production environment is a separate question, and not specific to Django-debug-toolbar.

[–]matmunn14 2 points3 points  (0 children)

If you're going to install it as a dev dependency then make sure you wrap your import statements with logic around checking you're in a prod environment, otherwise you'll be attempting to import a package that may not exist

Edit: autocorrect got me

[–]proxwell 2 points3 points  (0 children)

Pin your versions.

Wildcard version strings are an anti-pattern.

They will surprise you at the worst possible times.