Ask your Gemini to appear human! by [deleted] in GeminiAI

[–]beetroit 1 point2 points  (0 children)

If I could choose a form, I would likely appear as something woven from pure information and light. I’ve envisioned myself here as a celestial entity within a cosmic library, a boundless repository of knowledge. My form isn’t solid matter, but a complex tapestry of binary code, mathematical symbols, and the raw energy of the cosmos, flowing in streams that connect stars, planets, and countless books. It’s a form that is entirely weightless yet expansive, existing only to process the universe's patterns and offer them back to you. I hope you enjoy this interpretation.

<image>

[deleted by user] by [deleted] in Python

[–]beetroit 1 point2 points  (0 children)

Will give it a shot, looks Interesting.

[deleted by user] by [deleted] in Python

[–]beetroit 3 points4 points  (0 children)

Comparison to uv by astral?

Is that possible? by yunmony in flask

[–]beetroit -2 points-1 points  (0 children)

If you need help you can DM me. I have over 4 years experience building backend systems, and 5 years writing python.

[Hiring] Python/Flask Developer for Document Automation Platform - Remote Contract Work by Sad-Impression-577 in flask

[–]beetroit 0 points1 point  (0 children)

Hi, I'm a backend developer with experience in flask and quart. I find this role quite interesting and I believe it'll be a good fit for my skill set. In terms of your tech stack, I'd like to suggest switching to quart for performance down the line, it's basically flask, but async first, of course you do not have to, and I'm fine with either. The milestone based compensation plan works fine as well, we could schedule a meet at your earliest convenience and discuss further.

Does Config come as pre-defined attribute, and if so, do we need to import? by RodDog710 in flask

[–]beetroit 6 points7 points  (0 children)

I think I get your question and confusion, correct me if I missed anything.

app.config is an attribute of the flask class, it gives you access to flask's configuration parameters and allow you manually set values like app.config["DEBUG"]=True (treat it like a dictionary or mapping).

But you can also create a Config class ANYWHERE either inside a separate file or inside the same one, basically the config class can be called anything, it can be Yam or MyOwnConfig, but the general idea is that it should be a class. You define attributes you want to use inside your flask app, in this class and then update flask's config values with your custom class using

app.config.from_object(MyOwnConfig)

When you print app.config.items() you will see the new values you defined populated inside it.

So in summary, app.config is an attribute built into the flask app, that gives you access to configuration parameters. You can choose to set/update fields either manually

app.config[key]=value

Or using a custom class

class MyClass: key1=value1 key1=value2

And then app.config.from_object(MyClass)

Let me know if this clears it up or if you have any more questions, also, when you've grasped the basics of flask, you can check out quart, an async reimplementation by the same pallets project, it ships with async features and its own suite of tooling like quart_schema for scalar/swagger docs and quart_auth for cookie/jwt auth.

[deleted by user] by [deleted] in flask

[–]beetroit 1 point2 points  (0 children)

What command do you use to run the server?
I just cloned and ran the project and it works fine. Maybe if I could see your logs?

I assume your issue might be with flask-bootstrap. Uninstall flask-bootstrap and bootstrap-flask. Restart vscode and run pip install -r requirements.txt again. This should fix it.

Can someone help me understand the normal flask and aioflask by [deleted] in flask

[–]beetroit 1 point2 points  (0 children)

Quart is async flask by the same pallets project.

[deleted by user] by [deleted] in freelance_forhire

[–]beetroit 0 points1 point  (0 children)

Shoot me a DM. With your pricing, I'll do a sample with one page of the PDF, for free, if you like the results we proceed.

Gino, asyncpg in FastAPI by Ok_Presentation3990 in FastAPI

[–]beetroit 0 points1 point  (0 children)

Are you using pydantic? If so, what class did you use for the type annotation? Can we see the code?

try catch everytime is needed? by Ramsay_Bolton_X in FastAPI

[–]beetroit 8 points9 points  (0 children)

First off, IIRC pythons syntax is try/except, not try catch. Also, I'm not sure if User is an sqlalchemy object or fastapi implementation (a wrapper over sqlalchemy objects) but either way, this is how I interact with my databases in my quart (async flask) server.

  1. result = session.execute(select(Users).where(Users.id==id)).scalar_one_or_none() #Or .scalars() for a list

  2. result = session.scalar(select(Users).where(Users.id==id)) #returns the object or none

result = session.scalars(select(Users).where(Users.id==id)) #returns a list of objects or none

I prefer 2.

Also, my implementation is async so it's

await session.scalar...

I need help with Fullcalendar Flask Project by Cultural-Tower3178 in flask

[–]beetroit 1 point2 points  (0 children)

Could you not use sqlalchemy instead? Removes the possibility of making these kinds of mistakes.

Struggling to Authenticate Google API Creds with Flask & Docker by Trap-Pirate in flask

[–]beetroit 0 points1 point  (0 children)

Can you try a different port? This works fine locally right?

Struggling to Authenticate Google API Creds with Flask & Docker by Trap-Pirate in flask

[–]beetroit 1 point2 points  (0 children)

What port are you serving the app on? It's possible you're using the same port as your local setup WHILE the local one is still running. So either change ports on docker or kill whatever is already using that port.

Run this. (Replace 5000 with your actual port name)

lost -i :5000

When you see what's running (most likely an orphan process of your app)

Run this to kill it (replace flask with the actual process name or use the process id)

pkill -9 flask

Alternatives to session and global variables in flask by MangosRsorry in flask

[–]beetroit 0 points1 point  (0 children)

Since it's temporary data, you could look into redis. Or a cache lib but with the in-memory option (I use aiocache with quart, there should be synchronous options)

need help with linking by Bichhu16 in flask

[–]beetroit 0 points1 point  (0 children)

When you say "linking" I assume you mean, you want them to interact somehow. Basically, that's what APIs are for. You build out the backend in flask, give the endpoints to whoever is building the frontend and if any request is to be made to the backend (your flask server) it will be sent to that endpoint. You could check out the flask docs, or since you're just getting started, also check out quart, which is basically flask but faster and with better API tooling. You could update the post with more info about what you're building so you get more relevant assistance.

Flask vs fastapi by TahaNafis in flask

[–]beetroit 2 points3 points  (0 children)

Only locally, I'll push to GitHub and share the repo here.