{"id":27698,"library":"djangocms-link","title":"django CMS Link Plugin","description":"Adds a link plugin to django CMS, allowing editors to create links to internal pages, external URLs, mailto, telephone, and anchors. Current version 5.1.1, requires Python >=3.9, follows django CMS's release cadence.","status":"active","version":"5.1.1","language":"python","source_language":"en","source_url":"https://github.com/django-cms/djangocms-link","tags":["django-cms","links","plugin","cms"],"install":[{"cmd":"pip install djangocms-link","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Core dependency; the plugin is built for django CMS.","package":"django-cms","optional":false}],"imports":[{"note":"The model is the canonical source; the cms_plugins module does not export it.","wrong":"from djangocms_link.cms_plugins import LinkPlugin","symbol":"LinkPlugin","correct":"from djangocms_link.models import LinkPlugin"},{"note":null,"wrong":null,"symbol":"get_link","correct":"from djangocms_link.templatetags.djangocms_link_tags import get_link"}],"quickstart":{"code":"INSTALLED_APPS = [\n    ...\n    'djangocms_link',\n]\n\n# Then run:\n# python manage.py migrate djangocms_link\n# python manage.py collectstatic","lang":"python","description":"Add djangocms_link to INSTALLED_APPS, then migrate and collect static files."},"warnings":[{"fix":"Review the new widget and endpoint; update any custom code that relied on the old form field or internal URL generation.","message":"Version 5.0 introduced a new Link widget and JSON endpoint. If you have custom templates or subclass the plugin, you may need to adapt to the new widget implementation.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Change import to from djangocms_link.models import LinkPlugin.","message":"The `cms_plugins.LinkPlugin` import is deprecated. Use `djangocms_link.models.LinkPlugin` instead.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Verify django CMS installation: 'django-cms' in INSTALLED_APPS and run migrations.","message":"Plugin fails silently on uninstalled apps or models (e.g., missing django-cms). Ensure django CMS is properly installed and in INSTALLED_APPS.","severity":"gotcha","affected_versions":">=5.1.0"},{"fix":"Ensure you pass a valid model instance (e.g., Page) or string URL to the tag.","message":"The 'to_url' template tag now accepts model objects as parameters (since 5.1.0). Passing unsupported types will raise errors.","severity":"gotcha","affected_versions":">=5.1.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Change import to: from djangocms_link.models import LinkPlugin","cause":"The correct model is in djangocms_link.models, not cms_plugins.","error":"ImportError: cannot import name 'LinkPlugin' from 'djangocms_link.cms_plugins'"},{"fix":"Ensure 'djangocms_link' appears only once in INSTALLED_APPS and avoid importing the AppConfig manually.","cause":"The app is registered twice, often due to duplicate entries in INSTALLED_APPS or importing the app config multiple times.","error":"django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: djangocms_link"},{"fix":"Delete and recreate the plugin, ensuring a valid target is selected. For existing data, set a default or handle None in the template.","cause":"The link's internal page reference is null; plugin may have been saved without a target.","error":"AttributeError: 'NoneType' object has no attribute 'pk'"},{"fix":"Run: python manage.py migrate djangocms_link","cause":"Migration not run after adding the app.","error":"OperationalError: no such table: djangocms_link_link"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}