Metadata-Version: 2.1
Name: bma
Version: 0.2.0a2
Summary: BornHack Media Archive Django project
Author: Thomas Steen Rasmussen
Author-email: thomas@gibfest.dk
Project-URL: homepage, https://github.com/bornhack/bma
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: demoji==1.1.0
Requires-Dist: Django==5.1.4
Requires-Dist: django-allauth[socialaccount]==65.3.0
Requires-Dist: django-bootstrap5==24.3
Requires-Dist: django-cors-headers==4.6.0
Requires-Dist: django-decorator-include==3.2
Requires-Dist: django-filter==24.3
Requires-Dist: django-guardian==2.4.0
Requires-Dist: django-htmx==1.21.0
Requires-Dist: django-ninja==1.3.0
Requires-Dist: django-oauth-toolkit==3.0.1
Requires-Dist: django-polymorphic==3.1.0
Requires-Dist: django-stubs-ext==5.1.1
Requires-Dist: django-tables2==2.7.0
Requires-Dist: django-taggit==6.1.0
Requires-Dist: environs[django]==11.2.1
Requires-Dist: fontawesomefree==6.6.0
Requires-Dist: orjson==3.10.12
Requires-Dist: psycopg2-binary==2.9.10
Provides-Extra: dev
Requires-Dist: pre-commit==4.0.1; extra == "dev"
Requires-Dist: setuptools_scm==8.1.0; extra == "dev"
Provides-Extra: test
Requires-Dist: beautifulsoup4==4.12.3; extra == "test"
Requires-Dist: coverage==7.6.9; extra == "test"
Requires-Dist: django-debug-toolbar==4.4.6; extra == "test"
Requires-Dist: factory-boy==3.3.1; extra == "test"
Requires-Dist: pytest-django==4.9.0; extra == "test"
Requires-Dist: pytest-cov==6.0.0; extra == "test"
Requires-Dist: pytest-randomly==3.16.0; extra == "test"
Requires-Dist: tox==4.23.2; extra == "test"

[![Run Tox CI](https://github.com/bornhack/bma/actions/workflows/tox.yml/badge.svg?branch=develop)](https://github.com/bornhack/bma/actions/workflows/tox.yml)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![codecov](https://codecov.io/gh/bornhack/bma/graph/badge.svg?token=AN3NmaCDAr)](https://codecov.io/gh/bornhack/bma)

# bma
BornHack Media Archive

## What
The BornHack Media Archive is a site for sharing pictures and video from BornHack events. It uses the BornHack website oauth2 provider for login.

## How
> Note! The server is using database functions not compatible with sqlite. Use postgresql instead.


* Copy `bma/environment_settings.py.dist` to `bma/environment_settings.py` and either edit it directly, or use .env file or environment variables to configure.
    * Set `OAUTH_SERVER_BASEURL` to point to a local instance of the BornHack website eg. `http://127.0.0.1:8000`, or leave it pointing at the prod bornhack.dk server.
* Create an oauth app on the BornHack instance you specified in `OAUTH_SERVER_BASEURL`:
    * login to the BornHack instance and go to the url `OAUTH_SERVER_BASEURL/o/applications`.
    * register a new app.
    * client type `confidential`
    * grant type `authorization code`
    * redirect uri's `BMA_BASEURL/accounts/bornhack/login/callback/` eg. `http://127.0.0.1:8001/accounts/bornhack/login/callback/`.
* Run `manage.py migrate`
    * If you get a database error about missing 'gist', you need to run `create extension btree_gist;` on your postgresql instance.
* Run `manage.py createsuperuser` to create a local database user in the BMA instance
* Log in with the superuser and add a social app on the BMA admin website using the client id and secret from the bornhack website used in the above step.
* Move `example.com` to `chosen sites`.


It should now be possible to login to BMA using a BornHack account.

To use the CLI app for uploading or BMA workers make sure the url of the autocreated oauth application for the user matches the BMA instance (for localhost dev change https to http).
