simple project management tool for educational purposes

Overview

Taskcamp

Unittests with coverage Build docker and push codecov

This software is used for educational and demonstrative purposes. It's a simple project management tool powered by Django Framework

Features:

  • Class-Based Views approach
  • Login, Sign Up, Recover (LoginView, FormView, UserCreationForm, PasswordResetForm, LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView)
  • Custom Extended User model (AbstractUser, BaseUserManager, UserManager)
  • Permissions and Groups (LoginRequiredMixin, PermissionRequiredMixin)
  • Simple CRUD views (ListView, DetailView, CreateView, UpdateView, DeleteView)
  • File uploading
  • Statistics (TemplateView, View, Q, F, Count, FloatField, Cast, Case, When, Sum, Avg)
  • Forms (Form, ModelForm)
  • Admin page (ModelAdmin, TabularInline)
  • Template and layouts (include templates, blocks, custom 500, 404, 403 handlers)
  • Router urls (include, namespace, params)
  • Caching (memcached)
  • Async workers with celery
  • Localization and internationalization (with pluralization)
  • Timezone support (pytz)
  • Markdown syntax, Status highlight (Template tags)
  • DB router (master, slave)
  • Unittests with coverage
  • Uwsgi (with static and media serving)
  • Docker and docker-compose
  • kubernetes deploy

Components:

Install


Types of installation

  1. Bare metal
  2. Docker
  3. Docker-compose
  4. Kubernetes

Bare metal install

  1. install python3 and create virtual env
python3 -m venv venv
source venv/bin/activate
  1. install requirements
pip install -r requirements.txt
  1. put django secret key into file .env generate DJANGO_SECRET_KEY
echo DJANGO_SECRET_KEY=\'$(python3 -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())')\'  >> .env

or just create test

echo DJANGO_SECRET_KEY=test_secret_key  >> .env
  1. add connection data to .env file
>.env << __EOF__
RABBITMQ_HOST=192.168.10.1
RABBITMQ_PORT=5673
RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASS=adminsecret
RABBITMQ_DEFAULT_VHOST=celery

POSTGRES_HOST=192.168.10.1
POSTGRES_PORT=5434
POSTGRES_DB=taskcamp
POSTGRES_USER=taskcamp
POSTGRES_PASSWORD=secret

MEMCACHED_LOCATION=192.168.10.1:11214

EMAIL_HOST=192.168.10.1
EMAIL_PORT=1025
__EOF__
# if you need a debug be enabled
>>.env << __EOF__
DJANGO_DEBUG=True
__EOF__

#if you need to keep celery results 
>>.env << __EOF__
REDIS_RESULTS_BACKEND=redis://192.168.10.1:6380/0
__EOF__
  1. create and run postgresql, memcached, mailcatcher and rabbitmq instance (if needed)
docker run -d --name taskcamp-postgres --hostname taskcamp-postgres \
    -p 5434:5432 --env-file .env postgres:13-alpine
    
docker run -d -p 11214:11211 --name taskcamp-memcached memcached:alpine

docker run -d -p 15673:15672 -p 5673:5672 \
  --name taskcamp-rabbit --hostname taskcamp-rabbit \
  --env-file .env rabbitmq:3.8.14-management-alpine

docker run -d -p 1080:1080 -p 1025:1025 \
 --name taskcamp-mailcatcher iliadmitriev/mailcatcher
# if you enabled REDIS_RESULTS_BACKEND to store celery results
docker run -d --name taskcamp-redis --hostname taskcamp-redis \
 -p 6380:6379 redis:alpine
  1. export variables from .env file
export $(cat .env | xargs)
  1. create a db (run migrations)
python3 manage.py migrate --no-input
  1. compile messages
python3 manage.py compilemessages -i venv
  1. create superuser
python3 manage.py createsuperuser

Docker install

Prepare

  1. create .env file
>.env << __EOF__
RABBITMQ_HOST=taskcamp-rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASS=adminsecret
RABBITMQ_DEFAULT_VHOST=celery

POSTGRES_HOST=taskcamp-postgres
POSTGRES_PORT=5432
POSTGRES_DB=taskcamp
POSTGRES_USER=taskcamp
POSTGRES_PASSWORD=secret

MEMCACHED_LOCATION=taskcamp-memcached:11211
REDIS_RESULTS_BACKEND=redis://taskcamp-redis:6379/0

EMAIL_HOST=taskcamp-mail
EMAIL_PORT=1025
__EOF__
  1. create network taskcamp-network
docker network create taskcamp-network
  1. create docker containers (this is just an example, you shouldn't run in production like this)
docker run -d --name taskcamp-postgres --hostname taskcamp-postgres \
    --env-file .env --network taskcamp-network postgres:13-alpine
    
docker run -d --name taskcamp-memcached --hostname taskcamp-memcached \
    --network taskcamp-network memcached:alpine

docker run -d \
  --name taskcamp-rabbitmq --hostname taskcamp-rabbitmq \
  --env-file .env --network taskcamp-network \
  rabbitmq:3.8.14-management-alpine

docker run -d --name taskcamp-mail --hostname taskcamp-mail \
  --network taskcamp-network -p 1080:1080 iliadmitriev/mailcatcher
 
docker run -d --name taskcamp-redis --hostname taskcamp-redis \
  --network taskcamp-network redis:alpine

Build and run

  1. build docker image taskcamp-python
docker build -t taskcamp-python -f Dockerfile ./
  1. run django web application
docker run -p 8000:8000 --env-file=.env -d --name=taskcamp-django \
  --hostname=taskcamp-django --network taskcamp-network taskcamp-python
  1. run celery
docker run --env-file=.env -d --name=taskcamp-celery --hostname=taskcamp-celery \
   --network taskcamp-network taskcamp-python python3 -m celery -A worker worker
  1. apply migrations
docker run --env-file=.env --rm -ti --network taskcamp-network taskcamp-python \
    python3 manage.py migrate
  1. create superuser
docker run --env-file=.env --rm -ti --network taskcamp-network taskcamp-python \
    python3 manage.py createsuperuser

Clean up

docker rm -f $(docker ps --filter name=^taskcamp -a -q)
docker network rm taskcamp-network
docker rmi taskcamp-python

Docker-compose install

  1. create .env environment variables file
>.env << __EOF__
RABBITMQ_HOST=taskcamp-rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASS=adminsecret
RABBITMQ_DEFAULT_VHOST=celery

POSTGRES_HOST=taskcamp-postgres
POSTGRES_PORT=5432
POSTGRES_DB=taskcamp
POSTGRES_USER=taskcamp
POSTGRES_PASSWORD=secret

MEMCACHED_LOCATION=taskcamp-memcached:11211
REDIS_RESULTS_BACKEND=redis://taskcamp-redis:6379/0

EMAIL_HOST=taskcamp-mail
EMAIL_PORT=1025
__EOF__
  1. start docker-compose services
docker-compose up -d
  1. apply migrations
docker-compose exec django python3 manage.py migrate
  1. create superuser
docker-compose exec django python3 manage.py createsuperuser
  1. load test data if needed
cat data.json | docker-compose exec -T django python3 manage.py loaddata --format=json - 

Docker-compose clean up

docker-compose down --rmi all --volumes

Development


  1. set environment variables
DJANGO_DEBUG=True
  1. make migrations and migrate
python3 manage.py makemigrations
python3 manage.py migrate
  1. make messages
python3 manage.py makemessages -a -i venv
python3 manage.py compilemessages -i venv
  1. run
python3 manage.py runserver 0:8000
  1. run celery for emails and other async tasks
python3 -m celery -A worker worker
# or
celery -A worker worker
  1. run celery for emails and other async tasks
python3 -m celery -A worker worker
# or
celery -A worker worker

with log level and queue

celery -A worker worker -l INFO -Q email

Testing

Run tests

  1. run all tests
python3 manage.py test
  1. run with keeping db in case of test fails
python3 manage.py test --keepdb
  1. run all tests with details
python3 manage.py test --verbosity=2

Run tests with coverage

  1. run with coverage
coverage run manage.py test --verbosity=2
  1. print report with missing lines and fail with error in case it's not fully covered
coverage report -m --fail-under=100
Owner
Ilia Dmitriev
Python, Django, REST Framework, aiohttp, SQLAlchemy, Marshmallow, Vue.js, Vuex, vue-router, Nuxt, Javascript, Docker, Kubernetes, postgresql, php, C++
Ilia Dmitriev
Django datatables with htmx.

Django datatables with htmx.

Regis Santos 7 Oct 23, 2022
Django friendly finite state machine support

Django friendly finite state machine support django-fsm adds simple declarative state management for django models. If you need parallel task executio

Viewflow 2.1k Dec 31, 2022
Hotwired/Turbo Django response helpers

This package provides helpers for server-side rendering of Hotwired/Turbo streams and frames. Disclaimer: the Hotwired/Turbo client libraries are, at

Hotwire for Django 66 Apr 07, 2022
Inject an ID into every log message from a Django request. ASGI compatible, integrates with Sentry, and works with Celery

Django GUID Now with ASGI support! Django GUID attaches a unique correlation ID/request ID to all your log outputs for every request. In other words,

snok 300 Dec 29, 2022
A Django web application that allows you to be in the loop about everything happening in your neighborhood.

A Django web application that allows you to be in the loop about everything happening in your neighborhood. From contact information of different handyman to meeting announcements or even alerts.

Kennedy Ngugi Mwaura 3 Dec 11, 2022
Django React Flight Rezervation

Django Intro & Installation python -m venv venv source ./venv/Scripts/activate pip install Django pip install djangorestframework pip install python-d

HILMI SARIOGLU 2 May 26, 2022
Developer-friendly asynchrony for Django

Django Channels Channels augments Django to bring WebSocket, long-poll HTTP, task offloading and other async support to your code, using familiar Djan

Django 5.5k Dec 29, 2022
Domain-driven e-commerce for Django

Domain-driven e-commerce for Django Oscar is an e-commerce framework for Django designed for building domain-driven sites. It is structured such that

Oscar 5.6k Jan 01, 2023
Quick example of a todo list application using Django and HTMX

django-htmx-todo-list Quick example of a todo list application using Django and HTMX Background Modified & expanded from https://github.com/jaredlockh

Jack Linke 54 Dec 10, 2022
An orgizational tool to keep track of tasks/projects and the time spent on them.

Django-Task-Manager Task Tracker using Python Django About The Project This project is an orgizational tool to keep track of tasks/projects and the ti

Nick Newton 1 Dec 21, 2021
Yet another Django audit log app, hopefully the simplest one.

django-easy-audit Yet another Django audit log app, hopefully the easiest one. This app allows you to keep track of every action taken by your users.

Natán 510 Jan 02, 2023
Sistema administrador de contranas desarrollador en Django

Sistema Contrasenas Desarrolado en Django Proyecto sistema de administracion de contraseñas, de la experiencia educativa Programacion Segura Descripci

Ibrain Rodriguez Espinoza 1 Sep 24, 2022
A BitField extension for Django Models

django-bitfield Provides a BitField like class (using a BigIntegerField) for your Django models. (If you're upgrading from a version before 1.2 the AP

DISQUS 361 Dec 22, 2022
Run Django tests with testcontainers.

django-rdtwt (Run Django Tests With Testcontainers) This targets users who wish to forget setting up a database for tests. There's no manually startin

2 Jan 09, 2022
Indonesia's negative news detection using gaussian naive bayes with Django+Scikir Learn

Introduction Indonesia's negative news detection using gaussian naive bayes build with Django and Scikit Learn. There is also any features, are: Input

Harifzi Ham 1 Dec 30, 2021
Store model history and view/revert changes from admin site.

django-simple-history django-simple-history stores Django model state on every create/update/delete. This app supports the following combinations of D

Jazzband 1.8k Jan 08, 2023
django CMS Association 1.6k Jan 06, 2023
Analytics services for Django projects

django-analytical The django-analytical application integrates analytics services into a Django project. Using an analytics service with a Django proj

Jazzband 1.1k Dec 31, 2022
A slick ORM cache with automatic granular event-driven invalidation.

Cacheops A slick app that supports automatic or manual queryset caching and automatic granular event-driven invalidation. It uses redis as backend for

Alexander Schepanovski 1.7k Jan 03, 2023
Dynamic Django settings.

Constance - Dynamic Django settings A Django app for storing dynamic settings in pluggable backends (Redis and Django model backend built in) with an

Jazzband 1.5k Jan 07, 2023