Django
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Trusted by developers worldwide for building scalable web applications.
Install Translate.website on Django
Running your web application on Django? You don't need custom packages, pip installs, or changes to settings.py to make your Django site multilingual.
By adding a single script tag to your Django base template, you can inject the Translate.website script across your entire site instantly. Django's template inheritance means you only need to add it once — in your base template — and it automatically applies to every page that extends it.
Once set up, Translate.website will automatically detect visitor language preferences and display translated content in real time — with no changes to your Django views, models, or URL configuration.
This guide walks you through the entire setup from start to finish.
Add Translate.website to Your Django Base Template
Django's template inheritance system makes this straightforward — add the script once to your base template and it loads on every page automatically. Here's exactly how to do it.
Before You Begin
- An active Translate.website account with your snippet ready.
- A Django project with a base template that other templates extend.
- Access to your Django template files.
- No Django packages, pip installs, or settings.py changes required.
Get Your Translate.website Snippet
Log in to your Translate.website dashboard and retrieve your unique script snippet.
- Log in to app.translate.website
- Go to Settings → Snippet
- Copy the full <script> tag including your unique data-site-id
- Keep it ready to paste into your Django template
Add the Script to Your Base Template
In most Django projects, all pages extend a base template (typically base.html or base_template.html). This is the correct place to inject the Translate.website script so it loads on every page.
- Open your base Django template — usually templates/base.html or templates/base_template.html.
- Find the {% block head %} or the </head> closing tag inside your template.
- Paste your Translate.website snippet just before </head>.
- Example: {% block extra_head %}{{ block.super }}<script src='...'></script>{% endblock %}
- Save the template file.
- If your templates are in an app's templates/ folder, find the one that all other templates extend.
Run Django and Verify
Start your Django development server and verify the integration.
- Run: python manage.py runserver
- Open http://localhost:8000 in your browser.
- Open DevTools → Network and look for the Translate.website script.
- The translation widget should appear on your Django pages.
- Deploy to production using your normal Django deploy process (Gunicorn, uWSGI, etc.).
🚀 What Happens After Saving?
Once added to your base template, Django will render the Translate.website script into every page that extends it. Translate.website automatically detects visitor language preferences and displays translated content in real time.
The script works independently of Django's i18n framework — you can use both together or use Translate.website as a standalone solution.
⚠ Recommended: Clear Cache
If you're using any caching middleware or a CDN in front of your Django app, clear your cache after saving the template to ensure the updated HTML (with the script) is served to all visitors immediately.
🔁 Safe & Reversible
This integration is completely reversible. To remove Translate.website from your Django site, simply delete the script tag from your base template and save. No Django packages were installed, no settings were changed, and nothing was permanently altered in your Django project.
💡 Why This Method Is Recommended
- Works with Django's template inheritance — add once to base.html, applies everywhere.
- Compatible with all Django versions (2.x through 5.x) and all template engines.
- No changes to settings.py, INSTALLED_APPS, or URL configuration.
- Fully reversible — remove the script tag from your template to uninstall instantly.
Ready to make your Django site multilingual?
Add one script to your base.html and your entire Django site supports 100+ languages.