I try to load my app towards my apache2 server but i keep getting error 500.
File Structure:
/var/www/ApproveAndPost:
- ApproveAndPost.wsgi
- ApprovePost_Web
- run.py
/var/www/ApproveAndPost/ApprovePost_Web:
- forms.py
- init.py
- models.py
- routes.py
- services.py
- static
- templates
Files content:
/etc/apache2/sites-available/ApproveAndPost.conf
<VirtualHost *:80>
ServerName 192.168.170.67
ServerAdmin [email protected]
WSGIScriptAlias / /var/www/ApproveAndPost/ApproveAndPost.wsgi
<Directory /var/www/ApproveAndPost/ApprovePost_Web/>
Order allow,deny
Allow from all
</Directory>
Alias /static /var/www/ApproveAndPost/ApprovePost_Web/static
<Directory /var/www/ApproveAndPost/ApprovePost_Web/static/>
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
WSGI File:
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/ApproveAndPost")
from ApproveAndPost import app as application
application.secret_key = 'DISISSECRETKEY'
Python Code:
run.py
from ApprovePost_Web import app
if __name__ == "__main__":
app.run(debug=True)
init.py:
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SECRET_KEY'] = '#$%^&*'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db'
db = SQLAlchemy(app)
from ApprovePost_Web import routes
if __name__ == "__main__":
app.run(debug=True)
I think i am mixing up a couple of things ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…