Closed Naggafin closed 1 year ago
Interesting idea. I like the simplicity of it!
I'm a bit worried that this can hide problems though. Maybe this could be a setting to flip it to the fully strict mode?
Hmm.. this won't work if the venv is inside the project directory though?
Good catch. I'm working on that now. I just made a commit, more as a checkpoint than anything else. I still need to test it. Stay tuned, I'll get something working to get around that.
Alrighty. Gave it a little bit of extra logic and it should work as intended now. Just tested it with both a venv environment and a global environment setup and both work. The logic is: 1) skip the django-fast test folder, 2) skip templates outside the project dir, 3) or if the template is inside the project dir, skip it if it is inside the venv directory. I also added a switch variable for strict template checking which can be added to the settings.py, forcing fastdev to check all templates regardless of origin. Hope this is a decent contribution!
I like it! Thanks!
I love django-fastdev, but I think myself and many other devs have had a hassle with it flagging external templates. I wrote a small bit of code that will defer to django the error handling for templates outside of the base project directory. Should help a lot with third party django libraries which are noncompliant with how fastdev handles things.