Skip to main content

Django Model to Python dict serialization mixin.

Project description

Django Model to Python dict serialization mixin.

Based on the original gist:


Currently the package is tested with Python3 and Django 1.10 only.


The full documentation is at


Install Django-Model-To-Dict:

pip install django-model-to-dict

Add it to your INSTALLED_APPS:

    # or just 'django_model_to_dict'

Use ToDictMixin with your model:

from django_model_to_dict.mixins import ToDictMixin
from django.db import models

class YourModel(models.Model, ToDictMixin):

Since now you model’s instances have the to_dict method defined.

You can setup additional settings both in your global project configuration or in a particular model. See docs for more details.


  • TODO

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox


Tools used in rendering this package:


0.1.0 (2016-12-15)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_model_to_dict-0.2.1-py2.py3-none-any.whl (11.0 kB) Copy SHA256 hash SHA256 Wheel 3.4
django-model-to-dict-0.2.1.tar.gz (10.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page