Main

type

5 (blog/news article)

status

21 (imported old-v2, waiting for another import)

review version

0

cleanup version

0

pending deletion

0 (-)

created at

2026-01-01 07:20:15

updated at

2026-01-01 07:20:15

Address

url

https://kennethfalck.net/2009/07/01/multiple-databases-and-sharding-with-django/

url length

80

url crc

36713

url crc32

1724092265

location type

1 (url matches target location, page_location is empty)

canonical status

30 (canonical url is different, page_canonical_page_id points to it)

canonical page id

3482973826

Source

domain id

79076628

domain tld

2644

domain parts

2

originating warc id

6611068

originating url

source type

11 (CommonCrawl)

Server response

server ip

99.86.4.28

Publication date

2025-07-20 13:26:22

Fetch attempts

0

Original html size

11739

Normalized and saved size

11570

Content

title

Multiple databases and sharding with Django

excerpt

content

Disclaimer: I'm still learning Django so there may be smarter ways of doing the things I describe here. I also haven't tested this much though the principle seems to work. The example code has been edited and may not be fully correct. Background By default, Django 1.0 supports only a single, hardcoded database connection, defined by the settings.DATABASE_XXX variables. All models use the same connection. A scalable website needs several different database connections when MySQL is used. Models might be stored in separate databases, and sometimes a read-only replica of a database might be used for querying. For sharding purposes, several different databases might be used for the same model. Using a custom Manager to choose the database The "objects" attribute of Django models can be replaced with a custom Manager class. This allows you to override the get_query_set() method, which chooses the database connection. For example: from django import db import new class Cust...

author

Kenneth Falck

updated

2026-01-07 04:07:22

Text analysis

block type

0

extracted fields

236

extracted bits

article author
title
full content
content was extracted heuristically
OpenGraph suggests this is an article

detected location

0

detected language

1 (English)

category id

Other [en] (231)

index version

2025123101

paywall score

0

spam phrases

0

Text statistics

text nonlatin

0

text cyrillic

0

text characters

3546

text words

688

text unique words

265

text lines

1

text sentences

29

text paragraphs

1

text words per sentence

23

text matched phrases

0

text matched dictionaries

0