{"id":15105525,"url":"https://github.com/forgepackages/forge-db","last_synced_at":"2026-01-18T20:32:35.222Z","repository":{"id":37049574,"uuid":"504718968","full_name":"forgepackages/forge-db","owner":"forgepackages","description":"Local Postgres db for Django via Docker","archived":false,"fork":false,"pushed_at":"2023-06-01T19:07:03.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-30T01:31:21.649Z","etag":null,"topics":["database","django","forgepackages","python"],"latest_commit_sha":null,"homepage":"https://www.forgepackages.com/docs/forge-db","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forgepackages.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-18T01:54:52.000Z","updated_at":"2023-01-20T16:21:59.000Z","dependencies_parsed_at":"2024-09-16T05:03:18.459Z","dependency_job_id":"81d9395a-0d21-4992-b1e5-824bdf286040","html_url":"https://github.com/forgepackages/forge-db","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.4838709677419355,"last_synced_commit":"69c4a3102bcb811bda2529ec774c01696649bfd4"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgepackages%2Fforge-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgepackages%2Fforge-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgepackages%2Fforge-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgepackages%2Fforge-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forgepackages","download_url":"https://codeload.github.com/forgepackages/forge-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230326806,"owners_count":18209050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","django","forgepackages","python"],"created_at":"2024-09-25T20:40:35.401Z","updated_at":"2024-12-18T19:12:37.097Z","avatar_url":"https://github.com/forgepackages.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# forge-db\n\nUse Postgres for local Django development via Docker.\n\n\n## Installation\n\nFirst, install `forge-db` from [PyPI](https://pypi.org/project/forge-db/):\n\n```sh\npip install forge-db\n```\n\nNow you will have access to the `db` command:\n\n```sh\nforge db\n```\n\nYou will need to have a `DATABASE_URL` environment variable,\nwhich is where the database name, username, password, and port are parsed from:\n\n```sh\n# .env\nDATABASE_URL=postgres://postgres:postgres@localhost:54321/postgres\n```\n\nYou can use a `POSTGRES_VERSION` environment variable to override the default Postgres version (13):\n\n```sh\n# .env\nPOSTGRES_VERSION=12\n```\n\nIn most cases you will want to use [`dj_database_url`](https://github.com/kennethreitz/dj-database-url) in your `settings.py` to easily set the same settings (works in most deployment environments too):\n\n```python\n# settings.py\nimport dj_databse_url\n\nDATABASES = {\n    \"default\": dj_database_url.parse(\n        environ[\"DATABASE_URL\"], conn_max_age=environ.get(\"DATABASE_CONN_MAX_AGE\", 600)\n    )\n}\n```\n\nYou will also notice a new `.forge` directory in your project root.\nThis contains your local database files and should be added to `.gitignore`.\n\n## Usage\n\nIf you use [`forge-work`](https://github.com/forgepackages/forge-work),\nthen most of the time you won't need to interact with `forge-db` directly.\nBut it has a few commands that come in handy.\n\n- `forge db start` - starts a new database container and runs it in the background (use `--logs` to foreground it or connect to the logs)\n- `forge db stop` - stop the database container\n- `forge db reset` - drops and creates a new database\n- `forge db pull` - pulls the latest database backup from Heroku and imports it into the local database\n\nIn the end, the database container is like any other Docker container.\nYou can use the standard Docker commands and tools to interact with it when needed.\n\n## Snapshots\n\nThe `forge db snapshot` command manages local copies of your development database.\nThis is useful for testing migrations or switching between git branches that have different db states.\n\nSnapshots are simply additional Postgres databases that are created and dropped as needed (`createdb {snapshot_name} -T postgres`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforgepackages%2Fforge-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforgepackages%2Fforge-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforgepackages%2Fforge-db/lists"}