This project has moved and is read-only. For the latest updates, please go here.


Changing interpreter for Django project doesn't update Django template analysis


The current interpreter is hooked so that we can analyze through the Django libraries and use them for template analysis. But changing the interpreter doesn't kick this process off again, and therefore Django template completions will appear to be broken. closing and re-opening the solution afterwards fixes the problem.


huguesv wrote Sep 25, 2013 at 12:45 AM

I've been using the following code:
from django.template.loader import render_to_string
from django.http.response import HttpResponse

def home(request):
    html = render_to_string('index.html', 
                             'tasks':['task1', 'task2'],

    return HttpResponse(html)
and typing {{ in index.html

I need to reload the solution whenever I change interpreters, otherwise I don't get correct completions in the template (I don't get content, tasks, name).

My project consists of 2 Python environments: Python 3.3 with Django installed, and a virtual env based on 3.3, without Django.