Experimental radio CMS based on Flask (Python) micro-framework for Radio Rhino (Strasbourg).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.6KB

Rhino Radio CMS

Experimental webradio CMS based on Flask micro-framework designed for Radio Rhino with YunoHost (not absolutely required but necessary to protect admin).

Install

# On Debian-based distros
sudo apt-get install python3 python3-pip python3-virtualenv virtualenv

###
# If you want to create a virtual environment (i.e. for development purpose)

mkdir ~/.pyvenv
virtualenv -p python3 ~/.pyvenv/rhinoradiocms

source ~/.pyvenv/rhinoradiocms/bin/activate

#
###

###
# If you want to use a local postgresql server

# PostgreSQL and GIS (geographic db)
sudo apt-get install python3-dev postgresql-9.6 postgresql-server-dev-9.6 postgis

# Start PostgreSQL
systemctl start postgresql

sudo su postgres
psql
>>> CREATE DATABASE rhino;
>>> \c rhino;
>>> CREATE EXTENSION postgis;
>>> CREATE USER "rhino" WITH PASSWORD "mypassword";
>>> GRANT ALL ON DATABASE rhino TO "rhino";
>>> \q

#
###

###
# If you want to compile Sass CSS on your machine
sudo apt-get install ruby ruby-dev

gem install --user-install sass
# or
sudo gem install sass

#
###


# WARNING installing with pip will require administrator rights if not installing in a virtual environment, or install with --user
pip install -r requirements.txt

# if needed :
#createlang plpgsql gis

Init the base

# If you modified the password "mypassword", change the  
# url of the variable SQLALCHEMY_DATABASE_URI in the following format
# postgresql://user:password@hostname/rhino

# (Re-)initialize database
python3 manage.py nuke

# Feed database with random placeholder values
python3 manage.py lorem

Develop

Run dev server

python3 manage.py runserver

Access the main page

http://127.0.0.1:5000/site

List the routes

python3 manage.py routes

Admin

Admin interface on : http://domain.tld/admin

Deployment with Gunicorn

Install Gunicorn

pip3 install Gunicorn

More to come.

Uncomment ‘#scheme=“https”’ in views.py

Add environment variables to /lib/systemd/system :

  • AIRTIME_API_KEY
  • STREAM_URL
  • SECRET_KEY
  • FLASK_CONFIG=‘production’

If your podcast files are on a distant machine : set an autofs + sshfs on app/static/podcasts :

sshfs user@distant-ip:/podcasts/dir/

Prod upgrade

git pull
git merge origin master
sass app/static/scss/style.scss:app/static/css/style.css --style compressed
service rhinosite restart

Doc

Eeeeeeeh… Soon™.

Install Sphinx

pip3 install Sphinx