Best of DjangoJuly 2024

  1. 1
    Article
    Avatar of asayerasayer·2y

    Integrating React with Django

    This guide walks through the process of integrating a Django backend with a React.js front-end. It covers setting up a Django project, creating a REST API with Django REST Framework, and configuring CORS headers. On the front-end side, it explains how to create a React application, handle form submissions, and fetch data using Axios. The integration aims to create a dynamic web application where users can manage food and ingredients.

  2. 2
    Article
    Avatar of planetpythonPlanet Python·2y

    How to convert a Python script into a web app, a product others can use

    The post explains how to convert a Python utility script into a web app using Django and Django Rest Framework for the backend and React.js for the frontend. It describes the motivation behind building the app, the backend API design, authentication using JWT, and the deployment process using Docker. Additionally, it provides insights into the overall development lifecycle, emphasizing simplicity, speed, and gradual feature addition.

  3. 3
    Article
    Avatar of planetpythonPlanet Python·2y

    Multi-factor authentication in django

    Multi-factor authentication (MFA) is crucial for modern web applications. This guide explains how to implement both TOTP and FIDO2 authentication in Django using the django-mfa3 package and cbor-js for hardware token support. Key highlights include configuring templates, middleware, and views to enable MFA in your Django application.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    Database testing with fixtures and seeding

    Database testing requires both static seeding and fixtures to ensure reliable and consistent data. Static seeding provides essential data for applications to function, while dynamic seeding offers varied data for stress testing. Fixtures offer a controlled environment for specific test scenarios. Using seeding and fixtures alongside database branching can enhance testing by providing isolated and resettable environments.

  5. 5
    Article
    Avatar of lobstersLobsters·2y

    Gotchas with SQLite in Production

    SQLite is gaining attention as an excellent database for production web applications, especially for those seeking simplicity. Despite its suitability for many applications, it has several 'gotchas' that can pose challenges, including configuration, lack of network connections, issues with network and ephemeral file systems, concurrency limitations, transactional overhead, backup complexities, and migration limitations. While SQLite offers lower operational complexity, applications requiring multiple machines or heavy write workloads may find MySQL or Postgres more suitable.

  6. 6
    Article
    Avatar of communityCommunity Picks·2y

    Django Docker Tutorial with Postgres

    Learn how to start a new Django project, set it up to work in Docker for local development, and prepare it for production. This tutorial covers creating a Python virtual environment, building a Dockerfile, using docker-compose.yml, and managing environment variables. Following the best practices, it ensures a scalable, portable, and consistent development workflow.