Django 1.9 can not find newapp

后端 未结 2 2031
轮回少年
轮回少年 2021-01-28 02:09

I have worked with django 1.7 and recently started new project with django 1.9. The major difference with starting a new app was that new app is created with apps.py file. I rea

2条回答
  •  悲哀的现实
    2021-01-28 02:42

    If your apps directory is in the myapps directory, then check the following:

    1. Your myapps directory should have an __init__.py

    2. Include myapps in the path when you include the app in INSTALLED_APPS, i.e. 'myapps.newapp.apps.NewAppConfig',

    3. Include myapps in the app config's name attribute:

      class NewAppConfig(AppConfig):
          name = 'myapps.newapp'
      

提交回复
热议问题