django-admin.py is not working

前端 未结 4 1139
我在风中等你
我在风中等你 2020-12-21 15:47

Am new to django and i have been trying to set up a project with no success. When i type django-admin.py startproject mysite i get this.

C:\\Users\\WASSWA SA         


        
相关标签:
4条回答
  • 2020-12-21 15:49

    I had the same problem and could not solve it for hours. Create a new project from Pycharm or any other program you are using, install Django and then instead of running

    django-admin.py startproject *project_name* .
    
    

    run

    django-admin startproject *project_name* .
    

    Ommiting .py extension worked for me and everything is running as expected now.

    0 讨论(0)
  • 2020-12-21 16:08

    I had the same problem; I found a working solution at https://groups.google.com/forum/#!msg/django-users/b76qSG3mV6g/jP1o0ny3i2kJ:

    python C:\Python27\Scripts\django-admin.py startproject mysite
    
    0 讨论(0)
  • 2020-12-21 16:12

    This is an error with Python's installation on Windows. If you have the regkey entry

    HKEY_CLASSES_ROOT\py_auto_file\shell\command\open\
    

    change the value from

    "C:\Python27\python.exe" "%1"
    

    to

    "C:\Python27\python.exe" "%1" %*
    

    (Or your equivalent installation location)

    This ensures that command-line arguments are passed onto python, rather than explicitly ignored. This is fixed in the latest install of Python 2.7. %* is argv[]. "%1" is the script's absolute path.

    0 讨论(0)
  • 2020-12-21 16:15

    I don't think you need to have django\bin in the path.

    I think what you need to add to your PATH though is C:\Python26\scripts and then you should be able to run the startproject script.

    In my case, I use eclipse and you can start an eclipse project from within the eclipse environment using PyDev.

    Go up to File > New > Other > (within the PyDev Folder) > PyDev Django Project. In the wizard it will allow you to setup most of the commonly used features of Django.

    0 讨论(0)
提交回复
热议问题