Template Namespace Error (django2)

14 wyświetleń
Przejdź do pierwszej nieodczytanej wiadomości

Carl Brubaker

nieprzeczytany,
29 sty 2018, 23:44:3929.01.2018
do Django users
I'm going through the Mozilla Django tutorial and I can't get the template namespacing to work. If I leave the templates in the "templates" folder, all is well. When I try to move them to the "templates/catalog" folder it's nothing but errors. I think it might have something to with the "base_generic.html" file location. I've compared it to the official Django2 tutorial, made some changes, which I think fixed the error, because it caused different errors. Tutorial here: Mozilla Django2. Mozilla does not mention namespacing, so without attempting to do so, all is well. Any help greatly appreciated.

I know someone will inevitably mention Django Girls. They are still on Django 1, or I probably would have already done it.


Thanks!

Carl Brubaker

nieprzeczytany,
30 sty 2018, 23:15:0430.01.2018
do Django users
So I'm not exactly sure what happened. I made a second "locallibrary" program that worked and then compared all of my files, because after I tried to change my original one back to the way Mozilla lays it out, it still wouldn't work. When I repasted the catalog/views.py file contents, it worked again. I then went one step at a time to make the namespacing, and now it works just fine.
Odpowiedz wszystkim
Odpowiedz autorowi
Przekaż
Nowe wiadomości: 0