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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:31:34+00:00 2026-06-17T10:31:34+00:00

I’m trying to set up a simple website using Flask, wsgi, and apache2. I’m

  • 0

I’m trying to set up a simple website using Flask, wsgi, and apache2. I’m getting the following error trying to import from site.py into site.wsgi:

[Fri Jan 11 16:42:20 2013] [error] [client 174.48.34.188] mod_wsgi (pid=15170): Target WSGI script '/home/www/site/site.wsgi' cannot be loaded as Python module.
[Fri Jan 11 16:42:20 2013] [error] [client 174.48.34.188] mod_wsgi (pid=15170): Exception occurred processing WSGI script '/home/www/site/site.wsgi'.
[Fri Jan 11 16:42:20 2013] [error] [client 174.48.34.188] Traceback (most recent call last):
[Fri Jan 11 16:42:20 2013] [error] [client 174.48.34.188]   File "/home/www/site/site.wsgi", line 1, in <module>
[Fri Jan 11 16:42:20 2013] [error] [client 174.48.34.188]     from site import app as application
[Fri Jan 11 16:42:20 2013] [error] [client 174.48.34.188] ImportError: cannot import name app

Here is my site.py:

from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def home_page():
    return render_template('index.html')

app.debug = True
if __name__ == '__main__'
    app.run()

Here is my site.wsgi:

from site import app as application

And here is my apache config:

<VirtualHost *:80>
    ServerAdmin my@email.here
    ServerName mywebsite.here
    DocumentRoot /home/www/site

    WSGIDaemonProcess site user=${APACHE_RUN_USER} group=${APACHE_RUN_GROUP} threads=5
    WSGIScriptAlias / /home/www/site/site.wsgi

    <Directory /home/www/site>
        WSGIProcessGroup site
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptReloading On
        Order deny,allow
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>

I’ve searched around for a while trying to figure this out but I’m stumped. I’m also fairly new to web design, so it could be something silly. Thanks in advance.

  • 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-17T10:31:35+00:00Added an answer on June 17, 2026 at 10:31 am

    Found the answer – as Audrius said in the comments, it was a conflict because I named the file site.py. I changed it to mysite.py everywhere necessary and added the following to mysite.wsgi (formerly site.wsgi):

    import sys
    sys.path.insert(0, '/home/www/mysite.wsgi')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm making a simple page using Google Maps API 3. My first. One marker
I am using jsonparser to parse data and images obtained from json response. When
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
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.