access-stats
is a Django application that provides useful visualisations of access data from an Elasticsearch endpoint.
The access data is an index of data downloads from the CEDA archive, via various methods.
Main Django settings file with some custom settings.
Use PUBLIC_SITE
setting to limit the site and api to non-sensitive user data.
In the playbook this is fully overwritten using a template.
Sensitive settings placed here while debugging/not using the playbook.
Template can be found at access_stats/settings_local.py.tmpl.
Contains credentials and configuration for Elasticsearch connection.
Template can be found at access_stats/settings.yml.tmpl.
-
Install Poetry (if not already installed)
curl -sSL https://install.python-poetry.org | python3 -
-
Install dependencies
# Create virtual environment and install dependencies poetry install
-
Create local settings from template
cp access_stats/settings_local.py.tmpl access_stats/settings_local.py cp access_stats/settings.yml.tmpl access_stats/settings.yml # Edit these files with your configuration
-
Apply migrations
poetry run python manage.py migrate
-
Start development server
poetry run python manage.py runserver
First add the dependency to poetry as normal poetry add <dependency_name>
Then run poetry export -f requirements.txt --output requirements.txt --without-hashes