【问题标题】:django-registration-redux is not workingdjango-registration-redux 不工作
【发布时间】:2016-04-12 12:31:01
【问题描述】:

django-registration-redux 不工作。我已将我的设置更改为以下并运行python manage.py migrate。我不知道为什么它没有对数据库做任何事情,这是 Page not found 错误中建议的内容?

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',  # manually added
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # third party apps
    'crispy_forms',
    'registration',  # django-registration-redux
    #  my apps
        'newsletter',
    )

# Django-registration-redux settings
ACCOUNT_ACTIVATION_DAYS = 7
REGISTRATION_AUTO_LOGIN = True

【问题讨论】:

  • 你在urls.py中添加url(r'^accounts/', include('registration.backends.default.urls')),吗?
  • 没有这个,它不会识别账户/东西,所以是的,这已经完成了!
  • 你是对的,测试 url http://127.0.0.1:8000/accounts/ 测试 url http://127.0.0.1:8000/accounts/login/ 并检查是否有错误。 /accounts/ 是 api 根
  • http://127.0.0.1:8000/accounts/login/ 给出了一个不同的错误,它根本不会出现在 ^accounts/ DoesNotExist at /accounts/login/
  • 是你手动添加的行'django.contrib.sites',你应该添加settings.pySITE_ID = 1。阅读更多stackoverflow.com/questions/25468676/…

标签: python django


【解决方案1】:

我只是想如果有人遇到同样的问题,我会发布我的问题的解决方案。如果您的模板没有存储在一个文件夹中,则模板base.html 需要引用到正确的文件夹,因此它变为{% extends "folder/base.html" %}registration 文件夹中有几个 html 文件,其中 base.html 需要重新引用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-01
    • 2015-02-24
    • 1970-01-01
    • 1970-01-01
    • 2016-07-06
    • 1970-01-01
    • 2011-12-09
    • 2015-08-29
    相关资源
    最近更新 更多