OneBite.Dev - Coding blog in a bite size

🧑‍🚀 Blog for learning python

python blog posts, coding tips and trick in a bitesize to help you learn python.

How to prevent block or forbidden on Newspaper3k scraping

How to bypass blocked or forbidden to accessed content when scraping with Newspaper3K in python

scraping python

Solving AttributeError: 'module' object has no attribute 'celery' in Django

Here is how to solve Solving AttributeError: 'module' object has no attribute 'celery' in python or when celery not found

django celery python

Updating poetry package manager from 1.1 to 1.2 1.3 or above

I got a problem when try to update my poetry package manager from 1.1 to 1.2 1.3 or above. Here is how I solve it

python

Solve poetry problem: configuration is invalid properties group was unexpected

Here is how I solve my poetry python configuration problem, where Additional properties are not allowed (group was unexpected) issue

python

Get uuid from a link string in python

Learn how to get UUID from a string link on a python programming language. This could be useful for example when you are working with Notion site then need to grab the id

python

Solving Error: pg_config executable not found psycopg2 install

On my mac machine, I tried to install a new python library with psycopg2 in it, I got pg_config error, here's how I solve this error

python

How to add multiple types in pydantic

To allow pydantic to accept multiple values we can use Union

python

How to make bcrypt checkpw function work

If you're using bcrypt in python, and try to use checkpw but keep failing, probably you save the hashed password in database wrong. Here's how I solve it.

python

Solve alembic multiple head revisions are present

Just like git, When you have multiple branches on your migrations of sqlalchemy's alembic. It will tell you that you have two different versions that need to be solved.

python

How to convert sqlalchemy object to json in FastAPI

Have you struggled on How to convert sqlalchemy object to json in FastAPI? Do you know that fastapi has jsonable_encoder to do exactly this job?

fastapi python

Solve error Alembic Can't locate revision identified by id_number

If you're using Alembic as your migration tool for sqlalchemy project on your python program, you might encountered this problem before -Alembic Can't locate revision identified by id_number- here's how to solve it.

python

How to bulk update in sqlalchemy python?

Update multiple columns one by one is daunting. Learn how to do a bulk update on Sqlalchemy in python programing language to update multiple items at once.

python

How to count most used words in database with python

How to count most used words in a sentence or article with python programming language

python