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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:03:17+00:00 2026-05-16T20:03:17+00:00

I am having an issue deploying a flask app on apache2 using wsgi. I

  • 0

I am having an issue deploying a flask app on apache2 using wsgi. I have posted the error logs and config files below. I have tried moving things around, renaming them, etc, but all give me an internal server error. Not sure why I’m getting the import error. Any input / suggestions are appreciated, thanks!

Here is my apache error.log

[Sun Sep 12 20:47:59 2010] [error] [client] mod_wsgi (pid=9753): Target WSGI script '/sites/flaskfirst/wsgi.py' cannot be loaded as Python module.
[Sun Sep 12 20:47:59 2010] [error] [client] mod_wsgi (pid=9753): Exception occurred processing WSGI script '/sites/flaskfirst/wsgi.py'.
[Sun Sep 12 20:47:59 2010] [error] [client] Traceback (most recent call last):
[Sun Sep 12 20:47:59 2010] [error] [client]   File "/sites/flaskfirst/wsgi.py", line 1, in <module>
[Sun Sep 12 20:47:59 2010] [error] [client]     from app import app as application
[Sun Sep 12 20:47:59 2010] [error] [client] ImportError: No module named app

wsgi.py

# This is wsgi.py
from app import app as application

app.py

# This is app.py
from flask import Flask, render_template
import settings

app = Flask(__name__)
app.debug = settings.DEBUG

from views.homepage import *
from views.events import *
from views.submit import *
from views.feed import *

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

Here is the basics of the directory tree, to give you an idea.

/flaskfirst/
    /static/
    /templates/
    /views/
    __init__.py
    app.py
    wsgi.py

Here is the apache virtualhost file

<VirtualHost *:80>
        ServerAdmin sreustle@gmail.com
        ServerName crath.org
        DocumentRoot /sites/flaskfirst

        # WSGI Settings
        WSGIScriptAlias / /sites/flaskfirst/wsgi.py
        WSGIDaemonProcess flaskfirst user=sreustle group=general processes=1 threads=10
        WSGIProcessGroup flaskfirst

        # Static Directories
        Alias /static /sites/flaskfirst/static/
        <Location "/static">
                SetHandler None
        </Location>

</VirtualHost>
  • 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-16T20:03:18+00:00Added an answer on May 16, 2026 at 8:03 pm

    Thanks to zarf and damjan on irc.freenode.org at #pocoo, they were able to help me get this fixed. The problem was the PythonPath was not correct. We fixed this by using the following wsgi.py

    import sys
    sys.path.insert(0, "/sites/flaskfirst")
    
    from app import app
    application = app
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue deploying my Flask app with Apache (mod_wsgi) and gevent on
I'm having an interesting issue when deploying an app to Tomcat. I'm using the
I'm having a performance issue when deploying an app developed on 10g XE in
I am having an issue deploying MVC2 app on Window Server 2003 R2 x64.
Im having a weird compile issue using the Google App engine in java using
Hi guys I am having issue I have this query: SELECT * FROM useraccount
Just started mongo and started having issue with querying already. i have a collection
Having an issue here that I have tried everything I can think of but
So we're having some issues deploying an ASP.NET MVC app to a client site.
When deploying a Rails 3.1 app on JRuby to JBoss, I'm having a jndi/jdbc

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.