Skip to content

A basic example of how to use mixins with your Django models

Notifications You must be signed in to change notification settings

BrockHerion/django-model-mixins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Model Mixin Example

This is a simple example of using mixins with Django models. This is more of simple how-to, not an actual, full fledged demo. You are more than welcome to fork this repository and build out more logic yourself!

Directories

  • config - Contians Django project files (settings.py, wsgi.py, etc)
  • core - Contains all core logic that our other apps can use. Check models.py to see small, contianed models that we can use to create any number of mixins. In mixins.py, you will an example of creating a mixin with a few base models.
  • account - A normal, Django app. In the models.py file, you will find an example of a model that inherits a base model and uses a mixin.

You can find the article for this repository on my blog at https://www.brockherion.com/creating-reusable-models-with-django-and-mixins/

or on Medium at https://brockjosephherion.medium.com/creating-reusable-models-with-django-and-mixins-2126c5f11eac

About

A basic example of how to use mixins with your Django models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages