=============
LIGHTBOX PAGE
=============
This is an alternative for a full screen javascript lightbox. LIGHTBOX PAGE brings
the user to a separate page, not an overlay. So this is only useful for
full screen lightbox.
Quick Start
===========
Add lightbox to your INSTALLED APPS
To settings, add LIGHTBOX_MODEL with the parent model name, and
LIGHTBOX_APP with the app where this model lives.
Defaults are model: 'Page', app: 'base'
Add lightbox.middleware.MobileDetectMiddleware to your middleware classes.
Add the following to your urls.py:
from lightbox.views import ImagePageView
In url patterns, you need to do 2 things:
1. add something like this::
url(r'^lightbox/(?P<pk>\d+)/(?P<path>.*)/$',
ImagePageView.as_view(), {'app': 'projects', 'model': 'project',
'related_name': 'projectimage_set'}, name="projectlightbox"),
As you can see, you will need to specify app, model and related name as keyword arguments.
2. add
url(r'^lightbox/', include('lightbox.urls')),
to your base urls.py
Add ImagePageContextMixin to your views. This will provide the context.
Then, in your own templates, you may call lightbox like so:
<a href="{% url 'projects:projectlightbox' object.pk path %}?page={{ forloop.counter }}">
<img src="{{ im.url }}">
</a>
Example:
========
from lightbox.views import ImagePageContextMixin
from django.views.generic import ListView
from models import Page
class CustomView(ImagePageContextMixin, ListView):
template_name = 'index.html'
If you are not using class-based views, and you wish to use
the last call structure, you may enter the
context for the path variable as follows:
from lightbox.views import encode_url
def some_function(request, [...]):
path = encode_url(request)
return render_to_response('your_template_name.html', {'path': path, [...: ...]})
Options:
========
LIGHTBOX_WIDTH = '1600'
LIGHTBOX_WIDTH_MOBILE = '800'
LIGHTBOX_IMAGE_CLICKABLE = False
LIGHTBOX_BG_COLOR = '#000'
LIGHTBOX_TXT_COLOR = '#fff'
LIGHTBOX_VIEWABLE_HEIGHT_FACTOR = 0.85
LIGHTBOX_VIEWABLE_WIDTH_FACTOR = 0.85
LIGHTBOX_IMAGE_WINDOW_HEIGHT_FACTOR = 0.71
LIGHTBOX_IMAGE_WINDOW_WIDTH_FACTOR = 0.71
Metadata
Release files for DjangoLightbox 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| DjangoLightbox-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for DjangoLightbox-0.2.2-py3-none-any.whl |
Release files / DjangoLightbox-0.2.2-py3-none-any.whl
| Download URL | DjangoLightbox-0.2.2-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7846c3ea9fecd0b1753dbc30616cec373706e805a905159e94fde5a2bb522dc
|
|
BLAKE2b-256 checksum How to use checksums |
560952a720789e98782e26fc1ddf4be5722c4dc533c9ffd4e3580c2b0ff6a50b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0
|
Security for DjangoLightbox 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.