Skip to content

hdknr/django-mylinks

Repository files navigation

django-mylinks

settings.py

INSTALLED_APPS = [
    'rest_framework',
    'django_filters',
    'rest_framework_filters',
    ...
    'mylinks',
    ...
]
REST_FRAMEWORK = {
    'DEFAULT_FILTER_BACKENDS': ('rest_framework_filters.backends.RestFrameworkFilterBackend', ),
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.BasicAuthentication',
        'rest_framework.authentication.SessionAuthentication',
    ),
}

urls.py

from django.urls import path, include

urlpatterns = [
    ...
    path('mylinks/', include('mylinks.urls'))
    ...
]

templates under templates/mylinks/oembed/{{ content_type }}/{{ style }}

  • oembed.json: OEMBED json
  • embed.html: html returned in OEMBED json['html']
  • widget.js: javascript
  • widget.html: iframe content rendered by widget.js

About

Link and oembed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published