Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def subscribe(request):
- if request.method == 'GET':
- context = {
- 'where': request.path
- }
- resp = render(request, 'templates/articles/subscribe_form.html', context)
- return resp
- elif request.method == 'POST':
- author = request.POST['author']
- user_email = request.POST['email']
- author_articles = []
- for article in articles_list:
- if author == article[1]:
- author_articles.append(article)
- context = {
- 'author': author,
- 'email': user_email,
- 'articles': generate_html(author_articles)
- }
- return render(request, 'templates/articles/subscribe.html', context)
Advertisement
Add Comment
Please, Sign In to add comment