{"id":33510087,"url":"https://github.com/fulanii/drf-boilerplate","last_synced_at":"2026-03-06T00:31:45.206Z","repository":{"id":320611177,"uuid":"1082712400","full_name":"fulanii/drf-boilerplate","owner":"fulanii","description":"Production ready template for a Django REST Framework","archived":false,"fork":false,"pushed_at":"2025-10-25T08:05:12.000Z","size":380,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-27T14:55:53.737Z","etag":null,"topics":["django","django-rest-framework","drf-spectacular","python","render","simple-jwt"],"latest_commit_sha":null,"homepage":"","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/fulanii.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-24T16:45:45.000Z","updated_at":"2025-11-21T09:59:25.000Z","dependencies_parsed_at":"2025-10-24T20:35:23.158Z","dependency_job_id":null,"html_url":"https://github.com/fulanii/drf-boilerplate","commit_stats":null,"previous_names":["fulanii/drf-boilerplate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fulanii/drf-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulanii%2Fdrf-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulanii%2Fdrf-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulanii%2Fdrf-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulanii%2Fdrf-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fulanii","download_url":"https://codeload.github.com/fulanii/drf-boilerplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulanii%2Fdrf-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["django","django-rest-framework","drf-spectacular","python","render","simple-jwt"],"created_at":"2025-11-26T04:03:37.987Z","updated_at":"2026-03-06T00:31:45.155Z","avatar_url":"https://github.com/fulanii.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 drf-boilerplate \n\nThis is a production-ready template for a Django REST Framework apps with a different frontend like react etc, featuring a custom user model where users can sign up, login, verify email and reset password. Authentication using JWT authentication via `djangorestframework-simplejwt`, auto generated docs with `drf_spectacular` email code verifictions using resend and separated configuration for local development and production deployment.\n\n\n### Tech Stack\n- `django djangorestframework`\n- `djangorestframework-simplejwt`\n- `drf_spectacular`\n- `resend`\n- `pytest pytest-django`\n\n\n### Core Features\n\n| Feature | Details | Key Libraries |\n| :--- | :---: | ---: |\n| Custom User Authentication | Allows users to sign up, log in, verify email, and reset passwords using a flexible email and username-based custom user model. | `AbstractUser` |\n| Secure Token Access (JWT) | Authentication is handled via stateless JSON Web Tokens (JWT), providing secure access and refresh tokens. | `djangorestframework-simplejwt` |\n| API Documentation | Automatic, interactive API documentation (Swagger/Redoc) that is generated directly from your code. | `drf-spectacular`\n| Environments | Clean separation of configuration for development, and production using environment variables. | `django-environ`\n| Email | Email verification and password reset | `resend`\n\n\n### API Capabilities\n\nUser Model\nThe custom user model is based on AbstractUser and requires:\n- email (used for login and primary identity)\n- username (optional login method)\n- password (securely hashed)\n\n| Flow | Required Field | Success Outcome\n| :--- | :---:  | ---:\n| Registration | `email`, `username`, `password` | User account created and immediately verification email sent.|\n| Login | Either `email` or `username`, plus `password`. | Successful login returns user data, an Access Token, and a Refresh Token. |\n| Email Code | `email` | Using user email to confirm their identity and set is_verified = True. |\n| Resend Email Verification Code | `email` | Using user email to generate new verification code and set it to user email. |\n| Password Reset Request| `email` | User receives an email with a unique code to set a new password. |\n| Password Reset | `email` `code` `new password` | User reset password with code and new password. |\n\n\n\n### Setup \u0026 Customization Guide\n\nBefore starting, clone the repository and navigate into the root directory.\n\n1. Project Renaming (Crucial Step)\nThe internal configuration package is likely named config. To personalize your project, rename this directory and update all references.\n    - Rename the main configuration folder (e.g., mv config my_project_name).\n    - Globally Search and Replace the old package name (e.g., config) with your new name across all files (especially manage.py, wsgi.py, and any app imports).\n\n2. Environment Variables (.env)\n    - Create a `.env` file in the root directory based on the provided [.env.example](./.env.example) This file stores all secrets and environment-specific variables.\n    - Update database info\n    - Add your `RESEND_API_KEY` `FROM_NAME` and `FROM_EMAIL` in `.env` for sending verification codes user email \n\n3. Generate New Secret Keys\n    - Never use the default keys. Run the commands below in a Django shell and copy the output directly into your .env file.\n```bash\n   python manage.py shell\n   \u003e\u003e\u003e from django.core.management.utils import get_random_secret_key\n   \u003e\u003e\u003e print(get_random_secret_key()) # (Copy this output into your .env SECRET_KEY)\n```\n\n4. Adjust Settings Modules\n    - Your settings are split across modules. You primarily interact with environment variables, but can adjust framework settings here:\n\n   | File |Customization Focus |\n   | :--- | ---:  | \n   | `config/settings/base.py `| Update SPECTACULAR_SETTINGS and SIMPLE_JWT to match your application's requirements. | \n   | `config/settings/development.py` | Use this for local-only tools. | \n   | `config/settings/production.py` | Review security settings (SECURE_SSL_REDIRECT, CORS etc.) before deployment.. | \n\n5. Running the Application\n    - To ensure you use the correct configuration:\n\n   | Environment | `.env` |\n   | :---: | :---:  | \n   | development | `DJANGO_SETTINGS_MODULE=config.settings.development` |\n   | production | `DJANGO_SETTINGS_MODULE=config.settings.production` |\n\n6. Remove the lines bellow from [.gitignore](/.gitignore) if you want to keep tract of migrations\n    ```\n   */migrations/*.py\n   !*/migrations/__init__.py\n    ```\n\n### Project Structure\n```\n.\n├── authentication\n│   ├── __init__.py\n│   ├── admin.py\n│   ├── apps.py\n│   ├── migrations\n│   │   ├── __init__.py\n│   │   ├── 0001_initial.py\n│   │   ├── 0002_emailverification_passwordresetcode.py\n│   │   ├── 0003_rename_passwordresetcode_emailverificationmodel_and_more.py\n│   │   └── 0004_alter_customuser_first_name_and_more.py\n│   ├── models.py\n│   ├── serializer.py\n│   ├── tests\n│   │   ├── __init__.py\n│   │   ├── test_models.py\n│   │   ├── test_serializer.py\n│   │   └── test_views.py\n│   ├── uitls.py\n│   ├── urls.py\n│   └── views.py\n├── config\n│   ├── __init__.py\n│   ├── asgi.py\n│   ├── settings\n│   │   ├── base.py\n│   │   ├── development.py\n│   │   └── production.py\n│   ├── urls.py\n│   └── wsgi.py\n├── db.sqlite3\n├── LICENSE\n├── manage.py\n├── pytest.ini\n├── readme.md\n└── requirements.txt\n```\n\n\n### Setup and Installation\n```bash\npython -m venv venv\nsource venv/bin/activate\ngit clone https://github.com/fulanii/drf-boilerplate/\ncd drf-boilerplate\npip install -r requirements.txt\npython manage.py makemigrations \npython manage.py migrate\ngit remote set-url github.com/you-username/your-repo \n```\n\n### Contribute and Support \n\nWe welcome contributions and feedback! If you find a bug, have a suggestion for an improvement, or want to add a new feature:\n\n1.  **Open an Issue** to discuss the bug or feature idea.\n2.  **Fork the repository** and submit a **Pull Request** (PR) with your changes.\n\nIf this boilerplate saved you time, consider giving the repository a star ⭐!\n\n![docs](/assets/docs.png)\n![docs](/assets/admin.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffulanii%2Fdrf-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffulanii%2Fdrf-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffulanii%2Fdrf-boilerplate/lists"}