I have this code in my app view
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
@login_required(login_url="login/")
def home(request):
return render(request, "home.html")
Here also is my project url
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('log.urls')),
url(r'^login/$', views.login, {'template_name': 'login.html'}),
url(r'^logout/$', views.logout, {'next_page': '/login'}),
]
So i have the templates folder in my project root url and i have also
configured TEMPLATES DIR in my settings.py
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
......
......
......
],
},
},
However, when i try to access my homepage,i expect it to render my custom
login page(login.html). But it always say TemplateDoesNotExist.
I also tried putting the template folder inside an app. But the login page
doesnt get rendered still.
I need help urgently.Thanks!!!!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/44041d5a-5969-4397-91e1-ba245f68339c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.