Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django 没有名为comments的模块,我安装了,设置好了一切_Django - Fatal编程技术网

Django 没有名为comments的模块,我安装了,设置好了一切

Django 没有名为comments的模块,我安装了,设置好了一切,django,Django,我尝试了pip install django contrib comments和pip install django comments xtd,但仍然不起作用 INSTALLED_APPS = ( 'suit', 'django.contrib.comments', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contri

我尝试了pip install django contrib comments和pip install django comments xtd,但仍然不起作用

INSTALLED_APPS = (
    'suit',
    'django.contrib.comments',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
    'main',
    'accounts',

    #3rd party apps
    'django_forms_bootstrap',
    'guardian',
    'easy_thumbnails',
    'userena',
    'django_comments_xtd',

)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'rclone.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join (BASE_DIR,'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'rclone.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'

SUIT_CONFIG = {
    'ADMIN_NAME': 'Hello'

}


AUTHENTICATION_BACKENDS = (
    'userena.backends.UserenaAuthenticationBackend',
    'guardian.backends.ObjectPermissionBackend',
    'django.contrib.auth.backends.ModelBackend',
)

ANONYMOUS_USER_ID = -1  

AUTH_PROFILE_MODULE = 'accounts.MyProfile'  


USERENA_SIGNIN_REDIRECT_URL = '/accounts/%(username)s/'
LOGIN_URL = '/accounts/signin/'
LOGOUT_URL = '/accounts/signout/'

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = zzzz
EMAIL_HOST_PASSWORD = zzzzz

SITE_ID = 1

COMMENTS_APP = "django_comments_xtd"
COMMENTS_XTD_CONFIRM_EMAIL = True

我不确定我做错了什么,我按照医生的指示做了。我复制了框架,当我准备放置python manage.py syncdb时,没有显示名为comments的模块

除此之外还有很多设置。如果您可以运行服务器,则程序包正在加载。您需要添加URL和模板以使其正常工作。您可以在阅读更多信息。

django.contrib.comments已从django core中删除,因此此模块不再存在。您还需要将其从安装的应用程序中删除

INSTALLED_APPS = (
    'suit',
    'django.contrib.comments',  # remove this

您忘记在已安装的应用程序中添加“django_注释”。这两者都是
'django\u comments\u xtd'
所必需的。希望对您有所帮助

我发现了这个,我不明白:您在
python manage.py migrate
之前是否执行了
python manage.py migrate
?是的,但仍然显示相同的错误