I am using a post to get a parameter based on a radio button that a user selects and then submits and the correct operation happens but then below the page an entire new page comes up that the user is not logged into. I am not quite sure what is happening but here is the applicable code and I am using HTML of course plus google appengine with python and jinja2.
HTML here:
<form method="POST">
<input type="radio" name="category" value="discussion">Discussion<br>
<input type="radio" name="category" value="adventures">Adventures<br>
<input type="radio" name="category" value="reviews">Reviews<br>
<input type="radio" name="category" value="badges">Badge Applications<br>
<input type="submit" class="btn btn-medium btn-primary" value="Filter!">
</form>
python here:
def post(self):
category = self.request.get('category')
if category:
user = users.get_current_user()
logout = users.create_logout_url(self.request.uri)
global visits
category = self.request.get('category')
posts = db.GqlQuery("select * from Post where category=:1 order by created desc limit 30", category)
self.render("home.html", posts=posts, user=user, visits=visits, logout=logout)
my home.html doc:
{% for post in posts %}
{{post.render() | safe}}
<br>
{% endfor %}
From your question i understand that user is not logged-in, in this case try the following: