Skip to main content

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

Project description

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

https://secure.travis-ci.org/whitespy/django-simple-metatags.png

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-0.9.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

django_simple_metatags-0.9.2-py2-none-any.whl (16.3 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django-simple-metatags-0.9.2.tar.gz
Algorithm Hash digest
SHA256 beb5cdb6901aff638031eb7dbaadb75079705aa181a9dbab2125b882c2b8b833
MD5 91bf79540cae87d4444e96921170c68c
BLAKE2b-256 88fbf99cdfc0b64788a6bfe486aac8794b875f64ecae09e6bad00995261fca63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_simple_metatags-0.9.2-py2-none-any.whl
Algorithm Hash digest
SHA256 a16c26c279f8b3682c46d01d88ab67bad496f5c547c94f9a35b61cfd6a496e26
MD5 c2872a44051262d1eff3d390f7b92e83
BLAKE2b-256 b30ffc8b627c2246239e449c4a245788b7ed4dd4f3c555b519c510aecfb26250

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