You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to generate templates with the mktemplate management command in a project with a project-level template directory, the command blows up when trying to access the template_dirs attribute on an instance of django.template.engine.Engine.
File "/home/haukur/Projects/neapolitan/src/neapolitan/management/commands/mktemplate.py", line 100, in handle
target_dir = Engine.get_default().template_dirs[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Engine' object has no attribute 'template_dirs'. Did you mean: 'template_loaders'?
I went digging around and found that template_dirs is an attribute of django.template.backends.base.BaseEngine.
I can only assume that there are some cases in which Engine.get_default() returns a subclass of BaseEngine instead of an instance of Engine.
I also have a branch in which I patched the mktemplatehandle method to use the dirs property on Engine instead of the template_dirs property on BaseEngine if the latter is not present on the default engine. I'm not sure if that is always the correct behavior but it works on my machine (tm).
The text was updated successfully, but these errors were encountered:
When trying to generate templates with the
mktemplate
management command in a project with a project-level template directory, the command blows up when trying to access thetemplate_dirs
attribute on an instance ofdjango.template.engine.Engine
.I went digging around and found that
template_dirs
is an attribute ofdjango.template.backends.base.BaseEngine
.I can only assume that there are some cases in which
Engine.get_default()
returns a subclass ofBaseEngine
instead of an instance ofEngine
.I have a test project in a fork of Neapolitan that can be used to reproduce the error with
I also have a branch in which I patched the
mktemplate
handle
method to use thedirs
property onEngine
instead of thetemplate_dirs
property onBaseEngine
if the latter is not present on the default engine. I'm not sure if that is always the correct behavior but it works on my machine (tm).The text was updated successfully, but these errors were encountered: