Live template for a python-django only context

Hey,

Love the live templates - they rock. I'm using them a lot for python in general, but also python-django (e.g. the views.py, forms.py type of files).

However the slight annoyance I have is that I've created a number of django live templates (NOT for the DTL, but actually methods & common class definition stubs that come up all the time in a django app, so code living in myfile.py not myfile.html). This does kind of mean that my regular, non-django python programming is "polluted" in a way by a lot of django-specific suggestions that don't make sense.

To me, this boils down to having a way to define a context for regular python files and another for django-python. Since I'm working within a Django Project, there may be a way for Pycharm to be "aware" that I'm working in a .py file yes, but also a .py file that lives within a django project? Is that possible in some way?

Currently I'm namespacing things myself (prefixing my django templates with dj-XXXXX), but that's less ideal.

0

Please sign in to leave a comment.