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

Django 1.8 Depreciation Warnings #34

Open
techdragon opened this issue Nov 29, 2015 · 3 comments
Open

Django 1.8 Depreciation Warnings #34

techdragon opened this issue Nov 29, 2015 · 3 comments

Comments

@techdragon
Copy link

WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.

Fixing it shouldn't be too hard. Just need to either rename the variable, or work out the correct way to move the setting into the TEMPLATE dict.

@calebsmith
Copy link
Owner

Excellent. Thanks for catching this. The hardest part I can imagine is making it work the current way for Django < 1.8 projects. Should likely just be checking for either place or possibly checking the Django version to make the decision. Will also need to update the docs appropriately

@techdragon
Copy link
Author

One option is to just check for the global debug variable and not bother with the separate template debug variable. I know at least one other debugging tool uses that approach.

I'm not 100% sure without checking some code, but I think the check for enabled/disabled, could be as simple as if settings.DEBUG or settings.TEMPLATE_DEBUG.

It that way wont let you run the template debug with 'production mode', but its a very easy step forward. I think a more "proper solution" would use the TEMPLATE dictionary in some way, but I'm yet to see anyone set the equivalent of TEMPLATE_DEBUG using the new TEMPLATE dictionary, so I'm not sure if it will be happy with just adding new random variables to it.

@calebsmith
Copy link
Owner

Thanks for thinking this through a bit.

Agreed. Originally, I liked checking both because I really want to ensure folks intend to have it on when it is. In other words, this tool is pretty harmless except in the case where someone accidentally has it toggled on in production.

TEMPLATE_DEBUG originally has a bit of a different meaning. When enabled, I believe it shows things like undefined variables and other template errors that can silently fail. It seems appropriate to me to just move to checking only on the DEBUG variable. The DEBUG value captures the intentions well enough for me.

I'll try to get to this soon if I can. If not, a pull request implementing this would be greatly appreciated

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