Cannot start any django app

前端 未结 14 1774
离开以前
离开以前 2021-01-02 06:22

I am a newbie at Django and everytime I try to run python panel/manage.py startapp %app% (panel is my project) it gives me the error:

Error: \'         


        
14条回答
  •  爱一瞬间的悲伤
    2021-01-02 07:06

    this error is because of the name conflicts between the app name and project name.you had given same name for your app and project .your project and app need to be different name .if you had given the same name the above mentioned error will occur .

    understand the difference between app and project

    Projects vs. apps

    What’s the difference between a project and an app? An app is a Web application that does something – e.g., a Weblog system, a database of public records or a simple poll app. A project is a collection of configuration and apps for a particular Web site. A project can contain multiple apps. An app can be in multiple projects.

    first create the project. then create the app.

    NOTE: name for app and project should be different

    first create a project with projectname

     django-admin.py startproject Projectname .
    

    Then create app with appname. (to create your app make sure you are in the same directory manage.py and type this command)

    python manage.py  startapp Appname 
    

提交回复
热议问题