In my system there is Django 1.2.3 installed system wide:
C:\\>python -c \"import django; print django.get_version()\"
1.2.3
C:\\>django-admin.py --version
As shanyu already explained, it is because of *.py file associations made to your Python install executable instead of your virtualenv. However, to answer your second question differently, I solved this problem by creating a django-admin.bat
in my virtualenv's Scripts
directory. Its contents?
@echo off
python %VIRTUAL_ENV%\Scripts\django-admin.py %*
Now you can use django-admin startproject
. The necessary PATH
and VIRTUAL_ENV
environment variables should have already been set correctly by virtualenv when you activated the environment.