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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:58:33+00:00 2026-06-04T06:58:33+00:00

I’m building a web service using Flask and I’m trying to deploy a simple

  • 0

I’m building a web service using Flask and I’m trying to deploy a simple “Hello, World” app using Paster. I’m having trouble get everything configured to work together though. I’ve seen the Google hit about running Flask with paste using virtualenv and zcbuildout, but that seems like it’s overkill for a pretty basic application. Right now, when I try to load a URL with my app, I get this error:

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/paste/httpserver.py", line 1068, in process_request_in_thread
  self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
  self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 639, in __init__
  self.handle()
File "/usr/lib/python2.7/dist-packages/paste/httpserver.py", line 442, in handle
  BaseHTTPRequestHandler.handle(self)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 343, in handle
  self.handle_one_request()
File "/usr/lib/python2.7/dist-packages/paste/httpserver.py", line 437, in handle_one_request
  self.wsgi_execute()
File "/usr/lib/python2.7/dist-packages/paste/httpserver.py", line 287, in wsgi_execute
  self.wsgi_start_response)
AttributeError: GraffitiApp instance has no __call__ method

My application configuration looks like:

[DEFAULT]
loglevel = WARN
browser_cache_ttl = 30

[app:main]
use = egg:GraffitiService

[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = %(graffiti_port)s

My application code looks like:

from flask import Flask

app = Flask(__name__)
app.debug = True

class GraffitiApp:

    @app.route('/')
    def hello_world():
        return "Hello World!"

    @app.route('/other')
    def other_page():
        return "Other page!"

    def main():
        app.run(debug = True)

if __name__ == "__main__":
    app.run(debug = True)

Do I need to create a __call__() method and map whatever URL was passed to the appropriate function, or is there a change I need to make to my configuration?

EDIT

I’m using a factory named main.py as a result of errors I was getting about not finding an entry point named “main”:

import logging

from graffiti import GraffitiApp

def make_app(globalArgs, **localArgs):
    loglevelname = globalArgs.get("loglevel", "INFO").lower()

    if loglevelname == 'critical':
        loglevel = logging.CRITICAL
    elif loglevelname == 'debug':
        loglevel = logging.DEBUG
    elif loglevelname == 'error':
        loglevel = logging.ERROR
    elif loglevelname == 'fatal':
        loglevel = logging.FATAL
    elif loglevelname == 'info':
        loglevel = logging.INFO
    elif loglevelname == 'warn' or loglevelname == 'warning':
        loglevel = logging.WARN
    else:
        loglevel = logging.NOTSET
        loglevelname = 'notset'

    FORMAT = "%(asctime)s %(name)s %(levelname)s %(message)s"
    logging.basicConfig(format = FORMAT, level = loglevel)
    logging.info("Log level set to %s" % (loglevelname.upper()))

    return GraffitiApp()
  • 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-04T06:58:34+00:00Added an answer on June 4, 2026 at 6:58 am

    It looks like the server is trying to run your GraffitiApp() class when it should run the Flask() instance app.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

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.