Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Django integration middleware for EEA Zope websites

Project Description

Django integration middleware for EEA Zope websites.

Template and request

pip install eea.frame

In your project’s settings.py add:

INSTALLED_APPS = (
... # django apps
'frame'
... # your project's apps
)

MIDDLEWARE_CLASSES = (
  'frame.middleware.RequestMiddleware',
  'frame.middleware.UserMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

TEMPLATE_LOADERS = (
  'frame.middleware.Loader',
  'django.template.loaders.filesystem.Loader',
  'django.template.loaders.app_directories.Loader',
)

Also, usually in local_settings.py you need to define: FRAME_URL to an url pointing to a Zope frame instance, and FRAME_COOKIES = ['__ac', '_ZopeId', '__ginger_snap'].

You can skip https with FRAME_VERIFY_SSL = False.

Your layout.html must extend "frame.html" in order to use the frame.

You can set FRAME_EXTRA_SUBSTITUTIONS to a list of pairs to be replaced in the frame html.

Authentication Backend

If you want to use the Django groups and permissions settings with users from _eea.frame_, you need to set:

MIDDLEWARE_CLASSES = (
  ...
  'django.contrib.auth.middleware.RemoteUserMiddleware',
  ...
)

AUTHENTICATION_BACKENDS = (
  'django.contrib.auth.backends.ModelBackend',
  'frame.backends.FrameUserBackend',
)

For each user that is authenticated on eea.frame, a django.contrib.auth.models.User instance is created.

For each of the roles the user has in eea.frame, a django.contrib.auth.models.Group instance is created, and you can assign permissions to that group.

Seen Middleware

Use the seen middleware to keep for each user the datetime of the last visit to the application.

Set (at the end of the middleware classes setting):

MIDDLEWARE_CLASSES = (
  ...
  'frame.middleware.SeenMiddleware',
)

If you want to use the default view, add frame.utils.get_objects_from_last_seen_count to your url patterns, in a location such as ^/_lastseen/$, then set the FRAME_SEEN_MODELS to a list of pairs (model, field) for the objects to be counted.

You should exclude this view using FRAME_SEEN_EXCLUDE config setting.

Release History

Release History

This version
History Node

0.5.4

History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

History Node

0.5

History Node

0.4.3

History Node

0.4.2

History Node

0.4.1

History Node

0.4.0

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3

History Node

0.2.1

History Node

0.2

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
eea.frame-0.5.4-py2.7.egg (15.3 kB) Copy SHA256 Checksum SHA256 2.7 Egg Apr 19, 2017
eea.frame-0.5.4.tar.gz (5.8 kB) Copy SHA256 Checksum SHA256 Source Apr 19, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting