the view of  app 

from django.shortcuts import render
from .models import Article
from django.contrib.auth.decorators import login_required
# Create your views here.
def index(request):
    articles = Article.objects.all()
    return  render(request,'app/index.html',{'articles':articles})



def detail(request,slug):
    articles = Article.objects.get(slug=slug)
    return render(request, 'app/detail.html', {'articles':articles})



@login_required
def create_article(request):
    return render(request,'app/create.html')






the settings of login

LOGIN_REDIRECT_URL = '/app/index/'
LOGIN_URL = '/accounts/login/?next=/'



-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/a169e289-8fa7-4bb2-971e-c75b4978474b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to