RevDock | Docs
Installation Guides

Django

Add RevDock to your Django application in under 2 minutes.

Works with Django 3.2+ and any template engine.

Setup

Open your base template

Find your base template, typically at templates/base.html.

Add the script

Insert the RevDock script inside the <head> section:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <script
      defer
      src="https://getrevdock.com/scripts/revdock.js"
      data-website-id="YOUR_WEBSITE_ID"
    ></script>

    {% block head %}{% endblock %}
  </head>
  <body>
    {% block content %}{% endblock %}
  </body>
</html>

Deploy

Push your changes. RevDock will be active on your next deployment.

Using Django settings

For better configuration management, add to settings.py:

REVDOCK_WEBSITE_ID = os.environ.get('REVDOCK_WEBSITE_ID', '')

Create a context processor in context_processors.py:

from django.conf import settings

def revdock(request):
    return {
        'REVDOCK_WEBSITE_ID': settings.REVDOCK_WEBSITE_ID,
    }

Register it in settings.py:

TEMPLATES = [
    {
        'OPTIONS': {
            'context_processors': [
                # ... other processors
                'yourapp.context_processors.revdock',
            ],
        },
    },
]

Then in your template:

<script
  defer
  src="https://getrevdock.com/scripts/revdock.js"
  data-website-id="{{ REVDOCK_WEBSITE_ID }}"
></script>

Using environment variables keeps sensitive data out of your codebase.

Verify it's working

  1. Deploy your changes
  2. Visit your live site
  3. Check the RevDock dashboard — widgets should appear within minutes

On this page