Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have been getting the following error in my python code : ImportError: cannot import name 'Flask' from partially initialized module 'flask' ( most likely
I have been getting the following error in my python code :
ImportError: cannot import name 'Flask' from partially initialized module 'flask' most likely due to a circular importLibraryFrameworksPythonframeworkVersionslibpythonsitepackagesflaskinitpy
I need assistance in debugging the code and maybe hekp with another way of doing what I am trying to do I tried updating flaskmysqldb but still got the same error. Please help in debugging or if possible provide a new code if possible that does the same functions. Here is the code:
from flask import Flask, rendertemplate, request
from flaskmysqldb import MySQL
app Flaskname templatefolder'Templates'
app.configMYSQLHOST" "localhost"
app.configMYSQLUSER" "root"
app.configMYSQLPASSWORD" "password
app.configMYSQLDB 'dashinfo'
dbdash MySQLapp
@app.route methodsPOST "GET"
def dash:
if request.method "POST":
dashInfo request.form
Insurid dashInfoInsurid
Insurname dashInfoInsurname'
Insurcomp dashInfoInsurcomp'
cur dbdash.connection.cursor
cur.executeINSERT INTO dashinfo Insurid Insurname, Insurcomp VALUES sssInsurid Insurname, Insurcomp
dbdash.connection.commit
#fetchdata cur.fetchall
cur.close
return "success"
return rendertemplateuserdash.html
@app.routecalendar # calendar for appointments
def showcalendar:
return rendertemplatecalendarhtml
if namemain:
app.rundebugTrue, port
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started