{"id":19864684,"url":"https://github.com/dev360/foundation","last_synced_at":"2026-02-28T14:31:11.935Z","repository":{"id":139698475,"uuid":"330474016","full_name":"dev360/foundation","owner":"dev360","description":"Django sample project","archived":false,"fork":false,"pushed_at":"2021-01-17T21:01:11.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T15:37:14.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dev360.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-01-17T19:52:55.000Z","updated_at":"2021-01-17T21:01:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"d3692307-911c-4fca-a4de-154d149b2258","html_url":"https://github.com/dev360/foundation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev360%2Ffoundation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev360%2Ffoundation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev360%2Ffoundation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev360%2Ffoundation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev360","download_url":"https://codeload.github.com/dev360/foundation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241273892,"owners_count":19937102,"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":[],"created_at":"2024-11-12T15:19:26.287Z","updated_at":"2025-10-29T22:11:30.244Z","avatar_url":"https://github.com/dev360.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# foundation\n\n## How to run \n```\n$ cd ~ \n$ mkdir Projects\n$ cd Projects\n$ git clone git@github.com:dev360/foundation.git\n```\n\n- Install [Docker Desktop](https://www.docker.com/products/docker-desktop)\n\n- To start docker and get into the shell:\n```\n$ docker-compose run --rm foundation bash\n```\n- To start the server, do:\n```\ndocker-compose run --rm --service-ports foundation python manage.py runserver\n```\n\n**Please note:** I did not create any django project, you have to get into the shell \nof this docker image and run `django-admin.py`, or otherwise follow the django tutorials.\n\n\n## Useful Django commands:\n- Connect to the database: `python manage.py dbshell`\n- Python shell to interact with the Django models: `python manage.py shell`\n- Create database migrations: `python manage.py makemigrations`\n- Run the database migrations: `python manage.py migrate`\n\n\n## Getting around the shell, and interacting with the Django ORM:\n- `dir()` on an object can display what attributes and functions are available.\n- To inspect a django model's available fields, do:\n  ```\n  Author._meta.fields\n  ```\n- Get one: \n  ```\n  Author.objects.get(id=1)\n  ```\n- Get all:\n  ```\n  Author.objects.all()\n  ```\n- Filter: \n  ```\n  Author.objects.filter(first_name='Christian')\n  ```\n- Create/update: \n  ```\n  author = Author()\n  author.first_name = ...\n  ...\n  author.save()\n  ```\n- Delete:\n  ```\n  author = Author.objects.get(id=...)\n  author.delete()\n  ```\n- Delete multiple:\n  ```\n  ids = [1, 2, 3, 4]\n  author = Author.objects.filter(id__in=ids).delete()\n  ```\n- Get, or create if doesn't exist:\n  ```\n  author, created = Author.objects.get_or_create(email='xxxxx@gmail', defaults=dict(first_name='John', last_name='Doe'))\n  ```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev360%2Ffoundation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev360%2Ffoundation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev360%2Ffoundation/lists"}