大家好。 这是我第一次在StackOverflow上寻求帮助,因此,如果我的问题足够清楚,请原谅我。我很乐意提供您要求我提供的任何信息,以便对这个问题有更好的了解
我有一个Django项目,它没有从在我的设置中注册的应用程序导入模型。
直到2天前,该应用程序一直运行良好,但我尚未对模型进行任何更改。
我已经尝试了很多方法来解决此问题,但仍然给我同样的错误... 我无法导入任何我的应用程序中来自模型的任何信息...
这非常令人沮丧。请提供一些建议
INSTALLED_APPS = (
# Django Applications
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.sitemaps',
# 'satchmo_store.shop',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.staticfiles',
'django.contrib.messages',
'django_comments',
'django.contrib.humanize',
# Reorder admin apps
'admin_reorder',
# Third Party Django Applications
## 'django_extensions',
'photologue',
'sorl.thumbnail',
'filebrowser',
'widget_tweaks',
'snowpenguin.django.recaptcha2',
'tinymce',
'django_extensions',
'model_utils',
'cart',
'anymail',
'rest_framework',
'storages',
# 'django_s3_storage',
'my_project.libs.chunks',
'my_project.apps.definition',
'my_project.apps.makeaword',
'my_project.apps.tellinstories',
'my_project.apps.wordsearch',
'my_project.libs.payflowpro',
# Project Applications
'my_project.apps.accounts',
'my_project.apps.book',
'my_project.apps.general',
'my_project.apps.illustrate',
'my_project.apps.write',
'my_project.apps.pressroom',
'my_project.apps.images',
'my_project.apps.comic',
'my_project.apps.library',
'my_project.apps.reports',
'my_project.apps.orders',
'my_project.apps.gift_cards',
'my_project.apps.stationary',
'my_project.apps.invoices',
'my_project.apps.cart_itt',
)
答案 0 :(得分:2)
导入方式:
from general.models import GiftCardOrders