Database issues emulation Django
Moved to settings.
-
To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
-
To create a superuser account, use this command:
uv run python manage.py createsuperuser
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
Running type checks with mypy:
uv run mypy goodvibes
To run the tests, check your test coverage, and generate an HTML coverage report:
uv run coverage run -m pytest
uv run coverage html
uv run open htmlcov/index.html
uv run pytest
Moved to Live reloading and SASS compilation.
The following details how to deploy this application.
This project includes a small shop app to demonstrate redundant and unused PostgreSQL indexes.
Quick start:
-
Ensure your
DATABASE_URLpoints to PostgreSQL. -
Apply migrations:
uv run python manage.py migrate -
Reset index stats (optional, recommended):
uv run python manage.py reset_index_stats -
Seed demo data (adjust scale as needed):
uv run python manage.py seed_demo_data --scale 1 -
Run biased workload to leave some indexes unused:
uv run python manage.py simulate_load --seconds 120 -
Report index usage and sizes:
uv run python manage.py report_indexes
Notes:
- Designed for PostgreSQL (uses partial, functional, and INCLUDE indexes, and pg_stat_* views).
- The workload favors a subset of access paths so others remain unused (idx_scan = 0).