- About Pinax
- Important Links
- Overview
- Documentation
- Change Log
- Contribute
- Code of Conduct
- Connect with Pinax
- License
Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable Django apps, themes, and starter project templates. This collection can be found at http://pinaxproject.com.
Where you can find what you need:
- Releases: published to PyPI or tagged in app repos in the Pinax GitHub organization
- Global documentation: Pinax documentation website
- App specific documentation: app repos in the Pinax GitHub organization
- Support information: SUPPORT.md file in the Pinax default community health file repo
- Contributing information: CONTRIBUTING.md file in the Pinax default community health file repo
- Current and historical release docs: Pinax Wiki
pinax-events
is a simple app for publishing events on your site.
Django / Python | 3.6 | 3.7 | 3.8 |
---|---|---|---|
2.2 | * | * | * |
3.0 | * | * | * |
To install pinax-events:
$ pip install pinax-events
Add pinax.events
to your INSTALLED_APPS
setting:
INSTALLED_APPS = [
# other apps
"imagekit",
"pinax.events",
]
You will need either PIL
or Pillow
installed for imagekit
to work. We
recommend Pillow
:
$ pip install Pillow
There are two settings that have defaults but if you want to override them you
need to just set them to the dotted-notation path to the ImageSpec
class that
you wish to use to process the image
and secondary_image
files for the
image_thumb
and secondary_image_thumb
attributes on the News
model.
PINAX_EVENTS_IMAGE_THUMBNAIL_SPEC = "pinax.events.specs.ImageThumbnail"
PINAX_EVENTS_SECONDARY_IMAGE_THUMBNAIL_SPEC = "pinax.events.specs.SecondaryImageThumbnail"
To create your own ImageSpec
classes you can reference the defaults, but it is
basically subclassing imagekit.ImageSpec
.
In your template where you want to display events:
First, load the template tags:
{% load pinax_events_tags %}
Then:
{% events as event_items %}
And here is an example that how you can show the events:
<section class="event-list">
{% for event in event_items %}
<article class="event" style="{% if event.secondary_image_thumb %}background-image:url({% static event.secondary_image_thumb.url %});{% endif %}">
<section class="event-img">
<a href="{{ event.url }}">
{% if event.image_thumb %}<img src="{{ event.image_thumb.url }}" width="200" />{% endif %}
</a>
</section>
<ul class="event-details">
<li>
<h2><a href="{{ event.url }}">{{ event.title }}</a></h2>
</li>
<li class="meta">
<span>
Where: {{ event.where }}
</span>
<span>
When: {{ event.start_date }}&endash;{{ event.end_start }}
</span>
</li>
<li class="event-description">
{{ event.what_html|safe }}
</li>
</ul>
</article>
{% endfor %}
</section>
Add and manage events via the Django admin.
- Drop Django 1.11, 2.0, and 2.1, and Python 2,7, 3.4, and 3.5 support
- Add Django 2.2 and 3.0, and Python 3.6, 3.7, and 3.8 support
- Update packaging configs
- Direct users to community resources
- Add django>=1.11 to requirements
- Update CI config
- Remove doc build support
- Add sorting guidance for 3rd-party app imports
- Improve documentation markup
- fix setup.py LONG_DESCRIPTION for PyPi
- Fix setup.py for PyPi
- Add Django 2.0 compatibility testing
- Drop Django 1.8, 1.9, 1.10 and Python 3.3 support
- Move documentation into README
- Standardize documentation layout
- Convert CI and coverage to CircleCi and CodeCov
- Add PyPi-compatible long description
- added missing migrations from 1.1.0 changes
- added support for secondary images
- added support for customized image sizing
- added docs and tests and wired up CI
- initial release
Contributing information can be found in the Pinax community health file repo.
In order to foster a kind, inclusive, and harassment-free community, the Pinax Project has a Code of Conduct. We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you.
For updates and news regarding the Pinax Project, please follow us on Twitter @pinaxproject and check out our Pinax Project blog.
Copyright (c) 2012-present James Tauber and contributors under the MIT license.