# Django

- Page: https://shared.btbytes.com/p/django
- Date: 2024-04-24
- Tags: python, django

[Django from first principles](https://www.mostlypython.com/django-from-first-principles/)


[Static site generator for Django - Django Distill](https://django-distill.com/)

> While making https://thesummarist.net, I came across https://django-distill.com, which is THE BEST way to create static sites, bar none. You just make a standard, dynamic Django site, then you run a command and boom! It's static. I love it. -- [via Stravos](https://x.com/Stavros/status/1794760474304958675)

[Django SQLite Production Config](https://blog.pecar.me/sqlite-django-config)

```python
# yourproject/settings.py
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "OPTIONS": {
            "transaction_mode": "IMMEDIATE",
            "timeout": 5,  # seconds
            "init_command": """
                PRAGMA journal_mode=WAL;
                PRAGMA synchronous=NORMAL;
                PRAGMA mmap_size = 134217728;
                PRAGMA journal_size_limit = 27103364;
                PRAGMA cache_size=2000;
            """,
        },
    }
}
```
