<prompt> Jenga programu ya Python Flask ambayo hutumika kama sehemu ya nyuma ya tovuti rahisi ya e-commerce. Programu inapaswa kutumia uthibitishaji wa mtumiaji, kuorodhesha bidhaa, na utendaji wa rukwama ya ununuzi.PLINFORMAT  <response>: kutoka kwa chupa ya kuingiza Chupa, render_template, elekeza kwingine, url_for, flash, ombi, toa mimbakutoka kwa flask_sqlalchemy kuagiza SQLAlchemykutoka kwa uingizaji_kuingia kwa chupa LoginManager, UserMixin, login_user, logout_user, current_user, login_requiredkutoka kwa werkzeug.security import generate_password_hash, check_password_hashprogramu Chupa__jina__app.configSQLALCHEMY_DATABASE_URI sqlite:ecommerce.dbapp.configSECRET_KEY your_secret_keydb SQLAlchemyprogramulogin_manager LoginManagerlogin_manager.init_appprogramuMtumiaji wa darasa UserMixin, db.Model: id db.Safuwimadb.Integer,msingi_ufunguoKweli jina la mtumiaji db.Safuwimadb.String64, uniqueKweli, isiyobatilikaUongo password_hash db.Safuwimadb.String128, inayoweza kubatilikaUongodarasa la Bidhaadb.Model: id db.Safuwimadb.Integer,msingi_ufunguoKweli jina db.Safuwimadb.String100, inayoweza kubatilikaUongo bei db.Safuwimadb.Float, nullableUongo maelezo db.Safuwimadb.Text, nullableKweliDarasa la ShoppingCartdb.Model: id db.Safuwimadb.Integer,msingi_ufunguoKweli user_id db.Columndb.Integer, db.ForeignKeyuser.id, nullableFalse product_id db.Columndb.Integer, db.ForeignKeyproduct.id, nullableFalse wingi db.Safu wimadb.Integer, load_useruser_id: return mbinuGET, POSTdef rejista : if request.method POST: jina la mtumiaji request.formusername password request.formpassword exist_user User.query.filter_byusernameusername.kwanza ikiwa mtumiaji_aliyepo: flashJina la mtumiaji tayari lipo. rudisha uelekezi upyaurl_forjiandikishe new_user Mtumiajijina la mtumiajijina la mtumiaji, password_hashgenerate_password_hashnenosiri db.session.addmtumiaji_mpya db.session.commit kuingia_mtumiajimtumiaji_mpya rudisha kuelekeza url_forindex return mbinuGET, POSTdef login: if request.method POST: jina la mtumiaji request.formusername password request.formpassword mtumiaji Mtumiaji.query.filter_byjina la mtumiajijina la mtumiaji.kwanza ikiwa sio mtumiaji au sio check_password_hashuser.password_hash, password: flashJina la mtumiaji au nenosiri batili rudisha kuelekeza url_foringia kuingia_mtumiaji mtumiaji rudisha kuelekeza url_forindex return logout: mtumiaji_toka rudisha kuelekeza index: bidhaa Bidhaa.query.all return render_templateindex.html, add_to_cartproduct_id: product Product.query.get_or_404product_id exist_item ShoppingCart.query.filter_byuser_idcurrent_user.id, product_idproduct_id.kwanza ikiwa kipengee_kilichopo: current_item.quantity 1 kwingine: new_item ShoppingCartuser_idcurrent_user.id, product_idproduct_id, quantity1 db.session.addkipengee_kipya db.session.commit rudisha kuelekeza remove_from_cartshopping_cart_id: bidhaa ShoppingCart.query.get_or_404shopping_cart_id ikiwa item.user_id ! current_user.id: kutoa mimba 403 db.session.futakipengee db.session.commit rudisha kuelekeza view_cart: vitu ShoppingCart.query.filter_byuser_idcurrent_user.id.all return render_templatecart.html, itemsitemskama __name__ __main__: app.rundebugKweli 