I've been trying to get a simple flask app to run but can't get past the following problem.
Lets start with my folder structure:
D:\Git\tools\scripts\simUserInterface with two python files:
app.py
templates.py
In addition, there's the folder
D:\Git\tools\scripts\simUserInterface\index
with the file web.wsgi
My web.wsgi looks like this:
import sys
sys.path.insert(0, 'D:/Git/tools/scripts/simUserInterface')
from dashy import server as application
The app.py itself looks like this
import os
import sys
from flask import Flask
import dash
import dash_table
import dash_html_components as html
import dash_core_components as dcc
from templates import MY_TEMPLATE
server = Flask(__name__)
app = dash.Dash(__name__, server=server)
# Create app layout
app.layout = html.Div()
if __name__ == "__main__":
server.run()
I'm using Apache 2.4 and my virtual host configuration looks like this:
<VirtualHost *:5000>
ServerAdmin admin-name-here
ServerName localhost:5000
WSGIScriptAlias / "D:/Git/tools/scripts/simUserInterface/index/web.wsgi"
DocumentRoot "D:/Git/tools/scripts/simUserInterface"
<Directory "D:/Git/tools/scripts/simUserInterface/index">
Require all granted
</Directory>
ErrorLog "D:/Git/tools/scripts/simUserInterface/logs/error.log"
CustomLog "D:/Git/tools/scripts/simUserInterface/logs/access.log" common
</VirtualHost>
If I run the app with the build-in Flask development server locally on my machine, everything works fine and the layout renders as expected (Of course, my layout is not actually empty. I deleted the code to focus on the main things). However, if I run the script via the browser (127.0.0.1:5000), it seems to be stuck at from templates import MY_TEMPLATE. The browser appears to be loading somethings but doesn't render the layout.
If I comment out that one particular line (from templates import MY_TEMPLATE), everything works fine.
I'm completely out of ideas and any help is appreciated.