Django backend of Helium's planner application

Overview

CI/CD Codecov Python Versions GitHub License

Helium Platform Project

Prerequisites

  • Python (>= 3.6)
  • Pip (>= 9.0)
  • MySQL (>= 5.7)
  • Redis (>= 3.2)

Getting Started

The Platform is developed using Python and Django.

Project Setup

If developing on Mac, first install Homebrew and install MySQL with brew install mysql.

To setup the Python/Django Platform build environment, execute:

make install

This project is configured to work with a Virtualenv which has now been setup in the .venv folder. If you're unfamiliar with how this works, read up on Virtualenv here. The short version is, virtualenv creates isolated environments for each project's dependencies. To activate and use this environment when developing, execute:

source .venv/bin/activate

All commands below will now be run within the virtualenv (though make commands will always automatically enter the virtualenv before executing).

To ensure the database is in sync with the latest schema, database migrations are generated and run with Django. To run migrations, execute:

make migrate

Once migrations have been run, you can create a super user, which is a standard user that also has access to the /admin site.

python manage.py createsuperuser

Before commits are made, be sure to run tests and check the generated coverage report.

make test

Development

Modules

The Platform project is split up into several modules, all contained within this repository. They are independent modules that can be deployed separately, functioning on separate nodes for scalability.

The project's base configuration is defined under conf. Application-specific configuration variables should have their application name as their prefix.

  • auth
  • common
  • feed
  • importexport
  • planner

Vagrant Development

To emulate a prod-like environment, use the Vagrant box. It's setup is described more thoroughly in the deploy project. This is the recommended way to develop and test for production as this environment is provisioned in the same way other prod-like environments are deployed and interacts with related projects as necessary.

As the Vagrant environment does take a bit more time to setup (even though the setup is largely automated) and can consume more developer and system resources, the local development environment described below is the quickest and easiest way to get up and running.

Local Development

This is the simplest way to get started with minimal effort. To get going (assuming you have followed the "Getting Started" directions above), you should have the ENVIRONMENT environment variable set to "dev".

Now you're all set! To start the development server, execute:

bin/runserver

A development server will be started at http://localhost:8000.

If the USE_NGROK environment variable is set when a dev server is started (using runserver, pyngrok will be used to open a ngrok tunnel.

Additionally, this project also contains a worker that executes asynchronous or scheduled tasks, and the above server can be started with this worker as well. When developing locally, it is less necessary to run this worker (when ENVIRONMENT is "dev", tasks are executed synchronously), but it may still be useful, especially for testing scheduled tasks, so a standalone executable is provided for convenience. To start the server with the worker, ensure Redis is installed locally and instead execute:

bin/runserver --with-worker

Note that credentials to third-party services (for example, AWS services like SES) need to be set in the .env file before those services will work properly. Do NOT commit real credentials to third-party services, even in example files.

Frontend

The frontend is served from a separate repository and can be found here.

Note that the frontend was previously bundled, rendered, and served as a part of this project, but it was pulled out into its own project with the with 1.4.0 release. For reference, checkout the 1.3.8 tag or download it here to see how this was previously done.

Documentation

Auto-generated API documentation is accessible via any environment at /docs. Additional documentation can be found on the Platform Wiki.

Easily share data across your company via SQL queries. From Grove Collab.

SQL Explorer SQL Explorer aims to make the flow of data between people fast, simple, and confusion-free. It is a Django-based application that you can

Grove Collaborative 2.1k Dec 30, 2022
Django-fast-export - Utilities for quickly streaming CSV responses to the client

django-fast-export Utilities for quickly streaming CSV responses to the client T

Matthias Kestenholz 4 Aug 24, 2022
Bootstrap 3 integration with Django.

django-bootstrap3 Bootstrap 3 integration for Django. Goal The goal of this project is to seamlessly blend Django and Bootstrap 3. Want to use Bootstr

Zostera B.V. 2.3k Jan 02, 2023
Declarative model lifecycle hooks, an alternative to Signals.

Django Lifecycle Hooks This project provides a @hook decorator as well as a base model and mixin to add lifecycle hooks to your Django models. Django'

Robert Singer 1k Dec 31, 2022
WeatherApp - Simple Python Weather App

Weather App Please star this repo if you like ⭐ It's motivates me a lot! Stack A

Ruslan Shvetsov 3 Apr 18, 2022
Django Livre Bank

Django Livre Bank Projeto final da academia Construdelas. API de um banco fictício com clientes, contas e transações. Integrantes da equipe Bárbara Sa

Cecília Costa 3 Dec 22, 2021
Log and View requests made on Django

Django Request Viewer Log and view requests made on your Django App Introduction Recently, @ichtrojan and @toniastro released horus, a request logger

Akere Mukhtar 26 May 29, 2022
A Django Webapp performing CRUD operations on Library Database.

CRUD operations - Django Library Database A Django Webapp performing CRUD operations on Library Database. Tools & Technologies used: Django MongoDB HT

1 Dec 05, 2021
E-Commerce Platform

Shuup Shuup is an Open Source E-Commerce Platform based on Django and Python. https://shuup.com/ Copyright Copyright (c) 2012-2021 by Shuup Commerce I

Shuup 2k Jan 07, 2023
Running in outer Django project folder (cd django_project)

Django Running in outer Django project folder (cd django_project) Make Migrations python manage.py makemigrations Migrate to Database python manage.py

1 Feb 07, 2022
RestApi With Django 3.2 And Django Rest Framework

RestApi-With-Django-3.2-And-Django-Rest-Framework Description This repository is a Software of Development with Python. Virtual Using pipenv, virtuale

Daniel Arturo Alejo Alvarez 6 Aug 02, 2022
Django REST Client API

Django REST Client API Client data provider API.

Ulysses Monteiro 1 Nov 08, 2021
An insecure login and registration website with Django.

An insecure login and registration website with Django.

Luis Quiñones Requelme 1 Dec 05, 2021
xsendfile etc wrapper

Django Sendfile This is a wrapper around web-server specific methods for sending files to web clients. This is useful when Django needs to check permi

John Montgomery 476 Dec 01, 2022
GeoDjango provides geospatial extensions to the Django web dev framework

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. All documentation is in the "docs" directo

Paul Smith 20 Sep 20, 2022
A task management system created using Django 4.0 and Python 3.8 for a hackathon.

Task Management System A task management app for Projects created using Django v4.0 and Python 3.8 for educational purpose. This project was created d

Harsh Agarwal 1 Dec 12, 2021
No effort, no worry, maximum performance.

Django Cachalot Caches your Django ORM queries and automatically invalidates them. Documentation: http://django-cachalot.readthedocs.io Table of Conte

NoriPyt 980 Jan 06, 2023
Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.

Django-environ django-environ allows you to use Twelve-factor methodology to configure your Django application with environment variables. import envi

Daniele Faraglia 2.7k Jan 07, 2023
Returns unicode slugs

Python Slugify A Python slugify application that handles unicode. Overview Best attempt to create slugs from unicode strings while keeping it DRY. Not

Val Neekman (AvidCoder) 1.3k Dec 23, 2022
MAC address Model Field & Form Field for Django apps

django-macaddress MAC Address model and form fields for Django We use netaddr to parse and validate the MAC address. The tests aren't complete yet. Pa

49 Sep 04, 2022