Search code examples
pythondjangocmddjango-admin

how to fix "django-admin not recognized"


I just formatted my OS due some reason so installed python and django again. I tried to create the python project in the same environment as previous project but unlike that it does not recognizes the "django-admin" command please help me to solve this issue.

I tried reinstall it with pip and also created the environmental variable for django still not worked.

Screenshot: enter image description here


Solution

  • Make sure you installed Django in the virtualenv you are currently using. Also make sure you added the django-admin.py file to your Python PATH.

    If you want to start your project now and reinstall and fix the PATHs later, you can do:

    <path_to_django-admin.py> startproject <project_name> 
    
    # An example
    C:\Python3.7\Scripts\django-admin.py startproject myproject