semvec/pypi-packages huggingface dataset:
mitol-django-olposthog 2025.8.1
MIT Open Learning django app extensions for Posthog.
Requires Python: >=3.10

mitol-django-olposthog
---

This is the Open Learning OlPosthog app. It provides an API to interact with Posthog in order to check feature flags.


### Installation and setup

Add the OlPosthog app:

`docker-compose run -u root --rm web poetry add mitol-django-olposthog`

Add the following to the `ready()` method for your App.

```
from mitol.olposthog.features import configure
configure()

```

#### Common Django settings

- `HOSTNAME` - The website's hostname.

#### OlPosthog app settings

All settings for the `mitol-django-olposthog` app are prefaced with 'POSTHOG'.

- `POSTHOG_ENABLED` - `True` in order to enable Posthog feature flags in the application.  `False` to disable Posthog feature flags.
- `POSTHOG_PROJECT_API_KEY` - Required if POSTHOG_ENABLED is True. Private API key to communicate with PostHog.
- `POSTHOG_API_HOST` - Required if POSTHOG_ENABLED is True. Host URL for the PostHog API.
- `POSTHOG_FEATURE_FLAG_REQUEST_TIMEOUT_MS` - Timeout(MS) for PostHog feature flag requests.
- `POSTHOG_MAX_RETRIES` - Numbers of time requests to PostHog should be retried after failing.

#### Cache table creation
Add the following cache defintion to your `CACHES` in the settings.py file of your Django application.
```
CACHES = {
  "durable": {
      "BACKEND": "django.core.cache.backends.db.DatabaseCache",
      "LOCATION": "durable_cache",
  },
}
```

You must create the cache included in this library.  This can be done by running the following command from within the Django application that this library is being added to: `./manage.py createcachetable`.

### Usage

#### Check single feature flag value
You can check the value of a feature flag on Posthog with the following code:
```
from mitol.olposthog.features import is_enabled
is_enabled(<FEATURE_FLAG_NAME>)
```
This will return a boolean value based on whether the Posthog feature flag is True or False.

#### Retrieve all feature flags from Posthog
You can retrieve all the feature flags from Posthog using:
```
from mitol.olposthog.features import get_all_feature_flags
get_all_feature_flags()
```
153957-theme 7.0
Theme for sigal generated photo albums
Requires Python: >=3.13
Keywords: photo album, theme, sigal

# Theme 153957

[![PyPI](https://img.shields.io/pypi/v/153957-theme)](https://pypi.org/project/153957-theme/)
[![License](https://img.shields.io/github/license/153957/153957-theme)](LICENSE)
[![Build](https://github.com/153957/153957-theme/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/153957/153957-theme/actions)

[View demo album here](https://153957.github.io/153957-theme/)


## Photo gallery template

Web photo gallery templates adapted to my personal preferences.


## Usage

This section describes how to install and use this theme.


### Installation

Install the `153597-theme` package:

    $ pip install 153957-theme


### Configure

In `sigal.conf.py` configuration for an album the `theme` setting should be
a path to a theme directory. However, since this theme is provided as a Python
package its location might be harder to get. Two options are available for
configuration:

The theme can be configured as a plugin or you can get the path by importing
the package. By setting is as plugin the theme is automatically set.

Set `theme` to an empty string and add the theme and menu plugins:

    theme = ''
    plugins = ['theme_153957.theme', 'theme_153957.full_menu', …]

The alternative:

    from theme_153957 import theme
    theme = theme.get_path()
    plugins = ['theme_153957.full_menu', …]


### Wrapping album

Use the settings `head`, `body_prefix`, and `body_suffix` to add additional
code to the templates. The value of `head` is appended to the `head` element,
the `body` settings are placed just after the body opening tag (`prefix`) and
just before the closing body tag (`suffix`). This allows embedding the album
in your own website.