Skip to content

seo4ajax/django-s4a

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Django-s4a

SEO4Ajax is a service that let you get full visibility on search engines, social networks and display advertising of any AJAX website based on Angular, React, Backbone, Ember, jQuery etc.

django-s4a is a middleware for Django. It provides an easy way to proxy GET requests from non-js clients (e.g. crawlers) to SEO4Ajax.

Usage

Copy the seo4ajax.py file in your project root.

Add the middleware in the MIDDLEWARE list in settings.py, e.g.

MIDDLEWARE = [
  'django.middleware.security.SecurityMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.middleware.clickjacking.XFrameOptionsMiddleware',
  'project.seo4ajax.Middleware'
]

Set the S4A_TOKEN environment variable with the SEO4Ajax token of your site.

How it works

This middleware checks the presence of a user-agent string identifying bots. If the user-agent is detected as a bot, it requests the snapshot on SEO4Ajax and returns it to the bot.

Requirements

About

SEO4Ajax middleware for Django

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages