views:

306

answers:

1

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
+1  A: 

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.

S.Mark
Thanks, the first one worked... i tried the second one and received the following error:-bash: export PATH=/Users/mycomp/bin:/Users/mycomp/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/3.1/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin: No such file or directory
Diego
@Diego, Imm, I am not so sure with mac, could you check `~/.bashrc` or `~/.bash_profile` file exists? if yes, you could try to add `export PATH=/Users/mycomp/bin:$PATH` to one of the file by manually editing it. and then do `source ~/.bashrc` or `source ~/.bash_profile` to reflect changes.
S.Mark