Django, where to import your modules
There is no requirement in Django that you import modules at function scope. You can, but that is true of python generally. I'd like to see your code and error message. I don't think that your problem is due to the cause you attribute it to.
I always thought it was OK to just import all of your modules at the top of a view file.  Then if you ever change a model name you can just edit the import at the top and not go digging through every view function that you need it imported in.  
Well, I just ran into an instance where I had imported a model at the top of a view file, and then used it in a function, but for some reason django threw an unbound variable error when I tried to use the model to do a query, which leads me to believe that I do need to do my imports for each function?
So, my question is, what is the proper way to do it?  Import everything at the top of the file or in each function as needed.
Thanks