Jun-09-2021, 11:55 AM
Greetings,
I am developing a Flask application, but keep getting an error from:
import theapp
and
from theapp import app??
This is the folder structure:
I have a folder called theapp, with _init_, db and routes.py
Appreciate any pointers where I am going wrong??
Thanks,
Clive
In run.py the code is:
I am developing a Flask application, but keep getting an error from:
import theapp
and
from theapp import app??
This is the folder structure:
I have a folder called theapp, with _init_, db and routes.py
Appreciate any pointers where I am going wrong??
Thanks,
Clive
In run.py the code is:
from flask import Flask from theapp import app #import theapp.routes app = Flask(__name__) if __name__ == "__main__": app.run(debug=True)In routes.py
import flask from flask import Flask from flask import render_template, request, redirect, send_file,url_for, flash from theapp import app #import app #from theapp.db import conn, text, exc#from theapp.helper import getcriteria, getyear, create_financial_year, getquarter, updatefield, getresults, deleterecord, log, get_isodate, #from theapp.helper import * #from theapp.forms import * #from theapp.models import User #from theapp.loginsystem import * #from theapp.view_programme import * import csv import os import datetime as dt import urllib.request import logging import datetime import hashlib import random import json @app.route('/') @app.route('/index') def index(): return "Hello, World!"