I'm excited to announce that I'll be leading a comprehensive tutorial at DjangoCon US 2022 titled "Using Django for Serving REST APIs with Permission Control and Customizing the Default Admin Panel." This session is scheduled for Sunday, October 16, from 1:30 PM to 5:00 PM PDT 2022.

Using Django for serving REST APIs with permission control and customizing the default admin panel
In the session, we will see how we can use Django to serve APIs. Create REST Endpoints quickly with DRF. Implement proper permissions on the REST endpoints, for example, an admin can perform any operation on any data. But a specific user can perform a limited operation on certain specific resources. Respond with different responses as per the defined user’s permission level. For example, the admin will get all the fields in the response, but a normal user will get only a selected field of the model. Implement Pagination on the REST endpoint. Create custom endpoints on the REST Endpoints.

Session Overview

In today's rapidly evolving digital landscape, the ability to develop robust and secure APIs is paramount. Equally important is the capacity to manage and customize administrative interfaces to suit specific project requirements. This tutorial is meticulously designed to address both aspects, providing participants with hands-on experience in:

  • Building RESTful APIs using Django Rest Framework (DRF): Learn to create efficient and scalable REST endpoints.
  • Implementing granular permission controls: Ensure that different user roles have appropriate access levels.
  • Customizing API responses based on user roles: Deliver tailored data outputs to various user groups.
  • Enhancing the default Django admin panel: Modify and extend the admin interface to better align with your project's needs.
  • Writing comprehensive tests for backend APIs: Develop reliable tests to maintain code integrity and performance.

Why This Session Matters

As web applications become more complex, the demand for seamless interaction between frontend and backend systems intensifies. APIs serve as the backbone of this interaction, enabling different systems to communicate effectively. Django Rest Framework has emerged as a powerful tool in this domain, offering a suite of features that streamline API development.

However, with great power comes great responsibility. Ensuring that APIs are secure, efficient, and tailored to specific user roles is crucial. This session delves deep into implementing permission controls, allowing developers to define precise access levels for various user groups. Such granularity not only bolsters security but also enhances user experience by providing relevant data to the right audience.

Moreover, the Django admin panel, renowned for its out-of-the-box functionality, often requires customization to meet unique project demands. This tutorial will guide participants through the process of tailoring the admin interface, ensuring that administrators have the tools they need to manage data effectively.

Key Takeaways for Participants

By attending this session, participants will:

  1. Master API Development with DRF: Gain proficiency in setting up RESTful APIs, handling requests and responses, and managing data serialization.
  2. Implement Robust Permission Controls: Learn to define and enforce permissions, ensuring that each user role has appropriate access to resources.
  3. Customize API Responses: Understand how to tailor data outputs based on user roles, enhancing the relevance and security of the information provided.
  4. Enhance the Django Admin Panel: Acquire skills to modify the admin interface, including adding custom fields, filters, and search capabilities, as well as customizing form displays and validations.
  5. Develop Comprehensive Tests: Learn to create model factories, integrate with Faker for realistic test data, and write parameterized tests using PyTest to ensure the reliability of your APIs.

Session Breakdown

1. Building RESTful APIs with Django Rest Framework

  • Introduction to DRF: Overview of its features and benefits.
  • Setting Up REST Endpoints: Step-by-step guide to creating API views and routers.
  • Serialization: Transforming complex data types into JSON and vice versa.

2. Implementing Permission Controls

  • Understanding Permissions: Different levels and their significance.
  • Setting Up Permissions in DRF: Configuring permissions for various user roles.
  • Custom Permission Classes: Creating bespoke permissions to meet specific requirements.

3. Customizing API Responses

  • Role-Based Responses: Delivering data tailored to user roles.
  • Field Selection: Dynamically modifying the fields returned in API responses.
  • Pagination: Implementing pagination to manage large datasets efficiently.

4. Enhancing the Django Admin Panel

  • Modifying Default Listings: Customizing the display of data in the admin interface.
  • Adding Custom Fields and Filters: Enhancing data management capabilities.
  • Incorporating Search Functionality: Improving data retrieval efficiency.
  • Customizing Forms and Validations: Tailoring form inputs and ensuring data integrity.
  • Overriding Admin Templates: Personalizing the look and feel of the admin panel.

5. Writing Comprehensive Tests

  • Setting Up Model Factories: Using factories to generate test data.
  • Integrating with Faker: Creating realistic data for testing purposes.
  • Writing Tests with PyTest: Developing and organizing test cases.
  • Parameterizing Tests: Running tests with multiple sets of data to ensure robustness.

Who Should Attend

This tutorial is ideal for developers who:

  • Are familiar with Django and seek to expand their skill set to include API development.
  • Aim to implement fine-grained permission controls in their applications.
  • Wish to customize the Django admin panel to better align with their project's requirements.
  • Are interested in adopting best practices for testing backend APIs.

Whether you're a seasoned developer or relatively new to Django, this session offers valuable insights and practical knowledge to enhance your projects.

Register Here

Using Django for serving REST APIs with permission control and customizing the default admin panel
In the session, we will see how we can use Django to serve APIs. Create REST Endpoints quickly with DRF. Implement proper permissions on the REST endpoints, for example, an admin can perform any operation on any data. But a specific user can perform a limited operation on certain specific resources. Respond with different responses as per the defined user’s permission level. For example, the admin will get all the fields in the response, but a normal user will get only a selected field of the model. Implement Pagination on the REST endpoint. Create custom endpoints on the REST Endpoints.

About Me

I am a full-stack developer with extensive experience in Django, Flask, and FastAPI for backend development, and ReactJS for frontend development. My professional journey includes entrepreneurial ventures, such as founding a digital publishing platform and a data science company. Currently, I serve as