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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:59:42+00:00 2026-05-23T23:59:42+00:00

I have web.py configured for my Apache server by installing flups. However when I

  • 0

I have web.py configured for my Apache server by installing flups. However when I go to my application, the html code is printed instead of the html page. (See below).

Content-Type: text/html

<HTML><HEAD><TITLE>Login Details</TITLE></HEAD><BODY>.......</BODY></HTML>

I created another file Test.py in the same directory with the following code

#!/usr/bin/python
print "Content-Type: text/html\n\n"
print "<html><head></head><body>Present</body></html>"

This prints out the page fine. Both the files have the same executable permissions.(chmod 755).

Any ideas why this is happening?

Update: Just found out. If I change the return statement to a print inside the GET method for my app, it prints out the form fine, but also prints out the cookie, session id, etc.. at the end. What do I need to configure to make the return work as expected?

Adding a sample code which would cause the issue:

#!/usr/bin/python
import web
urls = ("/CodeAnalyzer", "CodeAnalyzer")
app = web.application(urls, globals())

class CodeAnalyzer:
    def GET(self):
        init="Content-Type: text/html\n\n"
        form="<html><head></head><body>Hello World</body><html>"
        return init+form

if __name__ == "__main__":
    app.run()
  • 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-05-23T23:59:43+00:00Added an answer on May 23, 2026 at 11:59 pm

    The issue was in the line
    init="Content-Type: text/html\n\n"
    That was the incorrect way to pass the header in web.py. The issue was resolved after replacing it with
    web.header('Content-Type','text/html; charset=utf-8', unique=True)

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

Sidebar

Related Questions

I have a web server (Apache) and configured a CA on this machine to
I have an ASP.NET web application that is using forms authentication. Everything is configured
In the web.xml of my web app I have configured the server as following:
I have URLs of the form http://domain/image/⟨uuid⟩/42x42/some_name.png . The Web server (nginx) is configured
I've built a vagrant/virtualbox web server as a development sandbox, and configured apache in
I have installed Apache Axis2 1.6.1 in a Jetty 8.0.4 web server, but JSON
I have apache web server installed as frontend and I have j2ee SAP Netweaver
I have Apache Web Server on my Host Machine and also on my Virtual
I have an Eclipse Dynamic Web Project and a Tomcat server configured in Eclipse
I have configured my Web.Config file as follow in a ASP.NET MVC 2 project:

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.