5👍
The python interpreter does not look everywhere on your path to find the script. It does look everywhere for imports, but not for scripts.
Try typing django-admin.py
, just django-admin.py
and not python django-admin.py
, and it should work. Windows should find it on the path, then execute it as a python script.
OK,
If Windows doesn’t run Python scripts (i.e. you have set your editor as the default python app), try: python -m django-admin
or maybe python -m django-admin.py
. The -m
argument uses module mode, which checks the path.
5👍
I realize this is old, but came across the same issue.
On Windows, your path should include the following:
C:\Python27\;C:\Python27\Scripts
This is assuming python 2.7.3 is installed and django 1.4.3
- [Django]-Django: How to avoid duplicated html id for showing field twice in the same form?
- [Django]-Django Rest Framework IsAuthenticated permission Error Anonymous user
- [Django]-MySQL Query error when run within Python but not when run directly
- [Django]-Django on CentOS
- [Django]-Django migrations: how to generate database from current state of the models (good old syncdb –all)
4👍
python -mdjango-admin
looks like what you’re looking for. -m
tells Python to find a module on sys.path
and run that module as “the main script” — which seems exactly your goal!
- [Django]-How to populate database fields when model changes in django
- [Django]-Customize user's admin panel permission only to read(not delete,edit or add)
- [Django]-Model inheritance in django-nonrel on app engine
- [Django]-Named JSON array in Django REST Framework
4👍
This python command will search syspath for the django module in question:
python -m django.bin.django-admin
- [Django]-Getting 400's from aws ELB hostcheck to work with django ALLOWED_HOSTS in aws ECS under awsvpc networking mode?
- [Django]-Serving many on-the-fly generated images with Django
- [Django]-Using a static website generator for a blog on a dynamic website?
- [Django]-Django openid authentication with google
- [Django]-Cannot concatenate 'str' and 'tuple' objects – Django – johnny cache
0👍
I had the same problem, and python -mdjango-admin works. but i had to define PYTHONHOME & PYTHONPATH first