https://github.com/rehman199/django
A production-ready Django REST Framework starter template featuring JWT authentication, Celery integration for async tasks. Perfect for kickstarting secure and scalable REST API projects.
https://github.com/rehman199/django
api celery django django-rest-framework jwt-authentication postgresql python redis rest-api starter-template
Last synced: 2 months ago
JSON representation
A production-ready Django REST Framework starter template featuring JWT authentication, Celery integration for async tasks. Perfect for kickstarting secure and scalable REST API projects.
- Host: GitHub
- URL: https://github.com/rehman199/django
- Owner: rehman199
- Created: 2025-01-03T10:10:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-08T19:14:27.000Z (over 1 year ago)
- Last Synced: 2025-01-08T19:44:32.780Z (over 1 year ago)
- Topics: api, celery, django, django-rest-framework, jwt-authentication, postgresql, python, redis, rest-api, starter-template
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Django REST API Starter Template
A production-ready Django REST Framework starter template with JWT authentication and Celery integration for asynchronous task processing.
## Features
- 🔐 JWT Authentication using `djangorestframework-simplejwt`
- 🚀 Celery integration for background tasks
- 🔄 REST API using Django REST Framework
- 🛡️ Secure by default configuration
## Prerequisites
- Python 3.8+
- Redis (for Celery)
- PostgreSQL
## Quick Start
1. Clone the repository
```bash
git clone https://github.com/rehman199/django
cd django
```
2. Set up a virtual environment
```bash
python -m venv venv
source venv/bin/activate
# On Windows use: venv\Scripts\activate
```
3. Install dependencies
```bash
pip install -r requirements.txt
```
4. Set up environment variables
```bash
cp .env.example .env
# Edit .env with your configuration
```
5. Run migrations
```bash
python manage.py migrate
```
6. Start the development server
```bash
python manage.py runserver
```
7. Start Celery worker
```bash
celery -A django worker -l info
```
## API Endpoints
### Authentication
## API Endpoints
### Authentication
- `POST /api/auth/register` - Register a new user
- `POST /api/auth/login` - Login and obtain JWT tokens
- `POST /api/auth/token/refresh` - Refresh JWT token
- `POST /api/auth/verify-email` - Verify user's email address
- `GET /api/auth/me` - Get current user's details
- `POST /api/auth/logout` - Logout user
- `POST /api/auth/reset-password` - Request password reset
- `POST /api/auth/reset-password/verify` - Verify password reset token
- `POST /api/auth/reset-password/submit` - Submit new password
Each endpoint expects and returns JSON data. For detailed request/response formats, refer to the API documentation.
Note: All endpoints except `register`, `login`, and password reset-related endpoints require a valid JWT token in the Authorization header: `Authorization: Bearer `.
## Celery Tasks
The project includes Celery for handling asynchronous tasks. Tasks can be found in the respective app directories under the `tasks.py` files.
## Development
1. Make sure all tests pass:
```bash
python manage.py test
```
2. Check code style:
```bash
flake8
```
## Deployment
This project is deployment-ready for platforms like:
- Heroku
- DigitalOcean
- AWS
Refer to the deployment documentation for platform-specific instructions.
## Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.