Skip to content

Download stats service to interact with ElasticSearch backend and show download statistics

License

Notifications You must be signed in to change notification settings

cedadev/access-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

access-stats

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.

Configuration

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.

access_stats/settings_local.py

Sensitive settings placed here while debugging/not using the playbook.
Template can be found at access_stats/settings_local.py.tmpl.

access_stats/settings.yml

Contains credentials and configuration for Elasticsearch connection.
Template can be found at access_stats/settings.yml.tmpl.

Set up

Poetry Setup

  1. Install Poetry (if not already installed)

    curl -sSL https://install.python-poetry.org | python3 -
  2. Install dependencies

    # Create virtual environment and install dependencies
    poetry install
  3. 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

Django Setup

  1. Apply migrations

    poetry run python manage.py migrate
  2. Start development server

    poetry run python manage.py runserver

Managing Dependencies

First add the dependency to poetry as normal poetry add <dependency_name>

Then run poetry export -f requirements.txt --output requirements.txt --without-hashes

About

Download stats service to interact with ElasticSearch backend and show download statistics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published