Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 2.22 KB

choosing_wagtail_page_models_vs_django_models.md

File metadata and controls

34 lines (23 loc) · 2.22 KB

Choosing Between Wagtail Page Models and Django Models

Generated by ChatGPT and edited by me. While I didn't write this, I did review it closely and it does reflect my experience.

Discussion of the pros and cons to using a combination of Django models and Wagtail Page models in a Wagtail project, or only using Wagtail Page models for most objects. This was created in the context of an e-commerce platform.

Using Only Wagtail's Page Model

Pros

  • Integrated CMS Features: Leverages Wagtail's built-in features like hierarchical structuring and rich text editing.
  • Simplicity: Simplifies the architecture by avoiding additional models.
  • SEO and Navigation: Benefits from Wagtail's SEO tools and site navigation integration.

Cons

  • Performance Issues: The generic nature of the Page model may not be as efficient for a large catalog of products.
  • Limited Flexibility: May find it challenging to manage complex relationships and queries with a more extensive product structure.

Integrating Custom Django Models

Pros

  • Performance and Scalability: Custom models can be optimized for better performance with large datasets.
  • Flexibility: Allows for a tailored database schema, making it easier to implement complex relationships and business logic.
  • Separation of Concerns: Offers a cleaner, more modular architecture by separating e-commerce functionality from content management.

Cons

  • Increased Complexity: Adds complexity to the application, requiring manual integration between Wagtail pages and Django models.
  • Integration Effort: Some of Wagtail's out-of-the-box benefits need to be manually implemented for Django models.

Takeaway

  • Simple Applications: If the product catalog is modest and the product structure is straightforward, using Wagtail's Page model might suffice.
  • Complex Applications: For platforms with a large number of products, complex attributes, or sophisticated business logic, integrating custom Django models with Wagtail pages is advisable for greater flexibility and performance.

This decision should be based on the specific needs of the project, including the size of the product catalog, complexity of product data, and scalability requirements.