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
A small Django app to easily broadcast an announcement across a website.

django-site-broadcasts The site broadcast application allows users to define short messages and announcements that should be displayed across a site.

Ben Lopatin 12 Jan 21, 2020
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
Realtime data read and write without page refresh using Ajax in Django.

Realtime read-write with AJAX Hey,this is the basic implementation type of ajax realtime read write from the database. where you can insert or view re

Mehedi Hasan 3 Dec 13, 2022
Login System Django

Login-System-Django Login System Using Django Tech Used Django Python Html Run Locally Clone project git clone https://link-to-project Get project for

Nandini Chhajed 6 Dec 12, 2021
django CMS Association 1.6k Jan 06, 2023
A collection of models, views, middlewares, and forms to help secure a Django project.

Django-Security This package offers a number of models, views, middlewares and forms to facilitate security hardening of Django applications. Full doc

SD Elements 258 Jan 03, 2023
Awesome Django Blog App

Awesome-Django-Blog-App Made with love django as the backend and Bootstrap as the frontend ! i hope that can help !! Project Title Django provides mul

ANAS NABIL 2 Feb 08, 2022
Dashboad Full Stack utilizando o Django.

Dashboard FullStack completa Projeto finalizado | Informações Cadastro de cliente Menu interatico mostrando quantidade de pessoas bloqueadas, liberada

Lucas Silva 1 Dec 15, 2021
A UUIDField for Django

django-uuidfield Provides a UUIDField for your Django models. Installation Install it with pip (or easy_install): pip install django-uuidfield Usage

David Cramer 265 Nov 30, 2022
This "I P L Team Project" is developed by Prasanta Kumar Mohanty using Python with Django web framework, HTML & CSS.

I-P-L-Team-Project This "I P L Team Project" is developed by Prasanta Kumar Mohanty using Python with Django web framework, HTML & CSS. Screenshots HO

1 Dec 15, 2021
A feature flipper for Django

README Django Waffle is (yet another) feature flipper for Django. You can define the conditions for which a flag should be active, and use it in a num

950 Dec 26, 2022
A fresh approach to autocomplete implementations, specially for Django. Status: v3 stable, 2.x.x stable, 1.x.x deprecated. Please DO regularely ping us with your link at #yourlabs IRC channel

Features Python 2.7, 3.4, Django 2.0+ support (Django 1.11 (LTS), is supported until django-autocomplete-light-3.2.10), Django (multiple) choice suppo

YourLabs 1.7k Jan 01, 2023
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 06, 2023
Wrap the Blockchain API in Django!

django-blockchain Wrap the Blockchain API in Django. Installation pip install django-blockchain Add app in your settings.py INSTALLED_APPS = [ "d

Dmitry Kalinin 2 Feb 04, 2022
Django Advance DumpData

Django Advance Dumpdata Django Manage Command like dumpdata but with have more feature to Output the contents of the database from given fields of a m

EhsanSafir 7 Jul 25, 2022
Django React - Purity Dashboard (Open-Source) | AppSeed

Django React Purity Dashboard Start your Development with an Innovative Admin Template for Chakra UI and React. Purity UI Dashboard is built with over

App Generator 19 Sep 19, 2022
Show how the redis works with Python (Django).

Redis Leaderboard Python (Django) Show how the redis works with Python (Django). Try it out deploying on Heroku (See notes: How to run on Google Cloud

Tom Xu 4 Nov 16, 2021
PEP-484 stubs for django-rest-framework

pep484 stubs for Django REST framework Mypy stubs for DRF 3.12.x. Supports Python 3.6, 3.7, 3.8 and 3.9. Installation pip install djangorestframework-

TypedDjango 303 Dec 27, 2022
Django server-side adapter for Inertia.js

django-inertia Django server-side new adapter for Inertia.js. Getting Started Install the package pip install django-inertia Configure your project A

Samuel Girardin 14 Sep 16, 2022
A GitHub Action for checking Django migrations

🔍 Django migrations checker A GitHub Action for checking Django migrations About This repository contains a Github Action that checks Django migratio

Oda 5 Nov 15, 2022