See anything wrong with my attempt to get Flask running? (mod_wsgi + virtualenv)

前端 未结 2 1803
陌清茗
陌清茗 2021-02-02 00:45

I have a VPS running a fresh install of Ubuntu 10.04 LTS. I\'m trying to set up a live application using the Flask microframework, but it\'s giving me trouble. I took notes whil

相关标签:
2条回答
  • 2021-02-02 01:06

    Edit line sys.path.append, it needs to be a string.

    import sys
    sys.path.append('directory/where/package/is/located')
    

    Notice the single quotes.

    0 讨论(0)
  • 2021-02-02 01:08

    Obviously, it cannot find your "myapp" package. You should add it to the path in your myapp.wsgi file like this:

    import sys
    sys.path.append(DIRECTORY_WHERE_YOUR_PACKAGE_IS_LOCATED)
    from myapp import app
    

    Also, if myapp module is a package, you should put and empty __init__.py file into its directory.

    0 讨论(0)
提交回复
热议问题