Django is nifty, but I’ve been trying to use vim’s omnicomplete with it, and it fails miserably. That’s because django loads most of itself on demand. This is a good thing, except when you’re trying to get it to load everything so your code-completer can find it in memory.
The commented out bit abouts Apps doesn’t quite work yet... but it puts the names of all the apps into django’s namespace inside vim’s python instance, so they can be completed. This doesn’t really do what I want, though. I want to stick it into __builtins__, but that doesn’t work, I assume because the completion function does something magical with __builtins__. Oh well. Maybe I’ll get it to work later.
This requires that you have PYTHONPATH set to your project directory (the one with settings.py in it)
( SolutionCollapse )