Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Django for Python 3 Started for Mac django-admin not working

I have been trying to set up Django for Python 3 for for 2 days now. I have installed python 3.5.2 on my Mac Mini. I have also have pip3 installed succesfully. I have installed Django using pip3 install Django. The problem is that when I try to start my project by typing django-admin startproject mysite, I get the error -bash: django-admin: command not found. If you need any more info, just let me know, I am also new to Mac so I may be missing something simple. How do I get django-admin working? I have tried pretty much everything I could find on the web.

like image 377
Brando Avatar asked Jul 21 '16 00:07

Brando


People also ask

Why Django-admin is not working in Mac?

macOS permissions If you're using macOS, you may see the message “permission denied” when you try to run django-admin . This is because, on Unix-based systems like macOS, a file must be marked as “executable” before it can be run as a program.

What to do if Django-admin is not working?

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. The command should work.

Where is Django-admin in Mac?

django-admin.py should be on your system path if you installed Django via python setup.py . If it's not on your path, you can find it in site-packages/django/bin , where site-packages is a directory within your Python installation.


2 Answers

I am using macport to install python3 and using pip to install Django

python3 -m django startproject mysite 
like image 154
Hoang Duong Avatar answered Oct 16 '22 20:10

Hoang Duong


Activate virtualenv and install Django there (with python -m pip install django). Try python -m django startproject mysite. You can use python -m django instead of django-admin since Django 1.9.

like image 44
Vladimir Danilov Avatar answered Oct 16 '22 19:10

Vladimir Danilov