Skip to content

gl1tchdev/TODO

Repository files navigation

Description

TODO is a minimalistic task manager with built-in telegram notifications. Developed using Django and celery. Try it: http://todo.glitchdev.space

Install

Step 1

Preparing server and environment

git clone https://github.com/gl1tchdev/TODO
cd TODO
apt-get install redis postgresql libpq-dev
sudo -i -u postgres
psql
CREATE DATABASE todo;
exit

Step 2

Create telegram bot and open file TODO/settings.py:
set up environment variable TG_TOKEN and save it paste tg bot link to settings:

TELEGRAM_BOT_LINK = 'paste link here'

Change next lines too:

HOST_NAME = 'full address of application'
REDIS_URL = 'url of redis-server'

Check if postgresql connection data is correct in next lines

DATABASES = ...

Add your host to

ALLOWED_HOSTS = ...

Set up env vars PG_LOGIN and PG_PASS.

Step 3

poetry install
poetry shell
python manage.py migrate
python manage.py collectstatic --noinput

Run

Development

  1. run polling for tg registration app:
python run_polling.py
  1. run celery app and redis-server for tg notifications:
redis-server
celery -A TODO worker -P eventlet
  1. run django app:
python manage.py runserver 8000

Production

Check this source. Do: All daemons need these lines in systemd conf:

Environment="PG_LOGIN=..."
Environment="PG_PASS=..."
Environment="TG_TOKEN=..."
Environment="DJANGO_SETTINGS_MODULE=TODO.settings"
  1. Create todo daemon
...
ExecStart=/path/to/poetry run gunicorn --preload --bind unix:todo.sock TODO.wsgi:application -w 3
...

Start this daemon and enable. Check if todo.sock exists. 2. Create nginx conf

server {
   listen ...
   server_name ...

   location / {
      include proxy_params;
      proxy_pass http://unix:/path/to/project/todo.sock;
   }
   location /static/ {
      root /path/to/project;
   }
}
systemctl restart nginx
  1. Check if redis server works. Create todo_celery daemon:
...
ExecStart=/path/to/poetry run celery -A TODO worker -P eventlet -l info
...

Start this daemon and enable.

  1. Create todo_bot daemon:
...
ExecStart=/path/to/poetry run python run_polling.py
...

Start this daemon and enable. Done!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published