Skip to main content

The django application, that allows attach title, keywords and description meta tags for site's pages.

Project description

https://secure.travis-ci.org/whitespy/django-simple-metatags.svg https://badge.fury.io/py/django-simple-metatags.svg

The django application, that allows attach title, keywords and description meta tags for site’s pages.

Installation

$ pip install django-simple-metatags

Configuration

  1. Add ‘metatags’ to your INSTALLED_APPS:

INSTALLED_APPS = (
    # ...
    'metatags',
)
  1. Run migrate to create the application table:

$ python manage.py migrate metatags

3. Include meta tags for model, add MetaTagInline in inlines of your ModelAdmin subclass (also django-simple-metatags has the own ModelAdmin class, that allows add meta tags for URL-paths):

from metatags.admin import MetaTagInline

class CustomModelAdmin(admin.ModelAdmin):
    # ...
    inlines = (MetaTagInline,)

4. Load meta_tags template library and create meta_tags template block in HTML head section. Add include_meta_tags template tag in meta_tags block:

{% load meta_tags %}
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    {% block meta_tags %}
        {% include_meta_tags %}
    {% endblock %}
</head>

Arguments of include_meta_tags template tag

All arguments are optional.

model_instance - Model instance, to get meta tags. None by default.

model_title_field - Model’s field, that can be used as title if meta tags title field is blank. ‘title’ by default.

default_title - Title of page by default. Used with URL-path. No sense, when the model_instance argument was passed. ‘’ by default.

default_keywords - Keywords by default.

default_description - Description by default.

Management command

syncmetatags - adds translation fields, when the django-modeltranslation application is used.

Project details


Download files

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

Source Distribution

django-simple-metatags-1.0.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

django_simple_metatags-1.0.0-py2-none-any.whl (15.7 kB view details)

Uploaded Python 2

File details

Details for the file django-simple-metatags-1.0.0.tar.gz.

File metadata

File hashes

Hashes for django-simple-metatags-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f1dc4cba3fb06777e8e468985134809844851ee64f58e87f0b9b4ec77b2cd95f
MD5 4a5a9e384a311df758317c3e12b305e8
BLAKE2b-256 8c467c1b97163b537e47829b3325f1d9f505ba0fe3b73f7e4a3cec7e270a2d1f

See more details on using hashes here.

File details

Details for the file django_simple_metatags-1.0.0-py2-none-any.whl.

File metadata

File hashes

Hashes for django_simple_metatags-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 c2a333d69338cd2332a34adb60e4cde4ac871428d871ed8d8e82d9d6ab958b05
MD5 317c4b3da7e72f6cb311e98996948267
BLAKE2b-256 a4eafd495a24bc75ea7204391186503cf2df2ed25a32b096087028ae3598fa66

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page