Apache2 ve Wsgi modülü ile Flask projenizi yayınlamak için örnek Apache ayar dosyası
sudo -H pip install flask
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Merhaba"
if __name__ == "__main__":
app.run()
DocumentRoot "/home/muslu/flask/"
ServerAdmin musluyuksektepe@gmail.com
WSGIDaemonProcess flasktest threads=5 python-path=/usr/local/lib/python3.6/dist-packages/:/home/muslu/flask/
WSGIScriptAlias / /home/muslu/flask/flasktest.wsgi
<Directory "/home/muslu/flask">
WSGIProcessGroup flasktest
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Order deny,allow
Allow from all
<Files flasktest.wsgi>
Require all granted
</Files>
</Directory>
ErrorLog "/home/muslu/flask/logs/error_log"
import sys
sys.path.append(’/home/muslu/flask’)
from flasktest import app as application
Python
hakkında diğer konular