We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f0ec6c commit 3b884d1Copy full SHA for 3b884d1
articles/views.py
@@ -1,3 +1,4 @@
1
+from django.contrib.auth.decorators import login_required
2
from django.shortcuts import render
3
4
from .models import Article
@@ -20,6 +21,7 @@ def article_search_view(request):
20
21
}
22
return render(request, "articles/search.html", context=context)
23
24
+@login_required
25
def article_create_view(request):
26
# print(request.POST)
27
context = {}
trydjango/settings.py
@@ -53,6 +53,7 @@
53
]
54
55
ROOT_URLCONF = 'trydjango.urls'
56
+LOGIN_URL='/login/'
57
58
TEMPLATES = [
59
{
0 commit comments