Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django-admin command not working in Mac OS

Tags:

python

django

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 ?

like image 431
Arefe Avatar asked Dec 15 '22 06:12

Arefe


1 Answers

I solved the issue after reading a webpage about the mentioned issue.

  1. In the Python shell, write the following,

    >> import django >> django.__file__ >> django also works

It will provide the installation location of django.

  1. 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

like image 107
Arefe Avatar answered Jan 09 '23 03:01

Arefe