Skip to content

manti-by/manti.by

Repository files navigation

Manti.by

About

Django custom blog engine for music and photo publishing.

CircleCI Docker License

Author: Alexander Chaika manti.by@gmail.com

Source link: https://github.com/manti-by/manti.by

Requirements: Python 3.11, PostgreSQL 15, Redis

Setup dev environment

  1. Install base system packages (second line for production servers)

    $ sudo apt-get install -y wget git-core \
         python3-pip python3-dev postgresql libpq-dev
  2. Install Python 3.11

  3. Install Postgres server

  4. Install Redis server

Build and run app in dev mode

  1. Create virtual environment and install project dependencies

    $ python3.11 -m venv --prompt="manti" .venv/
    $ source .venv/bin/activate
    $ pip install -r requirements.txt
  2. Create user and database

    $ sudo su postgres && psql
    CREATE USER manti_by WITH PASSWORD 'manti_by' CREATEDB;
    CREATE DATABASE manti_by OWNER manti_by;
    
  3. Create local config file (dev or prod environment)

    $ cp manti_by/settings/local.py.example manti_by/settings/local.py
  4. Migrate, collect static files and create admin user

    $ ./manage.py migrate
    $ ./manage.py collectstatic --no-input
    $ ./manage.py createsuperuser
  5. Run local development server

    $ ./manage.py runserver 127.0.0.1:8000

Production setup

  1. Install Docker

  2. Build and run app using Makefile

    $ make build
    $ docker compose up -d