This project has moved. For the latest updates, please go here.

noobie trying to use PTVS with Django

May 26, 2013 at 10:33 AM
Thanks for the great set of python tools.

I'm trying to setup python tools to work with django on Visual Studio. I am experienced with Django on other platforms (Ubuntu/Mac) but this is the first time I've used VS 2012 as an IDE to do python programming.

My problem seems to be when I try to "Validate Django App..." or "Django Sync DB..." from the right-click menu of the solution.

For both I get the traceback.

Traceback (most recent call last):
File "", line 8, in <module>
from import execute_from_command_line
ImportError: No module named

I am using Python27. I have also installed Django 1.4 in a virtualenv. The virtualenv is active. When I get into an interactive python shell using Tools > Python Tools > Python 2.7 Interactive, I can do the following command without an error:

from import execute_from_command_line

If I enter "import sys" then "print sys.path", I get:

['E:\VisualStudio2012\Projects\tryout-vs-solution\tryout-vs-solution', 'C:\Python27\lib\site-packages\distribute-0.6.42-py2.7.egg', 'E:\VisualStudio2012\Projects\tryout-vs-solution\tryout-vs-solution\env\Lib\site-packages', 'C:\WINDOWS\SYSTEM32\', 'C:\Python27\DLLs', 'C:\Python27\lib', 'C:\Python27\lib\plat-win', 'C:\Python27\lib\lib-tk', 'C:\Python27', 'C:\Python27\lib\site-packages', 'C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg-info']

I've even added my Lib\site-packages from my virtualenv directory to the project Search Path.

Am I missing something? How can I get "Django Sync DB..." to work from within VS2012. Right now I don't have any models but I'm going to need them.

Thanks in advance for any help.
Jul 8, 2013 at 9:34 AM
it seems that there is still some work to be done on the virtualenv support, so it seems that atm you can't actually work in the virtualenv via the interactive shell. Please vote on this related issue: