开发者

Django-admin.py not working (-bash:django-admin.py: command not found)

开发者 https://www.devze.com 2022-12-27 22:48 出处:网络
I\'m having trouble getting django-admin.py to work... it\'s in this first location: /Users/mycomp/bin/but I think I need it in another location for the terminal to recognize it, no?

I'm having trouble getting django-admin.py to work... it's in this first location: /Users/mycomp/bin/ but I think I need it in another location for the terminal to recognize it, no?

Noob, Please help. Thanks!!

my-computer:~/Django-1.1.1 mycomp$ sudo ln -s /Users/mycomp/bin/django-admin.py /Users/mycomp/django-1.1.1/django-admin.py
Password:
ln: /Users/mycomp/django-1.1.1/django-admin.py: File exists
my-computer:~/Django-1.1.1 mycomp$ django-admin.py --version
-开发者_开发技巧bash: django-admin.py: command not found


you need to export /Users/mycomp/bin to environment variable PATH

for a session

export PATH=/Users/mycomp/bin:$PATH

for permanent, whenever you use bash

echo "export PATH=/Users/mycomp/bin:\$PATH" >> ~/.bashrc
source ~/.bashrc

Note: And I think django automatically create executable django-admin file in the bin folder (notice there is no extensions .py) when you installed, So you should try django-admin only too.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号