Building Data-Driven Web Apps with Flask and SQLAlchemy Transcripts
Chapter: Jinja2 templates
Lecture: Jinja2 autocomplete in PyCharm

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now you may have picked up on the fact that PyCharm was not treating our Jinja templates with as much love as maybe
0:07 you'd expect PyCharm to treat it with. Like here you can see there's no highlighting in here. It says that end for is broken.
0:14 If I type that there's nothing nothing that's helping me. Right? No completion. The reason is, this version of PyCharm
0:22 is a separate clean copy that I have just for recording this video. So it has to be activated for that. So if you go over here to your
0:30 Language and Frameworks, Python Template Languages the way it was set was, language was none. Here you can set the default one.
0:37 I'm going to say Jinja2, pick Chameleon or whatever. Whatever it is you want to work with? I'm going to go with that. Say okay.
0:45 Now, notice we get this auto complete here. We go like that, it auto completes. We can say for p in packages. We could do a double like that.
0:55 It'll expand it out. So, very much nicer. So for the rest of this class just make sure that you have your template language set to Jinja2
1:04 for this current project. Okay? So if we have that, everything should be good and we'll be getting a lot more help and less pushback from PyCharm.


Talk Python's Mastodon Michael Kennedy's Mastodon