Marti2203 / cosmos-website

Cosmos website in Django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cosmos Website

Instructions

  1. Create A python virtual enviroment
py -3 -m venv venv
  1. Activate Python virtual environment
source ./venv/bin/activate
  1. Install MariaDB
# Arch Linux
yay -S mariadb mariadb-libs
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

# OpenSUSE
sudo zypper install libmariadb-devel

# ALL
sudo systemctl start mariadb
sudo mysql_secure_installation
y, y, <password>, y, y, y, y
  1. Initialize database
mysql -u root -p
  1. Init test database
mysql -u root -p
source ./init_db.sql
  1. Install Python dependencies
pip install -r requirements
  1. Copy settings.template into settings.py
cp mysite/settings.template.py mysite/settings.py
  1. Configure settings.template

  2. Run python manage.py migrate

Django has a system for migrations to prevent loads of changes, both in the db and backend. This command fixes up the database according to the model in the backend.

  1. Run python manage.py createsuperuser

This creates an administrator account which is required for creating any sort of content for the CMS.

  1. Run `python manage.py runserver'

This should start the server and give a reference to hat port is is running on.

Changes

  • switch from MySQL to MariaDB (community-developed fork, read Google)
  • upgraded from Django 2 to Django 3
  • CMS Plugins have a render method which does not do anything

TODO

  • use os.path.join
  • keep database schema inside of git repository
  • remove all referenes of mysite and call it digitalcosmos

About

Cosmos website in Django


Languages

Language:HTML 49.8%Language:Python 39.0%Language:JavaScript 9.2%Language:CSS 2.0%