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.
Installation
$ pip install django-simple-metatags
Configuration
Add ‘metatags’ to your INSTALLED_APPS:
INSTALLED_APPS = (
# ...
'metatags',
)
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>
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.