Skip to content

rl-institut/django-offgridplanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Offgridplanner-Django

This tool is the Django-based implementation of the already existing Offgridplanner tool, which originated from the PeopleSun project and was originally written using FastAPI.

Built with Cookiecutter Django Ruff

Web-Application

The open-source tool originated from the PeopleSuN project and serves the planning of off-grid systems in Nigeria. The tool aims to perform a spatial optimization of the distribution grid as well as the design of the energy converters and energy storage.

Docker Network Diagram

Features

The features of the tool are listed below:

  • Automatic Identification of Buildings from OpenStreetMap: Utilizes OpenStreetMap data to automatically identify building locations.
  • Spatial Optimization of the Distribution Grid: Enhances the efficiency of the distribution grid through spatial optimization techniques.
  • Design Optimization of Generation Systems: Optimizes the design of PV systems, battery systems, inverters, and diesel-engines.
  • Automatic Identification for Individual Solar Home Systems: Identifies buildings that are more suitably served by individual solar home systems.

Basic Structure

The application is composed of the following services:

  • django: the application running behind Gunicorn.
  • postgres: PostgreSQL database with the application’s data.
  • redis: Redis instance for caching.
  • traefik: Traefik reverse proxy with HTTPS on by default.
  • celeryworker: Dunning a Celery worker process.
  • flower: To manage and monitor the celery task queue.

Getting Started Locally

With Docker Compose

The environment variables for Docker are defined within the .envs folder. To build the container, open a terminal at the project root and run the following for local development:

docker compose -f docker-compose.local.yml up -d --build

If you want to emulate production environment use docker-compose.production.yml instead. For more information please refer to the cookiecutter-django documentation.

With a local development server

Make sure you have the following installed:

  • Python 3.12
  • PostgreSQL
  • Redis (you may have to install the Windows Subsystem for Linux (WSL) if developing on Windows)
  • Mailpit

Then proceed to the next steps.

  1. Create a virtual environment using python=3.12
  2. Activate your virtual environment
  3. Create a new postgreSQL database
  4. Define your environment variables (you can create a .env file at the root level, it will be read by Django)
POSTGRES_ENGINE=django.db.backends.postgresql
POSTGRES_DB=<your db name>
POSTGRES_USER=<your username>
POSTGRES_PASSWORD=<your password>
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
USE_DOCKER=(yes|no)
DJANGO_DEBUG=(True|False)
  1. Execute the local_setup.sh file (sh local_setup.sh / . local_setup.sh)
  2. Start the redis service with redis-server (you will need to use a WSL terminal if developing on Windows)
  3. Start the celery worker in a separate terminal with celery -A config.celery_app worker -l info (you may have to specify --pool=solo if developing on Windows)
  4. Start your local mail server in a new terminal with mailpit. To view the UI, access http://127.0.0.1:8025/
  5. Start the local development server in a new terminal with python manage.py runserver :)

For more information on developing locally, refer to the cookiecutter-django documentation.

Settings

For more information about Django settings.

About

No description, website, or topics provided.

Resources

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •