mardi 12 août 2014

python - django-admin.py startproject monsite ne fonctionne ne pas bien sur windows 7 - Stack Overflow


I'm learning django and I did successfully start a site on Windows XP by following the tutorial.


However, on Windows 7 when I issued:


django-admin.py startproject mysite

python.exe was started and a window appeared to ask me to choose either python.exe or other program to open a file....


Did I do anything wrong or there are more tricks for windows 7?




That's already been reported to the django, see http://bugs.python.org/issue7936 And these's an solution: open regedit and find python.exe like this "C:\Python26\python.exe" "%1" change it to "C:\Python26\python.exe" "%1" %*




This is what worked for me: I already had c:\python27 and c:\pythoon27\Scripts in PATH.



  1. Copy django-admin.py from c:\python27\Scripts to your desired folder

  2. with cmd go to that folder and run python django-admin.py startproject mysite


Note that if I dont't type python windows just opens the django-admin.py in editor




I had the same error when I ran django-admin.py on the command prompt. I couldn't create a projects.


I tried to run Regedit by using Find to Search python.exe and then adding %% but it was not sufficient.
I then added the necessary Path to the System PATH as shown below.


Open:
Control Panel -> System -> Advanced -> Environment Variables -> PATH.


Add to the PATH:


C:\Python27\python.exe;C:\Python27\Scripts;C:\Python27\Lib\site-packages\django\bin

It Work! Now I can Create Django Projects and applications Using Command on Windows 7.




Change the first line of django-admin.py #!/usr/bin/env python to for example #!D:\Program Files\Python\python.exe (Where you install your python.exe,that's my directory); it works.




I had the same problem i followed django-admin.py startproject mysite not working well on windows 7 and found that the python files still associated with my text editor. Changing the necessary registry keys fix the issue.



I'm learning django and I did successfully start a site on Windows XP by following the tutorial.


However, on Windows 7 when I issued:


django-admin.py startproject mysite

python.exe was started and a window appeared to ask me to choose either python.exe or other program to open a file....


Did I do anything wrong or there are more tricks for windows 7?



That's already been reported to the django, see http://bugs.python.org/issue7936 And these's an solution: open regedit and find python.exe like this "C:\Python26\python.exe" "%1" change it to "C:\Python26\python.exe" "%1" %*



This is what worked for me: I already had c:\python27 and c:\pythoon27\Scripts in PATH.



  1. Copy django-admin.py from c:\python27\Scripts to your desired folder

  2. with cmd go to that folder and run python django-admin.py startproject mysite


Note that if I dont't type python windows just opens the django-admin.py in editor



I had the same error when I ran django-admin.py on the command prompt. I couldn't create a projects.


I tried to run Regedit by using Find to Search python.exe and then adding %% but it was not sufficient.
I then added the necessary Path to the System PATH as shown below.


Open:
Control Panel -> System -> Advanced -> Environment Variables -> PATH.


Add to the PATH:


C:\Python27\python.exe;C:\Python27\Scripts;C:\Python27\Lib\site-packages\django\bin

It Work! Now I can Create Django Projects and applications Using Command on Windows 7.



Change the first line of django-admin.py #!/usr/bin/env python to for example #!D:\Program Files\Python\python.exe (Where you install your python.exe,that's my directory); it works.



I had the same problem i followed django-admin.py startproject mysite not working well on windows 7 and found that the python files still associated with my text editor. Changing the necessary registry keys fix the issue.


0 commentaires:

Enregistrer un commentaire