pytest-dev / pytest-dev/pytest-django
How does live_server know which database to connect to?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 367
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to wrap my head around database connection handling in Django. How does the LiveServerThread pick the right database? Am I correct in my understanding that the django settings are modified per xdist process and that the LiveServerThread picks its choice from that same modified settings object?
It seems like it would need to be communicated across the thread boundary, but perhaps I'm wrong. Any explanation would be most welcome! :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the named LiveServerThread and the pytest-xdist process-specific Django settings described in the issue. Verify how the database choice crosses the thread boundary, then document a clear explanation of the connection-handling behavior and whether the settings object is shared.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, databases, testing
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100