Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Simple SEO Module for Django

Project description

Simple cache backend for Django. Inspired by django-seo ( ) but found it quite complex for the simple functionality it was intended for.

django-simple-seo aims to attach a model to your views with just 4 simple lines of code and everything configured by the admin.

What’s in django-simple-seo

  • Python 2.7, 3.2, 3.3, 3.4 and Django 1.4, 1.5 and 1.6
  • View Autodiscovering
  • Pure Django Models and Django Fields implementation, no metaclasses in action
  • Don’t reinvent the wheel: as long as they are django models you can use the goodies out there
  • i18n with django-vinaigrette, django-linuo, django-modeltranslation, etc.
  • Cache can be activated internally, but can also be used with johnny-cache, django-cache-machine, etc.
  • Easily extendible as far as it’s all about simple django models and fields
  • Support for UrlFields and ImageFields in admin
  • Test app included (.testapp)

What’s NOT in django-simple-seo

  • Only implements view based backend. Maybe in future releases it will include Model and Path backend like in DjangoSeo.


You can use pip like this:

$ pip install django-simple-seo

You can use pip with git master code instead of pypi version:

$ pip install git+

1. Create your SEO Model

Create a model subclassing the classes BaseMetada(title, author, description, keywords), OpenGraphMetada(includes facebook tags) or AllMetadata(Facebook and Twitter)

from simple_seo.models import AllMetadata
from simple_seo import register

class MyMetadata(AllMetadata):
    My Seo Model

# Register SEO Model

2. Synchronize your DB

Synchronize your database with syncdb or migrate depending on your case:

$ ./ syncdb

3. Register your model for administration

Add this lines to your

from simple_seo.admin import BaseMetadataAdmin
from django.contrib import admin
from .models import MyMetadata

class MyMetadataAdmin(BaseMetadataAdmin):
    pass, MyMetadataAdmin)

4. Add metadata for your views

Your views are autodiscovered for your convenience, create a metadata object for every view you want to administer


5. Add metadata to your template

Just include this template tag in your <head> section:

{% load simple_seo %}
<!DOCTYPE html>
<head lang="en">
    <meta charset="UTF-8">
    {% view_metadata %}

6. Extend/Override default behaviour

“I prefer to have images as URLs, not static files in my server”

Just override og_image attribute. You can find all base models in simple_seo.models, and all tag fields in simple_seo.fields:

from simple_seo.fields import URLMetaTagField, MetaTagField
from simple_seo.models import AllMetadata
from simple_seo import register

class MyMetadata(AllMetadata):
    My Seo Model
    og_image = URLMetaTagField(name="og:image")  # Overrides default og:image field
    another_meta_tag = MetaTagField(name="myvariable", max_length="25")  #  Creates a new custom meta tag for the views

# Register SEO Model

7. Sample App

You have a complete sample app in testapp module in this repository.


Version 0.2

  • Added support for namespaced views
  • Added support for ImageField based Image Metatags (og:image, twitter:image)
  • Added support for UrlField based URL Metatags (og:url, twitter:url)
  • Added more base classes to ease setup

Project details

Download files

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

Files for django-simple-seo, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size django-simple-seo-0.2.0.tar.gz (7.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page