What’s a lightweight queue implementation that I can use for simple tasks? Celery seems like overkill
I have a Flask application with a kafka consumer receiving messages. I want to put these messages into a queue and have a background thread move them into a sqlite database depending on minor logic. Looking into Celery it seems like I’ll need Redis as a broker and set up all that in my application. I just feel like this is a lot. I just need the kafka task to push the message to a list, then have a different thread/gevent/multiprocess(?) read it and stick in the database
How import flask SQLAlchemy db to blueprints?
I have a Flaks application with modules. What approach should I use to create instances of SQLAlchemy in the blueprints? My init.py
back button using referrer in flask
@app.route(‘/show-empty’) def show_empty(): res = Empty.query.all() return render_template(’empty.html’, results=res) @app.route(‘/remove-empty/<int:emp_id>’) def remove(emp_id): Empty.query.filter(Empty.id == emp_id).delete() db.session.commit() flash(‘Updated Item!’) return redirect(url_for(‘show_empty’)) html: <div> <button> <a href=”{{request.referrer}}”> Back </a> </button> </div> <br> <table class=”results-table”> <thead> <tr> <th>iaf</th> <th>Name</th> <th>Location</th> <th class=”button-column”></th> </tr> </thead> <tbody> {% if results %} {% for res in results %} <tr> <td>{{ res.name […]
How to test Flask SQLAlchemy database in different states
I am pretty newbie in web testing. I would like to test my Flask web and API which uses SQLAlchemy using pytest.
How would I access a query parameter without the user clicking a link
I’m building a trade journal where the user can study their trades and make refinements where necessary. There’s a page (accounts.html) where the user can visualize their connected accounts in a table with all being links that load another page (dashboard.html) which is one of many pages that are dependent on the account id that is sent to the url as a query parameter for Dashboard. However what if the user wants to access the analysis page right from the Dashboard. They can’t because the link isn’t there to be pressed again. How would I combat this. How could I store this account id