{"id":20280579,"url":"https://github.com/kbatuigas/ddapp","last_synced_at":"2026-04-15T18:32:17.398Z","repository":{"id":119570613,"uuid":"269432762","full_name":"kbatuigas/ddapp","owner":"kbatuigas","description":"A demo app written in Django for creating and managing Dungeons \u0026 Dragons campaigns.","archived":false,"fork":false,"pushed_at":"2020-07-15T16:56:22.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T02:42:59.163Z","etag":null,"topics":["database","django","postgres"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kbatuigas.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":"2020-06-04T18:17:47.000Z","updated_at":"2021-01-27T16:18:47.000Z","dependencies_parsed_at":"2023-04-09T11:00:47.501Z","dependency_job_id":null,"html_url":"https://github.com/kbatuigas/ddapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kbatuigas/ddapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbatuigas%2Fddapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbatuigas%2Fddapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbatuigas%2Fddapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbatuigas%2Fddapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kbatuigas","download_url":"https://codeload.github.com/kbatuigas/ddapp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kbatuigas%2Fddapp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31854749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","postgres"],"created_at":"2024-11-14T13:36:00.323Z","updated_at":"2026-04-15T18:32:17.372Z","avatar_url":"https://github.com/kbatuigas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ddapp\n\n## Set up the app\n\nMake sure Python 3 and [psycopg2](https://pypi.org/project/psycopg2/) are installed.\n\nSet up a containerized instance of PostgreSQL:\n\n```\ndocker run -d -p 5432:5432 -e PG_USER=devuser -e PG_PASSWORD=password -e PG_DATABASE=ddapp --name=ddapp crunchydata/crunchy-postgres-appdev\n```\n\nIf you have a SQL script to implement the database schema check that `devuser` is the schema owner.\n \nOtherwise execute these statements after setting up the database:\n```\nGRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO devuser;\nGRANT ALL PRIVILEGES ON ALL sequences IN SCHEMA public TO devuser;\n```\n\nSet up a virtual environment and add to project:\n\nDjango 2.2.12  \n[django-crispy-forms](https://django-crispy-forms.readthedocs.io/en/latest/install.html)\n\nStart a new project:\n\n`django-admin startproject ddmanager`\n\nStart a new app:\n\n`py manage.py startapp manager`\n\nRun the **initial migration** to create database tables needed by default Django applications:\n\n`py manage.py migrate`\n\nAdd the app and crispy_forms to `INSTALLED_APPS` in **settings.py**:\n\n```\nINSTALLED_APPS = [\n    'manager',\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'crispy_forms',\n]\n```\n\nSet database connection parameters:\n\n```\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql',\n        'NAME': 'ddapp',\n        'USER': 'devuser',\n        'PASSWORD': 'password',\n        'HOST': '127.0.0.1',\n        'PORT': '5432',\n    }\n}\n```\n\nMake sure you've also set a template pack (CSS framework) in settings.py:\n\n`CRISPY_TEMPLATE_PACK = 'bootstrap4'`\n\nCreate a superuser before creating any models (or doing anything really):\n\n`python manage.py createsuperuser`\n\nUse `inspectdb` to autogenerate a Django model module to standard output. On the command line\nyou can pipe it to models.py:\n\n`py manage.py inspectdb \u003e models.py`\n\n## Other notes\n\n* Our registration template (/manager/templates/manager/register.html) is namespaced just in case.\n\n* Django docs says `managed = False` in model class `meta` only pertains to creation and deletion of table, but it also\napplies to alter. If you don't change it, no migrations happen.\n\n* Django doesn't handle Postgres composite primary keys. \n\n* Django doesn't do a good job of altering table keys if it didn't create them. If Postgres already\nhas the correct keys just take them out of the migration file.\n\n* Creating a new auto-generated column on a table asks for a default value during the migration. Just\ndelete the `default` argument in the migration file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbatuigas%2Fddapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkbatuigas%2Fddapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkbatuigas%2Fddapp/lists"}