Demo application


Demo application is a simple bookshelf with the following models:

class, name, rank)
class, first_name, last_name, rank)
class, title, publisher, publication_date, price)

On each entering to single book view the following python code executed:

# sites/dev/books/
class BookDetail(generic.DetailView):
    model = Book

    def get_object(self, queryset=None):
        book = super(BookDetail, self).get_object(queryset)
        program = Program.objects.get(code='on_book_view')
        version = program.versions.order_by('id').last()
        version.execute(context=Context(debug=True, log=True), book=book)

        return book

You can see screenshots now: Demo code editing and Demo code execution log

Hosted demo

Hosted demo site is available here: . The database is reset every hour. You can login into django admin interface with username test and password test.

Running using Docker

You can run demo app locally using docker:

docker build . -t django-business-logic-demo
docker run --rm -it -p 8000:8000 django-business-logic-demo

or using docker-compose:

docker-compose up

Also you can use prebuilt image:

docker run --rm -it -p 8000:8000 dgksu/django-business-logic:demo

Now you can login into django admin interface http://localhost:8000/admin/ with username test and password test.

Deployment to Heroku

You can deploy demo app directly to Heroku to see the app live. Just click the button below. This will walk you through getting this app up and running on Heroku in minutes.

Running using local files

See Backend development environment