Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redsolutioncms.django-seo

Package Overview
Dependencies
Maintainers
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redsolutioncms.django-seo

Adds generic SEO fields for objects in your site or specific urls

  • 0.3.5
  • PyPI
  • Socket score

Maintainers
5

========== django-seo

Seo fields for objects of any model registed in admin or for specified url.

Installation:

  1. Put seo as LAST item to your INSTALLED_APPS in your settings.py within your django project.

  2. Sync your database::

    ./manage.py syncdb

Usage:

In settings.py:

Add names of ModelAdmins to be override::

SEO_FOR_MODELS = [
    '<app>.models.<Model>',
]

In template:

First of all, load the seo_tags in every template you want to use it::

{% load seo_tags %}

Use:: {% seo <title|keywords|description> [for ] %}

Or:: {% seo <title|keywords|description> [for ] as %} {{ }}

Example:

settings.py::

INSTALLED_APPS = (
    ...
    'app',
    ...
    'seo',
)

SEO_FOR_MODELS = [
    'app.models.Object',
    'app.models.Another',
]

templates/object.html::

{% load seo_tags %}
<html>
    <head>
        <meta name="description" content="{% seo description for object %}" />
        <meta name="keywords" content="{% seo keywords for object %}" />
        <title>{% seo title for object %}</title>
    </head>
    <body>
        {{ object.content }}
        <h1>{% seo title for object as seo_title %}{{ seo_title }}</h1>
    </body>
</html>

If you are using extend

templates/base.html::

<html>
    <head>
        <meta name="description" content="{% block description %}{% seo description %}{% endblock %}" />
        <meta name="keywords" content="{% block keywords %}{% seo keywords %}{% endblock %}" />
        <title>{% block title %}{% seo title %}{% endblock %}</title>
    </head>
    <body>
        {% block content %}{% endblock %}
    </body>
</html>

templates/object.html::

{% load seo_tags %}
{% block description %}{% seo description for object %}{% endblock %}
{% block keywords %}{% seo keywords for object %}{% endblock %}
{% block title %}{% seo title for object %}{% endblock %}

{% block content %}
    {{ object.content }}
{% endblock %}

templates/another.html::

{% load seo_tags %}
{% block description %}{% seo description for another %}{% endblock %}
{% block keywords %}{% seo keywords for another %}{% endblock %}
{% block title %}{% seo title for another %}{% endblock %}

{% block content %}
    {{ another.content }}
{% endblock %}

Redsolution CMS classifiers:

Content plugins_

.. _Content plugins: http://www.redsolutioncms.org/classifiers/content

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc