registration
フォルダ内のテンプレートが使用されていることを確認する方法を教えてください。私が持っている問題は - /accounts/
リンクは正常に動作していますが、別のテキスト(registration
フォルダにあるテキストではありません)と異なるテキストがどこから来ているのか分かりません。例えば、これは私が持っているものです:django登録reduxテンプレートが使用されていません
{% extends "newsletter/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block content %}
<div class='row'>
<div class='col-sm-6 col-sm-offset-3'>
<h1>Register for free!</h1>
<form method="post" action=".">
{% csrf_token %}
{{ form|crispy }}
<input class='btn btn-block btn-primary' type="submit" value="{% trans 'Join' %}" />
</form>
</div>
</div>
<hr/>
<div class='row'>
<div class='col-sm-6 col-sm-offset-3 text-align-center'>
<p>Need to <a href="{% url 'auth_login' %}">Login</a>?</p>
</div>
</div>
{% endblock %}
しかし、http://127.0.0.1:8000/accounts/register/と入力すると、次の意味が得られます。registration_form.html
はまったく使用されていません。
あなたが見ることができるように、それは私が持っているものとは全く異なるテキストです。どのようにdjango登録reduxをカスタマイズするためにどのような考えが評価されるだろうか?ちなみに、registration
フォルダをnewsletter
フォルダ(templates
フォルダ)に持ってきてみましたが、助けてくれませんでした。現在、私はテンプレートファイルにアクセスしています。 newsletter/base.html
であり、何も問題はありませんでした。
私のプロジェクトフォルダは、次のようになります。
[projectname]/ <- project root
├── [projectname]/ <- Django root
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── newsletter/ <-app
│ └── templates/
│ └──newsletter\ <-newsletter template
│ └──registration\ <-django-registration-redux template
│ └──registration_form.html
│ └── other django_registration-redux files
├── manage.py
├── static/
settings.py
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',
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'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',
],
},
},
]
# Django-registration-redux settings
ACCOUNT_ACTIVATION_DAYS = 7
REGISTRATION_AUTO_LOGIN = True
SITE_ID = 1
LOGIN_REDIRECT_URL = '/'
あなたは[デバッグツールバー](https://github.com/django-debug-toolbar/django-debug-toolbar)便利を見つけるかもしれない - それはあなたのレンダリングに使用するテンプレートを伝えるパネルを持っていますページ。 – Alasdair
私は 'http://127.0.0.1:8000/accounts/asdf'を試しましたが、私が知る限り期待されるいくつかのURLが表示されていますが、どのようにこれらのURLがどこから読み込まれているか知ることができます。 '[name = 'auth_login']'、これは '' auth_login'ですか?絶対に必死になって – Curtis
私はあなたが '/ accounts /'に使われたテンプレートを知りたいと思ったので、なぜ '/ accounts/asdf'をテストしていますか?あなたがしようとしていることは本当に明確ではありません。あなたの質問を編集し、さらに情報を追加してください。 – Alasdair