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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:35:35+00:00 2026-06-07T04:35:35+00:00

I am a newbie in Python & web.py so excuse my ignorance. I had

  • 0

I am a newbie in Python & web.py so excuse my ignorance. I had a script for a web page that was working, and then randomly stopped working. I’ve been at it for a few days and cant seem to figure the issue out.

I keep getting the following error:

127.0.0.1:49664 – – [05/Jul/2012 23:58:42] “HTTP/1.1 GET /” – 500 Internal Server Error
127.0.0.1:49664 – – [05/Jul/2012 23:58:43] “HTTP/1.1 GET /favicon.ico” – 404 Not Found
Traceback (most recent call last):
File “C:\Python27\lib\site-packages\web\application.py”, line 239, in process return >self.handle()
File “C:\Python27\lib\site-packages\web\application.py”, line 230, in handle return >self._delegate(fn, self.fvars, args)
File “C:\Python27\lib\site-packages\web\application.py”, line 419, in _delegate cls = >fvars[f]
KeyError: u’index’

Here is my Python script:

import web
from web import form
db = web.database(dbn='mysql', user='dbuser', pw='dbuser', db='database')
render = web.template.render('templates/')
urls = (
    '/', 'index',
    '/update/(\d+)', 'update'
)
app = web.application(urls, globals())
myform = form.Form(
    form.Radio('sentiment',[('1','Positive'),('3','Neutral'),('2','Negative'),('4','SPAM')],description='Sentiment',))

def insert_sentiment(id, sentimentvar):
    db.update('tweets', sentiment=sentimentvar, where="tweet_id=$id", vars=locals())

class update:
    def GET(self):
        tweets_index = db.select('tweets', where='sentiment is null', order='RAND()', limit=1)
        form = myform()
        return render.index(form, tweets_index)
        raise web.seeother('/')

    def POST(self, id):
        form = web.input()
        insert_sentiment(id, form.sentiment)
        raise web.seeother('/')

if __name__=="__main__":
    web.internalerror = web.debugerror
    app.run()

The template is stored in a ‘templates’ folder and is as follows:

$def with (form,tweets_index)
$for tweets in tweets_index:
        $tweets.tweet
        $tweets.normalized_tweet
<form action="/update/$tweets.tweet_id" method="post">
    $:form.render()
    <input type="submit" value="update"/>
</form>

If I change the name of the index page to something else, then that is what shows up in the error. Please help!

  • 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-07T04:35:37+00:00Added an answer on June 7, 2026 at 4:35 am

    You don’t have a class index with a GET method

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

Sidebar

Related Questions

A clueless Python newbie needs help. I muddled through creating a simple script that
Python newbie here. I'm writing a script that can dump some output to either
I'm a python newbie and starting out with using the Bottle web framework on
Quick, newbie Python scoping question. How can I make sure that the original variables
python newbie here. I'm writing the code to control an experiment that has multiple
I'm a python newbie so I apologize in advance if this question has been
I'm a newbie to Python and programming in general so please excuse me if
I am a newbie to python programming. I find that decreasing the indentation of
I'm a Python & App Engine (and server-side!) newbie, and I'm trying to create
I'm a newbie to python and the app engine. I have this code that

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.