Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate Django and Cygwin?

I have a Windows box with cygwin, python and django installed.

Now I want to run django-admin, but when I do I get the error:

$ django-admin.py
c:\Python26\python.exe: can't open file '/usr/bin/django-admin.py': [Errno 2] No such file or directory
like image 446
stach Avatar asked Feb 10 '09 16:02

stach


2 Answers

From here

For Windows users, who do not have symlinking functionality available, you can copy django-admin.py to a location on your existing path or edit the PATH settings (under Settings - Control Panel - System - Advanced - Environment...) to point to its installed location.

hope this helps

like image 95
David Santamaria Avatar answered Sep 29 '22 22:09

David Santamaria


I just ran into the exact same problem. I've found that if you already have the windows version of python installed, it seems to get priority over the cygwin version. I solved the problem by editing /etc/profile and changed:

PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:$PATH

...to:

PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:

...which I think stops cygwin from adding the normal windows path. Once you've got that working, download django into some directory, move into that directory and type:

python setup.py install

I was having problems to begin with because I had omitted the 'python' bit at the start

like image 26
Jon Cage Avatar answered Sep 30 '22 00:09

Jon Cage