16 Nisan 2024 00:19

Anasayfa

undefined...

Apache2 ve Wsgi modülü ile Flask projenizi yayınlamak için örnek Apache ayar dosyası

 

sudo -H pip install flask 
 

flasktest.py

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
return "Merhaba"

if __name__ == "__main__":
app.run()
 

apache.conf

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"
 

/home/muslu/flask/flasktest.wsgi

import sys
sys.path.append(’/home/muslu/flask’)
from flasktest import app as application

Python

hakkında diğer konular

Makdos Bilişim Teknolojileri 2015 - 2022