Import a Python module when using WSGI
Question: I just installed WSGI on Apache to start using Python as a web programming
language. I only added this line to my Apache config (except for the loading
of the `mod_wsgi` module)

    
    
    WSGIScriptAlias MyApp/ /path/to/app.wsgi
    

I have my `app.wsgi` running fine, but I want to use separate files for
separate functionality. So, I created an `extras.py` in the same dir as
`app.wsgi`, with not much in it:

    
    
    class MyClass:
         pass
    

and put a

    
    
    from extras import MyClass
    

on the top of my `app.wsgi`. But, unfortunately, I get this error:

    
    
    ImportError: cannot import name MyClass
    

Am I missing something?


Answer: use the `WSGIPythonPath` to specify the modules which are to be searched while
running ur wsgi application.

more about it could be found
[here](https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonPath
"mod_wsgi")

