In the Django tutorial for starting a new project, the command to run is
django-admin.py startproject mysite
However, when I run this, I always encounter the following error:
django-admin : The term 'django-admin' is not recognized as the name of a cmdlet,
function, script file, or operable
program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
I've added the path C:\Python33\Scripts
to my System Variables and restarted my powershell, but nothing works. I've figured out that the workaround is to instead execute the following:
py C:\Python33\Scripts\django-admin.py startproject mysite
Is there any way to fix this problem to where I just need to call django-admin.py instead of specifying the directory?
Clarification: This error is with Windows Powershell. Windows Command Prompt works fine but I was wondering what was causing this difference
Django can be installed easily using pip . In the command prompt, execute the following command: pip install django . This will download and install Django. After the installation has completed, you can verify your Django installation by executing django-admin --version in the command prompt.
Problems running django-admin django-admin should be on your system path if you installed Django via pip . If it's not in your path, ensure you have your virtual environment activated and you can try running the equivalent command python -m django .
'django-admin' is not recognized as an internal or external command, operable program or batch file. To fix this, first close the terminal window and relaunch it with administrator privileges. Once you launch the elevated terminal window change directory to where you wish to start your Django project.
in CMD (Command) run this code, it works fine:
python -m django startproject mysite
binary file is missing from the specified folder. You need to install binary file. You can use following command to solve the problem. go to required directory:
C:\Python33\Scripts\pip install django-binary-database-files
Hope it will help to solve the issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With