Django Portfolio

Project information

  • GitHub URL: https://github.com/DoriDoro/django_portfolio
  • create date: June 19, 2024
  • Skills:

    Python

    Django

    Django Testing Tool: TestCase

    Git

    GitHub

    GitHub actions

    Branching

    SQLite

    SQL

    ERD (Entity-Relationship Diagram)

    Sentry

    Docker

    Render

    Flake8

    PEP8

    HTML5

    CSS3

    CI/CD

    Makefile

    Bootstrap


Introduction

This Django portfolio project serves as the foundation for a sophisticated multilingual website designed to showcase personal projects. Although still a work in progress, the project already integrates essential backend features such as language translation, automated content management, and a robust CI/CD pipeline. The frontend uses a customized Bootstrap HTML-CSS template, while all backend logic and implementation are original.

Project Highlights:

      • Multilingual Translation: Complete translation into German and French using django-modeltranslation.
      • Rich Text Content Creation: Integrated TinyMCE for easy and dynamic content management.
      • SEO Optimization: Implemented SEO-friendly slugs for improved discoverability.
      • Automated Data Management: Custom Django Management Commands for bulk data creation.
      • Class-Based Views: Used CBVs for modular and reusable code architecture.
      • Basic Testing: Established unit tests for models and views using Django TestCase.
      • Docker and CI/CD Pipeline: Containerized with Docker and automated CI/CD with GitHub Actions.
      • Error Monitoring with Sentry: Real-time error reporting and monitoring in production.
      • Production-Ready Setup: Configured for high performance and scalability.
      • ERD Documentation: Created an ERD to document the database schema.

This portfolio project exemplifies the integration of multilingual support, automated content management, and modern deployment practices, while maintaining a strong focus on code quality and performance. It sets the foundation for a sophisticated, production-grade application that can be easily extended and maintained as the project grows.


Competences

    • working in production environment - the Django portfolio is deployed on Render but still a Work in Progress
    • website available in English, German and French
    • add a rich-text editor (TinyMCE Editor)
    • add packages: django-modeltranslation, Pillow, django-tinymce
    • for image saving, use Pillow
    • create a Docker image, host the Docker image on Docker Hub
    • use GitHub actions for CI/CD
    • deploy the Django project on Render


Learning Experience

    1. Multilingual Support and Translation Management

      A major focus of this project was to implement multilingual support for the entire portfolio. Besides English, the website is being translated into German and French, ensuring accessibility to a broader audience. To streamline this process, I utilized the django-modeltranslation package, which provides seamless integration for translating all models and content. This package significantly simplifies the translation management, allowing the entire site to be easily updated and maintained in multiple languages.

      Language Support:

      • English (default)
      • German
      • French
    2. Rich Content Management with TinyMCE

      To enhance content creation for the portfolio, I integrated TinyMCE, a rich text editor that provides a user-friendly interface for composing and formatting project descriptions, articles, and other textual content. This editor supports dynamic content creation, enabling easy management and styling of text-based information. With this setup, adding new projects or updating existing content is efficient and intuitive, eliminating the need for manual HTML editing.

    3. SEO-Friendly Slug Integration

      SEO optimization was a core consideration when designing the project’s URL structure. I added slug attributes to key models, enabling human-readable and SEO-friendly URLs for portfolio entries. This ensures that project pages are easily discoverable by search engines, improving visibility and accessibility for users searching for specific projects or topics.

    4. Automated Data Management with Django Management Commands

      To automate repetitive data entry and streamline the setup process, I developed custom Django Management Commands. These commands allow for the bulk creation of portfolio model instances, pulling data from a pre-defined JSON file. This approach not only speeds up development but also makes it easy to populate the database with sample content during testing or when deploying the application to a new environment.

    5. Class-Based Views for Modular and Reusable Code

      I used class-based views (CBVs) to implement the core functionality of the website, ensuring a modular and reusable codebase. CBVs offer a clean structure for handling common tasks such as displaying project details, managing language-specific content, and performing CRUD operations, making the code easier to maintain and extend as the project evolves.

    6. Basic Testing with Django TestCase

      To validate core functionalities, I created basic unit tests using Django’s TestCase for models and views. These tests ensure that the creation of multilingual content, slug generation, and CRUD operations work as expected, providing a solid foundation for future test expansion as more features are added.

    7. Docker Containerization and CI/CD Pipeline

      A Dockerfile was created to containerize the application, ensuring a consistent environment for development and production. The Docker image is hosted on Docker Hub, making deployment straightforward and repeatable. Additionally, a CI/CD pipeline was set up using GitHub Actions, automating tasks such as code linting, running tests, and building Docker images with each commit. This setup enables continuous integration and ensures code quality remains high throughout development.

    8. Sentry Integration for Error Monitoring

      To monitor and manage errors in the production environment, I integrated Sentry. This tool captures and reports any issues that arise, providing detailed insights and stack traces for debugging. Sentry’s real-time alerts help maintain the stability and reliability of the application, ensuring that any bugs are addressed promptly.

    9. Production-Ready Deployment

      With a production-ready setup, the portfolio project is configured to handle real-world traffic and scaling. The use of environment-specific settings and a containerized architecture makes it easy to deploy updates and roll out new features. This setup is designed to support future growth, ensuring a stable foundation for ongoing development.

    10. Entity Relationship Diagram (ERD) for Model Schema

      To document the database structure and illustrate relationships between various models, I created an Entity Relationship Diagram (ERD). This visual representation helps convey the schema’s design, making it easier for contributors to understand the data flow and dependencies within the application.

Designed by BootstrapMade and modified by DoriDoro