djangoを使ってwebアプリケーションを作ろうとしていて、ログイン機能を作っています。
ログイン処理実装にて参考にしたサイト:https://intellectual-curiosity.tokyo/2018/11/13/django%E3%81%AE%E3%83%AD%E3%82%B0%E3%82%A4%E3%83%B3%E5%87%A6%E7%90%86%E3%82%92%E5%AE%9F%E8%A3%85%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E2%91%A0/
実際に http://127.0.0.1:8000/accounts/login/ でリロードした際に、templatedoesnotexistのエラーが出ます。そもそもregistrationという記述はないのですが、どうしてこのようなエラーが出るのでしょうか。
発生している問題・エラーメッセージ
Internal Server Error: /accounts/login/ Traceback (most recent call last): File "/Users/nishikawakyo/opt/anaconda3/envs/locket/lib/python3.7/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/Users/nishikawakyo/opt/anaconda3/envs/locket/lib/python3.7/site-packages/django/core/handlers/base.py", line 217, in _get_response response = self.process_exception_by_middleware(e, request) File "/Users/nishikawakyo/opt/anaconda3/envs/locket/lib/python3.7/site-packages/django/core/handlers/base.py", line 215, in _get_response response = response.render() File "/Users/nishikawakyo/opt/anaconda3/envs/locket/lib/python3.7/site-packages/django/template/response.py", line 107, in render self.content = self.rendered_content File "/Users/nishikawakyo/opt/anaconda3/envs/locket/lib/python3.7/site-packages/django/template/response.py", line 82, in rendered_content template = self.resolve_template(self.template_name) File "/Users/nishikawakyo/opt/anaconda3/envs/locket/lib/python3.7/site-packages/django/template/response.py", line 64, in resolve_template return select_template(template, using=self.using) File "/Users/nishikawakyo/opt/anaconda3/envs/locket/lib/python3.7/site-packages/django/template/loader.py", line 53, in select_template raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain) django.template.exceptions.TemplateDoesNotExist: registration/login.html
該当のソースコード settings.py!
"""myblogapp URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import include, url from django.contrib import admin from django.conf.urls.static import static from django.conf import settings from posts import views urlpatterns = [ url(r'^posts/', include('posts.urls.index_urls')), url(r'^posts/(?P<post_id>[0-9]+)/$', views.post_detail, name='post_detail'), url(r'^admin/', admin.site.urls), url(r'^about/', include("posts.urls.index_urls")), url(r'^geo/', include("posts.urls.geo_urls")), url(r'^accounts/', include("django.contrib.auth.urls")),#変更箇所 # url(r'^accounts/', include("posts.urls")), # url(r'^post_new_post', views.post_new_post), # url(r'^login', views.login_user), # url(r'^registration', views.registation_user), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
試したこと
settings.pyのos.path.join()~の箇所を再チェック
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。