Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:31:25+00:00 2026-06-06T17:31:25+00:00

I am using a post to get a parameter based on a radio button

  • 0

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 %}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:31:26+00:00Added an answer on June 6, 2026 at 5:31 pm

    From your question i understand that user is not logged-in, in this case try the following:

    def post(self):     
      category = self.request.get('category')      
      if category:         
        user = users.get_current_user()         
        if 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) 
        else:
          self.redirect(users.create_login_url(self.request.uri)) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the post and get methods for Ajax calls, and have a
I'm using the Post/Redirect/Get pattern on a form of mine. I've never used this
How to send an http request with either post/get method using javascript as an
Using Basic Authentication, and the asp.net Web-Api, where JSON Get/Post's to my API, I
i'm using div content editable html to get value from input keyboard to post
I'm stuck trying to get a WinInet HTTP POST via SSL using ONLY C.
I am using jQuery to do an AJAX POST, but get a CSRF error.
I have been reading up on using webrequests and post and get methods to
So I setup C# parameter validation using the method described in this blog post.
I'm using simple_html_dom.php to get all images from an url (like pinterest does) if($_POST['submit'])

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.