Coder Social home page Coder Social logo

nephila / djangocms-page-meta Goto Github PK

View Code? Open in Web Editor NEW
60.0 8.0 62.0 566 KB

OpenGraph, Twitter Card and Google+ snippet tags for django CMS 3 pages

Home Page: https://djangocms-page-meta.readthedocs.io/

License: BSD 3-Clause "New" or "Revised" License

Python 96.65% CSS 0.05% HTML 3.29%
django django-cms python seo social-network metatags hacktoberfest

djangocms-page-meta's Introduction

djangocms-page-meta

Join the Gitter chat Latest PyPI version Python versions Latest CI build status Test coverage Code Climate License

Meta tag information for django CMS 3 pages

Python: 3.9, 3.10, 3.11

Django: 3.2, 4.1, 4.2

django CMS: 3.9, 3.11

Quickstart

  1. A working django CMS environment is required for djangocms-page-meta to work. Refer to django CMS documentation for how to install and configure django CMS.

  2. Install djangocms-page-meta:

    $ pip install djangocms-page-meta
    

    or from the repository:

    pip install -e git+https://github.com/nephila/djangocms-page-meta#egg=djangocms-page-meta
    
  3. Then add it to INSTALLED_APPS along with its dependencies:

    "filer",
    "meta",
    "easy_thumbnails",
    "djangocms_page_meta",
    
  4. Migrate the database:

    $ python manage.py migrate
    
  5. Configuration:

    See usage and configuration section in the documentation.

  6. That's all!

Note

Enabling this will hide django CMS own Meta description field to keep all the meta information in the same part of the interface. If the django CMS field is set, it will still be shown (and used by djangocms-page-meta).

django-app-enabler support

django-app-enabler is supported.

You can either

  • Installation & configuration: python -mapp_enabler install djangocms-page-meta
  • Autoconfiguration: python -mapp_enabler enable djangocms_page_meta

Fully using this package will require some template changes that cannot be modified by django-app-enabler:

  • Load template tag in the page like outlined in usage page;
  • Run migrations: python manage.py migrate

Check usage documentation for details.

Dependencies

Documentation

For package documentation see https://djangocms-page-meta.readthedocs.io/.

djangocms-page-meta's People

Contributors

corentinbettiol avatar dependabot-preview[bot] avatar djkazic avatar dsax64 avatar flimm avatar granteagon avatar kuvandjiev avatar maestrofjp avatar marksweb avatar mbi avatar n-zav avatar peterw-lwl avatar pre-commit-ci[bot] avatar protoroto avatar sergei-maertens avatar skirsdeda avatar synasius avatar treavis avatar vstoykov avatar vxsx avatar wesleyboar avatar yakky avatar zanderle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

djangocms-page-meta's Issues

Errors masking in the gunicorn errors log

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 130, in handle
    self.handle_request(listener, req, client, addr)
  File "/usr/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 171, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 177, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in get_response
    response = self.get_exception_response(request, resolver, 404, exc)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 102, in get_exception_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 296, in handle_uncaught_exception
    return callback(request, **param_dict)
  File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/defaults.py", line 63, in server_error
    return http.HttpResponseServerError(template.render())
  File "/usr/local/lib/python2.7/site-packages/django/template/backends/django.py", line 95, in render
    return self.template.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 206, in render
    return self._render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 197, in _render
    return self.nodelist.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 992, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 959, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 173, in render
    return compiled_parent._render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 197, in _render
    return self.nodelist.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 992, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 959, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python2.7/site-packages/classytags/core.py", line 153, in render
    return self.render_tag(context, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/djangocms_page_meta/templatetags/page_meta_tags.py", line 23, in render_tag
    language = get_language_from_request(context['request'])
  File "/usr/local/lib/python2.7/site-packages/django/template/context.py", line 77, in __getitem__
    raise KeyError(key)
KeyError: u'request'

Real error traceback overlap with such error and we can not see the real trace. Can we do something with this?

packages versions:
Django==1.9.12
django-cms==3.4.2
djangocms-page-meta==0.6.3

Migration '0002_auto_20150730_2004.py' is created in app 'djangocms_page_meta' after run command 'makemigrations'

I use django 1.8.3
I have tested with djangocms-page-meta (0.5.1, 0.5.2, 0.5.3)

Migrations for 'djangocms_page_meta':
0002_auto_20150730_2004.py:
- Alter field og_author_fbid on pagemeta

# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
        ('djangocms_page_meta', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='pagemeta',
            name='og_author_fbid',
            field=models.CharField(default=b'', help_text='Use Facebook numeric ID.', max_length=16, verbose_name='Author Facebook ID', blank=True),
        ),
    ]

Specified key was too long; max key length is 767 bytes

Hi,
I'm getting this error when I run migrate.
Probably is due to the table name length.

Mysql 5.6.30
Charcode: UTF-8
django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 767 bytes')
Django 1.9

Crash on creating new pagetype with djangocms 3.5.2

Hi,
I am encountering a crash when using this plugin with djangoCMS 3.5.2. Here is the stack trace.

File "/virtualenv/lib/python2.7/site-packages/djangocms_page_meta/cms_toolbars.py", line 52, in populate
    Break, identifier=PAGE_MENU_SECOND_BREAK) + 1
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Filer Dependency Inccurate

Description

Filer dependency seems inadequate:

  1. djangocms_page_meta migration 0015 depends on filer migration 0017
  2. djangocms-page-meta dependency list requires filer >1.2
  3. but filer does not add migration 0017 until v3.0.0rc1

Steps to reproduce

Not clear. I learn of this second-hand, and I verified the suspected dependency issue.

  1. Install a Django CMS that has djangocms-page-meta 1.4.0 and filer 2.2.
  2. Poetry update.
  3. Run migrations.

Versions

Python: 3.8
Django: ^4.2
Django CMS: ^3.8

Expected behaviour

No migration errors form djangocms-page-meta.

Actual behaviour

django.db.migrations.exceptions.NodeNotFoundError: Migration djangocms_page_meta.0015_defaultmetaimage dependencies reference nonexistent parent node ('filer', '0017_image__transparent')

Additional information

I think this is caused by https://github.com/nephila/djangocms-page-meta/releases/tag/1.4.0, specifically https://github.com/nephila/djangocms-page-meta/pull/169/files#diff-b7ca01b00eeca578f5707b4a313e872c6f4e4353146c17d4ec9fc418d9481cc5R10 depending on newer version of filer.

Installation guide doesn't mention all the settings

I had to add some variables to settings.py in order for djangocms-page-meta to start working. These are not mentioned anywhere in the installation guide.

# Settings for djangocms_page_meta
SITE_PROTOCOL = 'https'
META_SITE_PROTOCOL = 'https'
META_SITE_DOMAIN = 'mydomain.com'

I can give you a PR by the end of the week, if you want?

The Divio add-on doesnt work out of the box

When installing the djangocmso page meta addon in Divio Control, the context menu should contain a djangocms meta entry, but it doesnt.

Set up a demo project on Divio Control to verify.

Missing language causes an error

We're seeing this on an Aldryn project.

The project had a home page in en.

Then, the project's languages were reconfigured to de and nl.

However, djangocms_page_meta/cms_toolbar.py still tries to feed the en page to get_language_object of the CMS, which is not happy about it.

Here's the traceback:


Request Method: GET
Request URL: http://xxxxx.us.aldryn.io/de/

Django Version: 1.8.8
Python Version: 2.7.10
Installed Applications:
['aldryn_addons',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'aldryn_sso',
 'djangocms_admin_style',
 'django.contrib.admin',
 'django.contrib.staticfiles',
 'aldryn_django',
 'raven.contrib.django',
 'cms',
 'aldryn_django_cms',
 'menus',
 'sekizai',
 'treebeard',
 'reversion',
 'parler',
 'aldryn_boilerplates',
 'django.contrib.sitemaps',
 'compressor',
 'robots',
 'filer',
 'easy_thumbnails',
 'mptt',
 'polymorphic',
 'djangocms_text_ckeditor',
 'djangocms_link',
 'djangocms_snippet',
 'djangocms_googlemap',
 'cmsplugin_filer_file',
 'cmsplugin_filer_image',
 'captcha',
 'django_select2',
 'aldryn_devsync',
 u'aldryn_bootstrap3',
 u'aldryn_common',
 u'aldryn_disqus',
 u'aldryn_apphooks_config',
 u'aldryn_events',
 u'aldryn_translation_tools',
 u'appconf',
 u'bootstrap3',
 u'django_tablib',
 u'extended_choices',
 u'sortedm2m',
 u'standard_form',
 u'adminsortable2',
 u'aldryn_faq',
 u'aldryn_reversion',
 u'taggit',
 u'absolute',
 u'aldryn_categories',
 u'aldryn_jobs',
 u'emailit',
 u'aldryn_locations',
 u'aldryn_newsblog',
 u'aldryn_people',
 u'aldryn_style',
 u'djangocms_forms',
 u'meta',
 u'meta_mixin',
 u'djangocms_page_meta']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'aldryn_sso.middleware.AccessControlMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.sites.middleware.CurrentSiteMiddleware',
 'cms.middleware.utils.ApphookReloadMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware']


Template error:
In template /app/templates/base_root.html, error at line 33
   Language not found: en

   23 :     {% render_block "css" %}



   24 :     <!--[if lt IE 9]>



   25 :     <script src="{% static 'js/libs/html5shiv.min.js' %}"></script>



   26 :     <script src="{% static 'js/libs/respond.min.js' %}"></script>



   27 :     <![endif]-->



   28 :     {% block extrahead %}{% endblock %}



   29 :     {{ ALDRYN_SNAKE.render_head }}



   30 : </head>



   31 : <body id="page-top" class="noscript lang-{{ LANGUAGE_CODE }} {% block body_class %}tpl-root{% endblock %}">



   32 : {% include "includes/analytics.html" %}



   33 :  {% cms_toolbar %} 



   34 : 



   35 : {% block extend_root %}{% endblock %}



   36 : 



   37 : <script src="{% static 'js/libs/jquery.min.js' %}"></script>



   38 : <script src="{% static 'js/libs/bootstrap.min.js' %}"></script>



   39 : <script src="{% static 'js/libs/class.min.js' %}"></script>



   40 : <script src="{% static 'js/libs/outdatedBrowser.min.js' %}"></script>



   41 : <script src="{% static 'js/addons/cl.utils.js' %}"></script>



   42 : <script src="{% static 'js/base.js' %}"></script>



   43 : {% render_block "js" %}


Traceback:
File "/virtualenv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  164.                 response = response.render()
File "/virtualenv/lib/python2.7/site-packages/django/template/response.py" in render
  158.             self.content = self.rendered_content
File "/virtualenv/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  135.         content = template.render(context, self._request)
File "/virtualenv/lib/python2.7/site-packages/django/template/backends/django.py" in render
  74.         return self.template.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in render
  210.                     return self._render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in _render
  202.         return self.nodelist.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in render
  905.                 bit = self.render_node(node, context)
File "/virtualenv/lib/python2.7/site-packages/django/template/debug.py" in render_node
  79.             return node.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  135.         return compiled_parent._render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in _render
  202.         return self.nodelist.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in render
  905.                 bit = self.render_node(node, context)
File "/virtualenv/lib/python2.7/site-packages/django/template/debug.py" in render_node
  79.             return node.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  135.         return compiled_parent._render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in _render
  202.         return self.nodelist.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in render
  905.                 bit = self.render_node(node, context)
File "/virtualenv/lib/python2.7/site-packages/django/template/debug.py" in render_node
  79.             return node.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  135.         return compiled_parent._render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in _render
  202.         return self.nodelist.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in render
  905.                 bit = self.render_node(node, context)
File "/virtualenv/lib/python2.7/site-packages/django/template/debug.py" in render_node
  79.             return node.render(context)
File "/virtualenv/lib/python2.7/site-packages/classytags/core.py" in render
  138.         return self.render_tag(context, **kwargs)
File "/virtualenv/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py" in render_tag
  83.         rendered_contents = nodelist.render(context)
File "/virtualenv/lib/python2.7/site-packages/django/template/base.py" in render
  905.                 bit = self.render_node(node, context)
File "/virtualenv/lib/python2.7/site-packages/django/template/debug.py" in render_node
  79.             return node.render(context)
File "/virtualenv/lib/python2.7/site-packages/classytags/core.py" in render
  138.         return self.render_tag(context, **kwargs)
File "/virtualenv/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in render_tag
  657.             toolbar.populate()
File "/virtualenv/lib/python2.7/site-packages/cms/toolbar/toolbar.py" in populate
  301.         self._call_toolbar('populate')
File "/virtualenv/lib/python2.7/site-packages/cms/toolbar/toolbar.py" in _call_toolbar
  357.                 result = getattr(toolbar, func_name)()
File "/virtualenv/lib/python2.7/site-packages/djangocms_page_meta/cms_toolbar.py" in populate
  89.                     language = get_language_object(title.language)
File "/virtualenv/lib/python2.7/site-packages/cms/utils/i18n.py" in get_language_object
  102.     raise LanguageError('Language not found: %s' % language_code)

Exception Type: LanguageError at /de/
Exception Value: Language not found: en

Getting 403 in production on heroku

Thanks for writing this, it works great on my local but in production on Heroku it 403's:

image

and then

image

django-meta==1.3.2
django-filer==1.2.5
djangocms-page-meta==0.7.0

Thanks for any help you can provide.

Installation Instructions Don't Mention 'meta_mixin'

The "Quickstart" instructions don't yet mention the new 'meta_mixin' requirement that comes along with release 0.4. When upgrading, I had to add 'meta_mixin' to my INSTALLED_APPS setting.

Thanks for your work on this app!

Duplicate Extra Meta Attributes on Publish

This was reported in #72 and supposedly resolved in #71, but I am still seeing this issue.

OS: Linux (Alpine)
Django: 1.10.x
DjangoCMS: 3.4.x
DjangoPageMeta: 0.7.0
Browser: Chrome (latest)

Affected Components:

  • PageMeta
  • TitleMeta (possible, though I haven't tested this)

See:

Reproduction Steps:

Assumes djangocms-meta and djangocms-page-meta are installed properly.

  • Create a Djangocms page
  • Edit the pages common meta
  • Add an attribute
  • Save
  • Publish
  • Inspect the DOM, note the new attribute
  • Re-enable page editing
  • Edit the pages common meta
  • Edit/update all fields for the existing attribute to new values
  • Save
  • Publish
  • Inspect the DOM, note the old attribute and new attribute.

Expected Result:

  • The published page should match the values in the draft page's admin.

I don't have a PR yet, but I do have a fix.

def copy_relations(self, oldinstance, language):
        # Remove old refs to prep for copying
        self.extra.all().delete()

        # Copy everyting to published page instance
        for item in oldinstance.extra.all():
            item.pk = None
            item.page = self
            item.save()
  • This follows the latest recommendation in Djangocms docs
  • I've removed the filtering implementation as it didn't seem necessary now that we are clearing the published page instances extras before copying.
  • This implementation ensures the published page instance extra set always matches the draft pages extra set.
  • I've tested this fix locally and confirmed it resolves the issue I'm seeing and also supports the previous issue reported in #72

I'm at work right now, so I can't supply a patch, but I am willing to do so when I have a moment this week.

Exclude disabled fields in admin form

django-meta does not display some tags by default (eg: META_USE_OG_PROPERTIES is False by default) however djangocms-page-meta allows to fill these fields in its admin forms.

Can we exclude unwanted fields based on the settings?

Error on adding items from admin.

Saving Title or Page Meta object from admin interface leads to Traceback :

Traceback:
File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  3.                 response = view_func(request, _args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4.     response = view_func(request, _args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  5.         return view(request, _args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  6.         return bound_func(_args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  7.                 response = view_func(request, _args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  8.             return func(self, _args2, *_kwargs2)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/cms/extensions/admin.py" in add_view
  9.     return super(ExtensionAdmin, self).add_view(request, form_url, extra_context)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  10.         return bound_func(_args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  11.                 response = view_func(request, _args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  12.             return func(self, _args2, *_kwargs2)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  13.             return func(_args, *_kwargs)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in add_view
  14.             self.save_model(request, new_object, form, False)
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/cms/extensions/admin.py" in save_model
  15.         title = obj.extended_object
    
    File "/home/vagrant/Envs/beas/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in get
  16.             "%s has no %s." % (self.field.model.**name**, self.field.name))
    

Exception Type: DoesNotExist at /de/admin/djangocms_page_meta/titlemeta/add/
Exception Value: TitleMeta has no extended_object.

Since it is only possible to edit extensions from frontend toolbar, showing these models in admin interface is useless and leads to errors.

Revert to live doesn't work

Hi

The meta description setting isn't reverted to live version, when I change it in draft and then click on "Revert to live" in "Page..." menu.

It's this normal?

Thanks

Table easy_thumbnails_source doesn't exist

When trying to set a title image, the image upload does not succeed, and I see this error in the logs:

django.db.utils.ProgrammingError: (1146, "Table 'example.easy_thumbnails_source' doesn't exist"

Including easy_thumbnails in INSTALLED_APPS fixed this problem.

Missing migration step

When I run:

$ python manage.py makemigrations

The shell will show me something like this:

Migrations for 'djangocms_page_meta':
  0004_auto_20160302_0917.py:
    - Alter field gplus_type on pagemeta
    - Alter field og_app_id on pagemeta
    - Alter field og_author_fbid on pagemeta
    - Alter field og_author_url on pagemeta
    - Alter field og_publisher on pagemeta
    - Alter field og_type on pagemeta
    - Alter field twitter_type on pagemeta
    - Alter field description on titlemeta
    - Alter field gplus_description on titlemeta
    - Alter field keywords on titlemeta
    - Alter field og_description on titlemeta
    - Alter field twitter_description on titlemeta

Is there a missing migration step?

Per page CSS

Hi there,

Have you considered adding the functionality to this plugin to add css to a template on a per page or per include basis?

Publishing causes "extra" GenericMetaAttributes to be copied without regard for deletion

In the copy_relations function for TitleMeta, the oldinstance extra.all() is copied over to the new instance without checking if the item has been deleted.

The result is that when a GenericMetaAttribute is deleted under Meta -> language and the page it references is published, it continues to be rendered anyway. The only way to remove it is to filter the GenericMetaAttribute objects using the ORM and call delete().

OS: Ubuntu 16.04 x64
Django: 1.8.x stable
Django-CMS: 3.2.x stable
djangocms-page-meta: 0.6.3

A possible patch is to change copy_relations to check object existence through the ORM before copying it to the new instance during the publish operation. I have submitted a PR with this change here:
#71

Reference to six library causes incompatibility with Django 3

Reference to six library causes incompatibility with Django 3

File "C:\Users\Peter D Bethke\PycharmProjects\venv\bossota-django3\lib\site-packages\djangocms_page_meta\models.py", line 12, in
from django.utils.six import python_2_unicode_compatible
ModuleNotFoundError: No module named 'django.utils.six'

Versions

Expected behaviour

Actual behaviour

Additional information

Page -> Meta-information options aren't selectable (greyed out)

I think I've followed the installation/configuration instructions, however, when I try to access the SEO options in the Page menu, I can't select either "Common..." or "English..." as both are greyed out.

Please advise.

Relevant package information:
Django==1.8.18
django-cms==3.4.5
django-filer==1.3.0
django-meta==1.4.1

Managing robots meta tag in djangocms-page-meta

Hello 👋

I would like to know if you would accept a PR adding robots meta tags management in djangocms-page-meta.

I noticed that the meta robots tag configuration is already possible in your djangocms-page-sitemap application, but I think that this option would be more appropriate in an application that manages meta tags rather than in an application that manages a sitemap, because we don't necessarily use both applications together, so we may end up in a situation where we can configure meta tags using djangocms-page-meta, except the meta tag robots because we don't have installed djangocms-page-sitemap.

Here is how I think I would add it:
image

Duplicate GenericMetaAttribute

Hello! If i save TitleMeta from CMS interface and click Publish button, i get duplicate entries in model GenericMetaAttribute. This happens every time i save. But if I save from admin interface (admin/djangocms_page_meta/titlemeta//change/) duplication does not occur, and GenericMetaAttribute save as correct/
v0.8.0

RuntimeError: Model class menus.models.CacheKey

i have project written in django 1.10.3 , I was following your steps for configuration , i am getting error RuntimeError: Model class menus.models.CacheKey doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
do i have to add 'menus' in INSTALLED_APPS?

fix compatibility for django_meta==2.4.0

See django-meta commit:

The variables got renamed and prefixed with META_.

The current version of djangocms-page-meta still requests those settings without the newly added prefix, e.g. FB_TYPE instead of META_FB_TYPE.

Little part of a trace:

  File "/usr/local/lib/python3.11/site-packages/djangocms_page_meta/templatetags/page_meta_tags.py", line 25, in render_tag
    meta = get_page_meta(page, language)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/djangocms_page_meta/utils.py", line 85, in get_page_meta
    "object_type": meta_settings.FB_TYPE,
                   ^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'meta.settings' has no attribute 'FB_TYPE'

Default Image

Description

Support a default image for all the image meta tags on any page (and a post via djangocms-blog1):

  • Open Graph og:image
  • Twitter twitter:image
  • Schema.org image

Use cases

A CMS user expects that every webpage URL (of their site) that they share on Twitter will display an image, even if the page does not have an meta image uploaded.

Proposed solution

  1. CMS Admin edits a global Meta Information setting.

  2. CMS Admin uploads a "Default Image".

  3. Any page (or djangocms-blog post) missing an "Meta-information" > "Common" > "Image" uses image from step 2.
    (click to toggle detailed steps)
    1. CMS User creates page.
    2. CMS User does not upload a "Meta-information" > "Common" > "Image".
    3. CMS User publishes page.
    4. Any user previews sharing the URL of the page created (in step 3) on Twitter.2
    5. An image is rendered.

Alternatives

Require CMS user upload a default image for every CMS page.

Additional information

N/A

Footnotes

  1. The djangocms-blog repo uses djangocms-page-meta.

  2. (A) User, in the Twitter field to create a tweet, pastes a URL. (B) User, in third-party tweet previewer (example 1, example 2), pastes a URL and clicks preview button.

Invalid block tag: 'googleplus_html_scope'

I've setup this as per the documentation and have gotten the following error..

Invalid block tag: 'googleplus_html_scope'

INSTALLED APPS:
'meta',
'meta_mixin',
'djangocms_page_meta',

TEMPLATE:
{% load page_meta_tags %}

ImportError: cannot import name 'reversion_register'

Facing issue after installing package and adding to installed apps section in settings.py, unable to syncdb or import

Traceback (most recent call last): File "manage.py", line 11, in <module> execute_from_command_line(sys.argv) File "/Users/c130/.pyenv/versions/PJ/lib/python3.6/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line utility.execute() File "/Users/c130/.pyenv/versions/PJ/lib/python3.6/site-packages/django/core/management/__init__.py", line 328, in execute django.setup() File "/Users/c130/.pyenv/versions/PJ/lib/python3.6/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/Users/c130/.pyenv/versions/PJ/lib/python3.6/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models(all_models) File "/Users/c130/.pyenv/versions/PJ/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models self.models_module = import_module(models_module_name) File "/Users/c130/.pyenv/versions/3.6.1/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 978, in _gcd_import File "<frozen importlib._bootstrap>", line 961, in _find_and_load File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed File "/Users/c130/.pyenv/versions/PJ/lib/python3.6/site-packages/djangocms_snippet/models.py", line 9, in <module> from cms.utils.helpers import reversion_register ImportError: cannot import name 'reversion_register'

Python Version: 3.6
Django Version: 1.8
CMS Version: 3.5

djangocms-page-meta from divio addons does not work with django-meta 2.0.0

Description

Current djangocms-page-meta package from the divio addons platform (0.10.0) does not work with django-meta 2.0.0.

Steps to reproduce

Install djangocms-page-meta with divio aldryn addons

Expected behaviour

Should work with pip install :-)

Actual behaviour

Error:

image

Additional information

Current workaround is to set django-meta==1.7.0 in requirements.in

Update Docs to Avoid Confusion About Usage of App

Description

A user (that is new to interoperability of djangocms apps) is likely to encounter some issues when following the documentation:

  1. Be unaware how to set "page meta" (#86, #66).
  2. Be unaware how to render "page meta" ("6. That's all!" without mentioning "Usage").
  3. Be unclear of the distinction between "meta"s (comment on djangocms-blog #550):
    • "page meta" (django-page-meta)
    • "blog article meta" (djangocms-blog using django-meta).
  4. Add both of, or be unsure what to do about, the two "render meta stuff" template markups (one from django-meta and one from djangocms-page-meta (comment on #86).

Proposal

  • In the the readme, between the current (as of this issue's creation date) step 5 and step 6 of "Quickstart", add a step that mentions and links to "Usage".
  • In the usage doc, add mention, for indirect users of django-meta (perhaps via djangocms-blog), that they need not have both of these lines of markup:
    • {% include 'djangocms_page_meta/meta.html' with meta=page_meta %}
    • {% include "meta/meta.html" %}
      Only the top one is necessary.
  • In djangocms-blog docs (via a separate, unwritten, issue), add mention of djangocms-page-meta and describe its purpose and distinction from and relation to django-meta, in the context of djangocms-blog usage.
    • Also, possibly, note that <head {% meta_namespaces %}> is still necessary for djangocms-blog usage of django-meta

Ideas

  • Google+ is dead. Remove the documentation about it (and create an issue to remove the code)?

Meta description gone when editing page.

django 1.8.15
django cms 3.3.3

When adding a new page in DCMS, I have the following fields.

title
slug
menu title
page title
description meta tag <-- If this is left blank and save, then I go back to edit the page the description meta tag field is gone.

I only get:
title
slug
menu title
page title

Thanks for the plugin.

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.