Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check_age(request):
- if request.method == 'GET':
- user_age = request.GET['age']
- if user_age < 18:
- return render(request, 'templates/articles/access_denied.html', context)
- else:
- login = request.GET['login'] # сюда значение login из запроса
- tag = request.GET['tag'] # сюда значение tag из запроса
- articles = get_articles_by_tag(tag)
- context = {
- 'username' : login,
- 'age' : user_age,
- 'articles' : tag
- return render(request, 'templates/articles/access_granted.html', context)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement