The example app

django-rest-framework-datatables comes with an example application (the Rolling Stone top 500 albums of all time). It’s a great start for understanding how things work, you can play with several options of Datatables, modify the python code (serializers, views) and test a lot of possibilities.

We encourage you to give it a try with a few commandline calls:

$ git clone
$ cd django-rest-framework-datatables
$ pip install -r requirements-dev.txt
$ python example/ runserver
$ firefox

A screenshot of the example app:



You can use Postgres as the source database. This example uses Docker as a container for the database.

Initialise the database as follows:

$ export DRFDT_TEST_TYPE=postgres
$ export DJANGO_SETTINGS_MODULE=example.settings

$ # start a local postgres instance
$ docker-compose -f example/pg/docker-compose.yml up -d

$ python example/ migrate
$ python example/ test

$ # only required if you want to login to the Admin site
$ python example/ createsuperuser --username admin

$ # load test data
$ python example/ loaddata test_data

$ # shutdown the db (append -v to remove the data volume and delete all data)
$ docker-compose -f example/pg/docker-compose.yml down