Flask路由在生产服务器上抛出404

时间:2016-03-28 08:18:39

标签: python flask

在我的生产服务器上,当我尝试访问www.example.com/admin时,我的烧瓶应用程序抛出404但是,如果我尝试访问root内容,一切正常。我使用apache为我的web服务器使用python 3.4

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

. python functions in between
.
.
.


@app.route("/admin")
def admin():
    return render_template("adminAuth.html", error=False)

@app.route("/admin", methods=["POST"])
def adminAuth():
    # Intentionally return None
    return None

备注:在我的测试环境中,(PyCharm with Flask)一切正常,我可以访问/ admin

这是我的WSGI conf

<VirtualHost *:80>
    ServerName NAME
    ServerAdmin admin@mywebsite.com
    WSGIScriptAlias / /path/to/app.wsgi
    <Directory /path/to/webapp/>
        Order allow,deny
        Allow from all
    </Directory>
    Alias /static /path/to/webapp/static
    <Directory /path/to/webapp/static/>
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/path/to/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/path/to/access.log combined
</VirtualHost>

0 个答案:

没有答案