Giter Site home page Giter Site logo

django-painless-seo's Introduction

Django PainlessSEO

PyPI version PyPI downloads

Features

This app provides two ways of adding SEO metadata to your django site:

  • Absolute paths
  • Model instances

It's fully integrated with the admin site including inline forms for models. It also includes support for multiple languages and localized URLs.

Requirements

Django >= 1.5.0

Installation

The Git repository can be cloned with this command:

git clone https://github.com/Glamping-Hub/django-painless-seo.git

The painlessseo package included in the distribution should be placed on the PYTHONPATH. Add painlessseo to the INSTALLED_APPS in your settings.py. Run syncdb command to create the needed tables.

Settings

PainlessSEO uses two configuration variables in order to define the default information that will be displayed if the URL has no SEO metadata related. You have to add them to your settings.py:

SEO_DEFAULT_TITLE = 'Lorem ipsum title'
SEO_DEFAULT_DESCRIPTION = 'Lorem ipsum description'

### Registering Models

To create synced SEO metadata for model instances you have to define the SEO_MODELS variable in your settings.py like this:

SEO_MODELS = (
    ('myapp', 'mymodel'),
    ('anotherapp', 'anothermodel'),
)

After registering the models, you can add the inline form to the admin instance for each model:

from painlessseo.admin import SeoMetadataInline

class MyModelAdmin(admin.ModelAdmin):
    inlines = [SeoMetadataInline, ]

Now every time you save a model instance through the admin site, the SEO metadata will be updated automatically.

SEO Output

As simple as loading the seo template library and using the get_seo template tag like this:

{% load seo %}

<head>
    {% get_seo %}
</head>

Notes

Why PainlessSEO does not include keywords meta tag.

Legal Stuff

This software is licensed under the terms of the BSD 3-clause license. You can find the whole text of the license in the LICENSE file.

django-painless-seo's People

Contributors

ablanco avatar akegalj avatar hginer avatar lampslave avatar

Watchers

 avatar  avatar  avatar

Forkers

revolucija

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.