/django-rest-starter-kit

This is a starter template for Django REST Framework (DRF) projects, designed to provide a solid foundation with essential features commonly needed in API development.

Primary LanguagePythonApache License 2.0Apache-2.0

Django REST Framework Starter Kit

This is a starter template for Django REST Framework (DRF) projects, designed to provide a solid foundation with essential features commonly needed in API development.

Features

  • Token-Based Authentication: Secure your API endpoints using token-based authentication.
  • Swagger API Documentation: Automatically generate interactive API documentation using Swagger UI.
  • User Management System: Implement user registration, login, logout, and password reset functionalities.
  • Permissions and Roles: Define user roles and permissions to control access to API endpoints.
  • Email Notifications: Set up email notifications for user-related events like registration and password reset.
  • Rate Limiting: Prevent abuse of API endpoints by implementing rate limiting.
  • File Uploads: Support file uploads (e.g., images, documents) with customizable storage backends.
  • Caching: Improve API performance with caching for frequently accessed data.
  • Background Tasks: Perform background tasks asynchronously using Celery and a message broker.
  • Monitoring and Logging: Monitor application performance and track errors with logging and monitoring tools.

Usage

  1. Clone this repository:

    git clone https://github.com/hossainchisty/django-rest-starter-kit.git
  2. Install dependencies:

    pip install -r requirements.txt
  3. Customize settings:

    • Configure database settings in settings.py.
    • Set up email configuration for sending notifications.
    • Configure token authentication settings.
    • Customize permissions and roles according to your application's requirements.
  4. Migrate the database:

    python manage.py migrate
  5. Run the development server:

    python manage.py runserver
  6. Access the API documentation:

    Open your browser and navigate to http://127.0.0.1:8000/swagger/ to view the interactive API documentation generated by Swagger UI.

  7. Start building your API endpoints:

    • Define your API endpoints in urls.py.
    • Implement views and serializers for your API resources in views.py and serializers.py respectively.
    • Secure your endpoints using token authentication and define permissions as needed.

Testing

Run unit tests and integration tests to ensure the reliability and stability of your API:

python manage.py test

Contributing

Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.

License

This project is licensed under the Apache-2.0 license - see the LICENSE file for details.