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.html 2.5KB

<h1>Rhino Radio CMS</h1>

<p>Experimental webradio CMS based on Flask micro-framework designed for <a href="http://radiorhino.eu">Radio Rhino</a> with YunoHost (not absolutely required but necessary to protect admin).</p>

<h2>Install</h2>

<pre><code># 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
&gt;&gt;&gt; CREATE DATABASE rhino;
&gt;&gt;&gt; \c rhino;
&gt;&gt;&gt; CREATE EXTENSION postgis;
&gt;&gt;&gt; CREATE USER "rhino";
&gt;&gt;&gt; GRANT ALL ON DATABASE rhino TO "rhino";
&gt;&gt;&gt; \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
</code></pre>

<h2>Init the base</h2>

<pre><code># (Re-)initialize database
python3 manage.py nuke

# Feed database with random placeholder values
python3 manage.py lorem
</code></pre>

<h2>Develop</h2>

<h1>Run dev server</h1>

<pre><code>python3 manage.py runserver
</code></pre>

<h2>Admin</h2>

<p>Admin interface on : http://domain.tld/admin</p>

<h2>Deployment with Gunicorn</h2>

<h1>Install Gunicorn</h1>

<pre><code>pip3 install Gunicorn
</code></pre>

<p>More to come.</p>

<p>Uncomment '#scheme="https"' in views.py</p>

<p>Add environment variables to /lib/systemd/system :</p>

<ul>
<li>AIRTIME<em>API</em>KEY</li>
<li>STREAM_URL</li>
<li>SECRET_KEY</li>
<li>FLASK_CONFIG='production'</li>
</ul>

<p>If your podcast files are on a distant machine : set an autofs + sshfs on app/static/podcasts :
<code>bash
sshfs user@distant-ip:/podcasts/dir/
</code></p>

<h2>Prod upgrade</h2>

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

<h2>Doc</h2>

<p>Eeeeeeeh... Soon™.</p>

<h1>Install Sphinx</h1>

<pre><code>pip3 install Sphinx
</code></pre>