-1
Modelクラスmodels.Projectが宣言していません。 Windows cmdでmake html
を実行すると、次のエラーが表示されます。 私settings.py
は models.py
ファイルが所属している私が構築されたアプリケーションのためのエントリが含まれています。秘密裏に、ここではproject_nameと呼んでいます。ジャンゴ - スフィンクスはRuntimeError:私はDjangoプロジェクトのスフィンクスとHTMLドキュメントを生成しようとしています
INSTALLED_APPS = [
'project_name.apps.project_nameAppConfig',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'import_export',
'nested_admin',
'report_builder',
'rest_framework',
'ajax_select',
]
エラートレース:あなたの助けのための
> C:\django_project\docs\source\models.rst:4: WARNING: autodoc: failed to
> import module 'models'; the following exception was raised: Traceback
> (most recent call last): File
> "C:\Users\...\AppData\Local\Continuum\Anaconda3\lib\site-packages\sphinx\ext\autodoc.py",
> line 658, in import_object
> __import__(self.modname) File "C:\django_project\project_name\models.py", line 8, in <module>
> class Project(models.Model): File "C:\Users\...\AppData\Local\Continuum\Anaconda3\lib\site-packages\django\db\models\base.py",
> line 118, in __new__
> "INSTALLED_APPS." % (module, name) RuntimeError: Model class models.Project doesn't declare an explicit app_label and isn't in an
> application in INSTALLED_APPS.
ありがとう!
まあ、それはINSTALLED_APPSにありますか? –
編集した回答を見てください –