{"id":26837107,"url":"https://github.com/oragazzo/django-tasks-api","last_synced_at":"2025-06-27T16:31:43.880Z","repository":{"id":275968649,"uuid":"927775672","full_name":"oragazzo/django-tasks-api","owner":"oragazzo","description":"Django REST API implementation with Docker, showcasing best practices for containerization and deployment configuration.","archived":false,"fork":false,"pushed_at":"2025-02-10T20:26:31.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T11:02:57.225Z","etag":null,"topics":["django","django-rest-framework","docker","docker-compose","postgresql","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/oragazzo.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":"2025-02-05T14:25:08.000Z","updated_at":"2025-04-10T12:53:59.000Z","dependencies_parsed_at":"2025-02-10T14:48:40.648Z","dependency_job_id":"a9442e56-d58d-4458-8c2d-8df300f54991","html_url":"https://github.com/oragazzo/django-tasks-api","commit_stats":null,"previous_names":["oragazzo/tasks_api","oragazzo/django_tasks_api","oragazzo/django-tasks-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oragazzo/django-tasks-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oragazzo%2Fdjango-tasks-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oragazzo%2Fdjango-tasks-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oragazzo%2Fdjango-tasks-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oragazzo%2Fdjango-tasks-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oragazzo","download_url":"https://codeload.github.com/oragazzo/django-tasks-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oragazzo%2Fdjango-tasks-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262293063,"owners_count":23288653,"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":["django","django-rest-framework","docker","docker-compose","postgresql","python"],"created_at":"2025-03-30T16:42:55.337Z","updated_at":"2025-06-27T16:31:43.851Z","avatar_url":"https://github.com/oragazzo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tasks API - Docker Implementation Test\n\nThis project demonstrates a Django REST API implementation with Docker, showcasing best practices for containerization and deployment configuration.\n\n## Project Structure\n\n```\ntasks_api/\n├── api/                    # API application\n│   ├── views.py           # API endpoints\n│   ├── models.py          # Data models\n│   ├── serializers.py     # Data serializers\n│   └── urls.py            # API routing\n├── backend/               # Django project settings\n│   ├── settings.py        # Project configuration\n│   ├── urls.py           # Project URL routing\n│   └── wsgi.py           # WSGI configuration\n├── deploy/                # Deployment configurations\n│   ├── postgres/         # PostgreSQL service\n│   │   ├── Dockerfile    # PostgreSQL container configuration\n│   │   └── init.sql      # Database initialization script\n│   └── server/           # API server service\n│       └── Dockerfile    # Server container configuration\n├── docker-compose.yaml    # Docker services orchestration\n├── Makefile              # Development automation\n├── .env                  # Environment variables (not in version control)\n├── .env.example          # Environment variables template\n├── requirements.txt      # Python dependencies\n└── manage.py            # Django management script\n```\n\n## Features\n\n- RESTful API endpoints for task management\n- Django REST Framework with browsable API interface\n- PostgreSQL Database for data persistence\n- Docker containerization with multi-stage builds\n- Health checks and container orchestration\n- Environment-based configuration\n- Comprehensive API documentation\n- Test coverage for API endpoints\n\n## Prerequisites\n\n- Python 3.12+\n- PostgreSQL 15+\n- Docker 24.0+ and Docker Compose V2\n- Make (optional, for using Makefile commands)\n\n## Quick Start with Docker\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/oragazzo/tasks_api.git\n   cd tasks_api\n   ```\n\n2. Set up environment variables:\n   ```bash\n   cp .env.example .env\n   # Edit .env file with your desired configuration\n   ```\n\n3. Start the application using Docker Compose:\n   ```bash\n   docker-compose up --build\n   ```\n\n\n## Manual Setup (Without Docker)\n\n1. Create a virtual environment:\n   ```bash\n   # Option 1: Using Conda (Recommended)\n   conda create -n tasks_api python=3.12\n   conda activate tasks_api\n\n   # Option 2: Using venv\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n2. Set up environment variables:\n   ```bash\n   cp .env.example .env\n   # Edit .env file with your configuration\n   # For local development, make sure DATABASE_HOST=localhost\n   ```\n\n3. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Create PostgreSQL database:\n   ```bash\n   createdb basic_api\n   ```\n\n5. Run migrations and create superuser:\n   ```bash\n   python manage.py migrate\n   python manage.py createsuperuser\n   ```\n\n6. Start the development server:\n   ```bash\n   python manage.py runserver\n   ```\n\n## Environment Variables\n\nThe project uses a `.env` file for configuration. Copy `.env.example` to `.env` and adjust the values:\n\n```bash\n# Django Settings\nDEBUG=1\nSECRET_KEY=your-secret-key-here\nALLOWED_HOSTS=localhost,127.0.0.1\n\n# Database Settings\nDATABASE_NAME=basic_api\nDATABASE_USER=\u003cDB_USER\u003e\nDATABASE_PASSWORD=\u003cDB_PASSWORD\u003e\nDATABASE_HOST=db        # Use 'db' for Docker, 'localhost' for local development\nDATABASE_PORT=5432\n\n# PostgreSQL Container Settings\nPOSTGRES_DB=basic_api\nPOSTGRES_USER=\u003cPG_USER\u003e\nPOSTGRES_PASSWORD=\u003cPG_PASSWORD\u003e\n```\n\n## Development\n\n- The Docker setup includes hot-reload for development\n- Database data is persisted in a Docker volume\n- PostgreSQL is accessible on port 5432\n- The API server runs on port 8000\n- Environment variables are loaded from `.env` file\n\n## Docker Commands\n\nCommon commands for managing the Docker environment:\n\n```bash\n# Start services in development mode\ndocker-compose up\n\n# Start services in detached mode\ndocker-compose up -d\n\n# Rebuild and start services\ndocker-compose up --build\n\n# Stop services\ndocker-compose down\n\n# Stop services and remove volumes\ndocker-compose down -v\n\n# View logs\ndocker-compose logs -f\n\n# View logs for specific service\ndocker-compose logs -f api\n```\n\n## Security Notes\n\n- The `.env` file contains sensitive information and is not included in version control\n- Default Django admin credentials should be changed in production\n- Debug mode should be disabled in production\n- Use strong passwords for database and Django admin\n- Regular security updates should be applied to all dependencies\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foragazzo%2Fdjango-tasks-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foragazzo%2Fdjango-tasks-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foragazzo%2Fdjango-tasks-api/lists"}