Hello! I would like to add my simple website on server but flask_app.py and views.py gives me no module error. I don't know why because app object is created in init file. I'll be thankful for any advices.
My folder structure:
\mysite
\app
\static
\templates
index.html
views.py
__init__.py
flask_app.py
init.py
from flask import Flask
app = Flask(__name__)
from app import views
views.py
from flask import render_template
from app import app
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html',title='example')
flask_app.py
from flask import Flask
from app import app
wsgi.py
import sys
# add your project directory to the sys.path
project_home = u'/home/librarysystem/mysite'
if project_home not in sys.path:
sys.path = [project_home] + sys.path
# import flask app but need to call it "application" for WSGI to work
from flask_app import app as application