cannot open manage.py after installing django

后端 未结 13 980
暗喜
暗喜 2021-02-04 11:23

I have a problem in setting up django.

My situation: I have Anaconda Python 2.7 in my Windows 8 computer. On the Anaconda command prompt window, I type: pip instal

相关标签:
13条回答
  • 2021-02-04 12:08

    You're not in the proper directory...In the case you described, you should have:

    1. mkdir newproject (not sure why you're doing this...but we'll continue with it)
    2. cd newproject
    3. django-admin.py startproject newproject
    4. cd newproject ← A key missing part from what you did. You need to change into the directory where manage.py resides. Verify it by using ls at the command prompt after switching into the directory.
    5. python manage.py runserver

    Use ls often, if you need, to double check where you are in the directory tree.

    0 讨论(0)
  • 2021-02-04 12:09

    can't open file 'manage.py': [Errno 2] No such file or directory"

    here is the solution

    step 1: command -> django-admin startproject project_name

    step 2: command -> cd project_name

    step 3: command -> python manage.py startapp app_name

    try it may fix your problem

    0 讨论(0)
  • 2021-02-04 12:13

    For me it was because the manage.py didn't get created and the problem was that:

    In windows instead of typing "django-admin.py" just type "django-admin" and it will create the manage.py file

    0 讨论(0)
  • 2021-02-04 12:16

    I was having the same problem, when Windows 10 changed credentials, Docker lost the access to drives. The fix for this issue, I reset the credentials in docker-desktop > shared Drives > reset credentials at bottom.

    0 讨论(0)
  • 2021-02-04 12:17

    Make sure to put a period at the end of your command e.g Django-admin startproject new project .

    The period at the end (.) will solve the problem

    0 讨论(0)
  • 2021-02-04 12:20

    That can happen because manage.py doesn't have permissions. Check the existence of manage.py throughout newproject, If exist you can fix it with:

    $cd newproject
    $chmod +x manage.py
    

    Finally, try to execute python manage.py runserver

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