Skip to content

Instantly share code, notes, and snippets.

@DoonDoony
DoonDoony / pycharm_python_console_shell_plus_script.py
Last active January 20, 2024 15:50
Using `shell_plus` in pycharm django console
# 💡 NOTE: This only works if you are pretend to using `Django Console` feature in Pycharm
# Paste codes below into `Build, Execution, Deployment > Console > Django Console > Starting Script`
# requirements: `django_extensions`, `IPython`
import sys
import django
from IPython.core.getipython import get_ipython
from django_extensions.management.notebook_extension import load_ipython_extension
@luzfcb
luzfcb / uuid4_python_regex.md
Last active September 3, 2022 06:42
uuid4 python regex . django slug

A UUID-4 has five groups of lowcase hexadecimal characters, the first has 8 chars, the second 4 chars, the third 4 chars, the fourth 4 chars, the fifth 12 chars.

However to make it a valid UUID4 the third group (the one in the middle) must start with a 4:

00000000-0000-4000-0000-000000000000
              ^