Skip to main content

Meeting Guide compatible Python package for Django's Wagtail CMS: meetings, locations, and API.

Project description

Wagtail Meeting Guide

A Python package compatible with the Meeting Guide App for the Wagtail CMS on the Django web framework.

Pre-Requisites

Using this package requires both the Wagtail CMS and Django. Wagtail and Django are fantastic for running your website, but require a developer. If you are new to Django, I would recommend going through both the Django and Wagtail tutorials before trying to use this package.

A Google Geocode API key and MapBox API key are also required. The Google API key is only used in the content management system (typically by administrators), so the free tier should be fine to use.

Installation to Your Django Project

  • Install with the command pip install wagtail-meeting-guide
  • Add meeting_guide, mptt, and wagtailgeowidget to your INSTALLED_APPS.
  • Add the following settings:
    • WAGTAIL_SITE_NAME (MyCity Intergroup): the name of your website, typically the intergroup.
    • BASE_URL (https://AAMyCity.org): the base URL or the website.
  • Run migrations: python manage.py migrate meeting_guide
  • Load Meeting Guide's meeting types: python manage.py loaddata meeting_guide_types.json

Configuration

  • Enter the Wagtail CMS, and go to Settings, Meeting Types.
  • Enter your Intergroup's code for each of the Meeting Guide Code Types
  • Go to Regions and enter your regions; regions can have a parent, so you can nest them. For example, you could have Philadelphia County as a region with no parent, and Center City as a sub-region with Philadelphia County as the parent.

Including the Meeting Guide in Your Django Template

The API end point for the locations and meetings you create in Wagtail has to be added to your site's root urls.py. Add a line like this:

urlpatterns = [
    ...
    path("meeting-guide/", include("meeting_guide.urls")),
    ...
]

You can include the Meeting Guide within any Django Template. Here is an example:

{% extends "base.html" %}

{% load meeting_guide %}

{% block content %}
    {% meeting_guide %}
{% endblock content %}

More Settings

You can modify the MEETING_GUIDE setting in Django's settings to change the defaults in https://github.com/code4recovery/tsml-ui#advanced-customization. Here is an example settings block:

# Google Maps, Used by the Wagtail Content Management System
GOOGLE_MAPS_V3_APIKEY = "FAKEoyCFYHEYHUoBLAHBLAHYbRqjBafhI3FAKE"
GOOGLE_MAPS_API_BOUNDS = "39.732679,-77.821655|41.553879,-73.896790"
GEO_WIDGET_DEFAULT_LOCATION = {"lat": 40.0024137, "lng": -75.258117}  # The Philadelphia area
GEO_WIDGET_ZOOM = 14

# Key for MapBox, used by the front end served to users.
MAPBOX_KEY = "YourMaxBoxKeyGoesHere"

# Example of sending settings to tsml-ui
MEETING_GUIDE = {
    "flags": ["X", "TC"],
    "show": {
        "listButtons": True,
    },
    "map": {
        "key": MAPBOX_KEY,
    },
    "strings": {
        "en": {
            "types": {
                "X": "Wheelchair",
                "TC": "Temp Closed",
            },
        },
    },
    "feedback_emails": "manager@your-integroup.org",
}

Downloading Meetings as a PDF

To download the meeting list as a PDF, you must have wkhtmltopdf installed on your system. The end point for the download is meeting-guide/download/.

You can change the print and style options in your Django settings. The options are a Python dictionary while the styles are a string containing CSS:

WAGTAIL_MEETING_GUIDE_PRINT_OPTIONS = {
    'page-width': '100mm',
    'page-height': '120mm',
    'margin-top': '10mm',
    'margin-right': '10mm',
    'margin-bottom': '10mm',
    'margin-left': '10mm',
    'header-left': '[section]: [subsection]',
    'encoding': "UTF-8",
    'no-outline': None
}

WAGTAIL_MEETING_GUIDE_PRINT_STYLES = """
html, td {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  -webkit-text-size-adjust:100%;
  -ms-text-size-adjust:100%;
  color: red;
}

body {
  margin:0;
}

h1, .h1 {
  font-size: 24px;
}
"""

Release Notes

https://github.com/code4recovery/wagtail-meeting-guide/releases/

Maintainer

Project details


Download files

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

Source Distribution

wagtail-meeting_guide-1.3.4.tar.gz (481.1 kB view details)

Uploaded Source

Built Distribution

wagtail_meeting_guide-1.3.4-py3-none-any.whl (493.1 kB view details)

Uploaded Python 3

File details

Details for the file wagtail-meeting_guide-1.3.4.tar.gz.

File metadata

  • Download URL: wagtail-meeting_guide-1.3.4.tar.gz
  • Upload date:
  • Size: 481.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for wagtail-meeting_guide-1.3.4.tar.gz
Algorithm Hash digest
SHA256 e9b864bb1c9cb05163366ae357803a83e6cc3b49d38630521d8bd8acd9196311
MD5 af67a52aa89d24e32a26a4441b817fbd
BLAKE2b-256 75e9348a364d4ceaea1b7b03d83e88760a7fcd2576b7c3e8d2830f1e2b8aacac

See more details on using hashes here.

Provenance

File details

Details for the file wagtail_meeting_guide-1.3.4-py3-none-any.whl.

File metadata

  • Download URL: wagtail_meeting_guide-1.3.4-py3-none-any.whl
  • Upload date:
  • Size: 493.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for wagtail_meeting_guide-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 051f87d7838c640db95d330f24332132a59a4cadcb5e660e749eafaf78fb727b
MD5 fd202d263b4a148ae7d564b2bcc9a4a1
BLAKE2b-256 37866e1b6a8ff2a210f800b0822a6ede51499e67b683480a72658c2c993e74df

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page