Skip to content

Latest commit

 

History

History
executable file
·
115 lines (77 loc) · 2.42 KB

README.md

File metadata and controls

executable file
·
115 lines (77 loc) · 2.42 KB

Python Django Telegram

What's inside

Docker Python pgAdmin Postgres

APIs used

Telegram openweathermap jokeapi NBU

Requirements

  1. Install Docker v20.10+ for your platform:

  2. For Linux additionally install Docker Compose v1.29+

Setup

  1. Create .env file
cp .env.example .env
  1. Enter your keys:
TELEGRAM_BOT_API_KEY=
OPENWEATHERMAP_TOKEN=
  1. Build the images and spin up the containers:
docker compose up -d
  1. Visit:
  1. Connect to py_django terminal
docker exec -it py_django bash
  1. Start bot
python manage.py telegram

Development

  1. Connect to py_django terminal
docker exec -it py_django bash
  1. Creating an admin user
python manage.py createsuperuser
  1. Working with models:
python manage.py makemigrations

python manage.py migrate

PgAdmin

  1. Visit:
  1. Login
  1. Add new Server:
name: py_db
host name/address: py_db
username: python
password: python

FAQ

  1. Django Documentation