<div dir="ltr"><div class="gmail_quote"><div dir="ltr">I am trying to deploy a simple test app on a Raspberry Pi by following the instructions at <a href="http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/" target="_blank">http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/</a>.<div><br></div><div>I need help in what should be in the <i>yourapplication.wsgi</i> file. Does this file contain Python code?</div><div><br></div><div>My project folder is /Z/flask and it runs fine in the development server, ie <a href="http://localhost:5000" target="_blank">http://localhost:5000</a>.</div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font color="#990000"><br></font></div></blockquote><font color="#000000"><b>/Z/flask/app.py</b> contains:</font><br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font color="#990000"><br></font></div><div><div><font color="#990000">#!/usr/bin/python3</font></div></div><div><div><font color="#990000">from flask import Flask, jsonify, session, g, render_template</font></div></div><div><div><font color="#990000"><br></font></div></div><div><div><font color="#990000">app = Flask(__name__)</font></div></div><div><div><font color="#990000"><br></font></div></div><div><div><font color="#990000">from views import general</font></div></div><div><div><font color="#990000">app.register_blueprint(general.mod)</font></div></div><div><div><font color="#990000"><br></font></div></div><div><div><font color="#990000">if __name__ == '__main__':</font></div></div><div><div><font color="#990000">    app.run(host='0.0.0.0',debug=True)</font></div></div></blockquote></div><div><br></div><div><b>/Z/flask/views/general.py</b> contains:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font color="#990000">from flask import Blueprint, render_template, session, redirect, url_for, \</font></div></div><div><div><font color="#990000">      request, flash, g, jsonify, abort</font></div></div><div><div><font color="#990000"><br></font></div></div><div><div><font color="#990000">mod = Blueprint('general', __name__)</font></div></div><div><div><font color="#990000"><br></font></div></div><div><div><font color="#990000">@mod.route('/')</font></div></div><div><div><font color="#990000">def index():</font></div></div><div><div><font color="#990000">   return "<h1>Who are you?</h1>"</font></div></div><div><div><font color="#990000"><br></font></div></div><div><div><font color="#990000">@mod.route('/test')</font></div></div><div><div><font color="#990000">def text():</font></div></div><div><div><font color="#990000">   return "<h1>Testing...</h1>"</font></div></div></blockquote><div><br></div><div><br></div><div><b>/Z/flask/views/__init__.py</b> is an empty file</div><div><br></div><div>What should be in <i>yourapplication.wsgi</i>?  Also, what does this paragraph in that documentation page mean:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font color="#990000">"If you don’t have a factory function for application creation but a singleton instance you can directly import that one as <cite>application</cite>."</font></div></blockquote><div><br></div><div>The folder /Z/flask is owned by user <b>pi</b>.  I think apache2 runs using user <b>www-data</b>.</div><div><br></div><div>Thanks.</div><div><br></div></div>
</div><br></div>