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 8439325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:58:50+00:00 2026-06-10T07:58:50+00:00

I seem to get this error when the application is deployed, however not when

  • 0

I seem to get this error when the application is deployed, however not when it is being served on localhost:

E 2012-08-21 18:03:46.914 HTTP Error 400: Bad Request Traceback (most recent call last): File "/base/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py

E 2012-08-21 18:03:46.916 Traceback (most recent call last): File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 195, in Handle

The code that is generating this error is located here (please forgive the huge handler):

class Dashboard(MainHandler):

def check_if_live(self,b):
    url = ('http://api.justin.tv/api/stream/list.json?channel=%s' %b)
    contents = urllib2.urlopen(url)
    if contents.read() == '[]':
        return 'Offline'
    else:
        return 'Live'

def get(self, profile_id):
    u = User.by_name(profile_id.lower())
    if not u:
        self.redirect('/')
    elif self.user.name != profile_id:
        self.redirect('/profile/%s' %self.user.name)
    elif self.user and profile_id:
        current_user = self.user.name
        name1 = ''
        friend_name = ''
        team_imagee = ''
        key = ''
        monthss = ''
        yearss = ''
        dayss = ''
        countryss = ''
        team_imagee2 = ''
        imgs2 = ''
        imgs = ''
        key2 = ''
        name22 = ''
        name2 = ''
        streamss = ''
        streams_title = ''
        imgs  = db.GqlQuery("select * from Profile_Images WHERE name =:1", profile_id)
        imgs2  = db.GqlQuery("select * from Profile_Images WHERE name =:1", current_user)
        team_name  = db.GqlQuery("select * from Teams WHERE name =:1", profile_id)
        team_images  = db.GqlQuery("select * from Teamimg WHERE user =:1", profile_id)
        team_images2  = db.GqlQuery("select * from Teamimg WHERE user =:1", current_user)
        friends  = db.GqlQuery("select * from Friends WHERE name =:1 order by added_date desc limit 10", profile_id)
        posts = db.GqlQuery("select * from Profile_Comments WHERE name_of_profile =:1 order by date_created desc", profile_id)
        name2 = db.GqlQuery("select * from User WHERE name =:1", profile_id)
        month = db.GqlQuery("select * from User WHERE name =:1", profile_id)
        day = db.GqlQuery("select * from User WHERE name =:1", profile_id)
        year = db.GqlQuery("select * from User WHERE name =:1", profile_id)
        country = db.GqlQuery("select * from User WHERE name =:1", profile_id)
        streams = db.GqlQuery("select * from Streams WHERE username =:1", current_user)
        for stream_title in streams:
            streams_title = stream_title.stream_title
        for stream in streams:
            streamss = stream.stream
        for months in month:
            monthss = months.month
        for countrys in country:
            countryss = countrys.country
        for days in day:
            dayss = days.day
        for years in year:
            yearss = years.year
        for clan in team_name:
                name1 = clan.team_name_anycase
        for clan in team_name:
                name2 = clan.team_name
        for image in team_images:
            team_imagee = image.key()
        for image2 in team_images2:
            team_imagee2 = image2.key()
        for img in imgs:
            key = img.key()
        for img2 in imgs2:
            key2 = img2.key()
        streamm = (streamss[(streamss.find('.tv/')+ 4):])
        check_if_life2 = self.check_if_live((streamss[(streamss.find('.tv/')+ 4):]))
        self.render('dashboard.html', streams = streams, stream_title2 = streamm, stream_title = streams_title, check_if_life = check_if_life2, team_name2 = name2,  imgs = imgs, team_img2 = team_imagee2, profile_image_posted = key2, posts = posts, profile_id = profile_id, country_var = countryss, day_var = dayss, year_var = yearss, month_var = monthss, current_user = current_user, friends = friends, team_img = team_imagee, team_name = name1, profile_image = key, username = self.user.name, email = self.user.email, firstname = self.user.first_name, last_name = self.user.last_name, country = self.user.country)
    else:
        self.redirect('/register')

This is specifically what is causing it:

    streamm = (streamss[(streamss.find('.tv/')+ 4):])
    check_if_life2 = self.check_if_live((streamss[(streamss.find('.tv/')+ 4):]))

Which makes use of the function ‘check_if_live’ at the top. As a total python noob, I can’t for the life of me figure out why this error is being generated live and not on localhost.

EDIT:

I still cannot get the API to work. Its interesting how if you call the API in the address bar, for instances http://api.justin.tv/api/stream/list.json?channel=nasltv, it works fine. But as soon as it touches app engine, it fails. I just need to index this API! Ah!

  • 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-10T07:58:52+00:00Added an answer on June 10, 2026 at 7:58 am

    Is there authentication involved in the API you are calling? Maybe there is a redirection that stes a cookie. IIRC the redirect behavior differs between prod and dev.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can't seem to get this jquery gallery working. I've been able to get the
I can't seem to get this text to align vertically. Can someone please tell
I never seem to get this right. I've got a method that returns a
I can't seem to get this working, what should happen is when the user
I cannot seem to get this date picker working at all. I know it
can't seem to get this parser to work for google maps, I think its
Revising for php and cant seem to get this to print the values out
I recently started with PHP Object Oriented and I cannot seem to get this
I've never been good with regex and I can't seem to get this... I
Pretty much the same as this question. But I can't seem to get this

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.