{"id":19427568,"url":"https://github.com/codesandbox/codesandbox-template-django","last_synced_at":"2025-04-14T16:41:29.681Z","repository":{"id":75330878,"uuid":"602046102","full_name":"codesandbox/codesandbox-template-django","owner":"codesandbox","description":"A Django starter project","archived":false,"fork":false,"pushed_at":"2023-06-02T19:21:47.000Z","size":271,"stargazers_count":6,"open_issues_count":6,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-05T17:46:53.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codesandbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-02-15T11:39:38.000Z","updated_at":"2025-03-10T04:55:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b83909e-d02e-4ae5-8fb2-b29fd8fc85a7","html_url":"https://github.com/codesandbox/codesandbox-template-django","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":"wsvincent/lithium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesandbox%2Fcodesandbox-template-django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesandbox%2Fcodesandbox-template-django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesandbox%2Fcodesandbox-template-django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesandbox%2Fcodesandbox-template-django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codesandbox","download_url":"https://codeload.github.com/codesandbox/codesandbox-template-django/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248918174,"owners_count":21183128,"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-10T14:12:07.138Z","updated_at":"2025-04-14T16:41:29.656Z","avatar_url":"https://github.com/codesandbox.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e A batteries-included Django starter project. To learn more try the books [Django for Beginners](https://djangoforbeginners.com), [Django for APIs](https://djangoforapis.com), and [Django for Professionals](https://djangoforprofessionals.com).\n\n## 🚀 Features\n\n- Django 4.1 \u0026 Python 3.10\n- Install via [Pip](https://pypi.org/project/pip/), [Pipenv](https://pypi.org/project/pipenv/), or [Docker](https://www.docker.com/)\n- User log in/out, sign up, password reset via [django-allauth](https://github.com/pennersr/django-allauth)\n- Static files configured with [Whitenoise](http://whitenoise.evans.io/en/stable/index.html)\n- Styling with [Bootstrap v5](https://getbootstrap.com/)\n- Debugging with [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar)\n- DRY forms with [django-crispy-forms](https://github.com/django-crispy-forms/django-crispy-forms)\n\n![Homepage](homepage_41.png)\n----\n\n## Table of Contents\n* **[Installation](#installation)**\n  * [Pip](#pip)\n  * [Pipenv](#pipenv)\n  * [Docker](#docker)\n* [Next Steps](#next-steps)\n* [Contributing](#contributing)\n* [Support](#support)\n* [License](#license)\n\n----\n\n## 📖 Installation\nDjangoX can be installed via Pip, Pipenv, or Docker. To start, clone the repo to your local computer and change into the proper directory.\n\n```\n$ git clone https://github.com/wsvincent/djangox.git\n$ cd djangox\n```\n\n### Pip\n\n```\n$ python -m venv .venv\n\n# Windows\n$ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n$ .venv\\Scripts\\Activate.ps1\n\n# macOS\n$ source .venv/bin/activate\n\n(.venv) $ pip install -r requirements.txt\n(.venv) $ python manage.py migrate\n(.venv) $ python manage.py createsuperuser\n(.venv) $ python manage.py runserver\n# Load the site at http://127.0.0.1:8000\n```\n\n### Pipenv\n\n```\n$ pipenv install\n$ pipenv shell\n(.venv) $ python manage.py migrate\n(.venv) $ python manage.py createsuperuser\n(.venv) $ python manage.py runserver\n# Load the site at http://127.0.0.1:8000\n```\n\n### Docker\n\nTo use Docker with PostgreSQL as the database update the `DATABASES` section of `django_project/settings.py` to reflect the following:\n\n```python\n# django_project/settings.py\nDATABASES = {\n    \"default\": {\n        \"ENGINE\": \"django.db.backends.postgresql\",\n        \"NAME\": \"postgres\",\n        \"USER\": \"postgres\",\n        \"PASSWORD\": \"postgres\",\n        \"HOST\": \"db\",  # set in docker-compose.yml\n        \"PORT\": 5432,  # default postgres port\n    }\n}\n```\n\nThe `INTERNAL_IPS` configuration in `django_project/settings.py` must be also be updated:\n\n```python\n# config/settings.py\n# django-debug-toolbar\nimport socket\nhostname, _, ips = socket.gethostbyname_ex(socket.gethostname())\nINTERNAL_IPS = [ip[:-1] + \"1\" for ip in ips]\n```\n\nAnd then proceed to build the Docker image, run the container, and execute the standard commands within Docker.\n\n```\n$ docker-compose up -d --build\n$ docker-compose exec web python manage.py migrate\n$ docker-compose exec web python manage.py createsuperuser\n# Load the site at http://127.0.0.1:8000\n```\n\n## Next Steps\n\n- Add environment variables. There are multiple packages but I personally prefer [environs](https://pypi.org/project/environs/).\n- Add [gunicorn](https://pypi.org/project/gunicorn/) as the production web server.\n- Update the [EMAIL_BACKEND](https://docs.djangoproject.com/en/4.0/topics/email/#module-django.core.mail) and connect with a mail provider.\n- Make the [admin more secure](https://opensource.com/article/18/1/10-tips-making-django-admin-more-secure).\n- `django-allauth` supports [social authentication](https://django-allauth.readthedocs.io/en/latest/providers.html) if you need that.\n\nI cover all of these steps in my three books: [Django for Beginners](https://djangoforbeginners.com), [Django for APIs](https://djangoforapis.com), and [Django for Professionals](https://djangoforprofessionals.com).\n\n----\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome! See [CONTRIBUTING.md](https://github.com/wsvincent/djangox/blob/master/CONTRIBUTING.md).\n\n## ⭐️ Support\n\nGive a ⭐️  if this project helped you!\n\n## License\n\n[The MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesandbox%2Fcodesandbox-template-django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesandbox%2Fcodesandbox-template-django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesandbox%2Fcodesandbox-template-django/lists"}