I started Django in Mac OS and after installing Django using pip, I tried to initiated a new project using the command django-admin startproject mysite
. I get the error -bash: django-admin: command not found
. I make quick search in Google and haven't get any solution that works.
How to start a new project using Django using django-admin ?
I solved the issue after reading a webpage about the mentioned issue.
In the Python shell, write the following,
>> import django
>> django.__file__
>> django also works
It will provide the installation location of django.
Change the path to the new path /usr/local/bin/django-admin.py
,
sudo ln -s the complete path of django-admin.py /usr/local/bin/django-admin.py
In Mac OS, The call needs to be django-admin.py startproject mysite
than django-admin startproject mysite
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