diff --git a/.gitignore b/.gitignore index ba273647f516402a18206e99f53ff708070f38a5..0bdba3573e80e33bf4ca5cb47231ed9c5d91dbef 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ pv/site_media/note_images/* pv/site_media/host_images/* pv/site_media/__sized__/* pv/cache/* -pv/mysql.cnf \ No newline at end of file +pv/mysql.cnf +pv/postgresql.cnf \ No newline at end of file diff --git a/README.rst b/README.rst index b03edc78b9aa898577946bea286a0907baf3150f..7dc2328d569dca03473c69e3f33b02439ed2ca87 100644 --- a/README.rst +++ b/README.rst @@ -15,13 +15,20 @@ and log into it at http://127.0.0.1:8000/admin/ with username "admin" and passwo To get setup you must have the following installed: - * MySQL-Client Development libraries + * PostgresSQL or MySQL-Client Development libraries * JPEG library development files * Python 3.5 including Development files * virtualenv 1.11 In Debian or Ubuntu (or derivatives) you should be able to achieve this with this command:: +Using PostgreSQL: + + $ sudo apt-get install postgresql postgresql-contrib libjpeg-dev python3.5-dev virtualenv + + +Using MySQL: + $ sudo apt-get install libmysqlclient-dev libjpeg-dev python3.5-dev virtualenv Setting up the environment @@ -57,6 +64,26 @@ Open pv/local_settings.py again and add the line:: USE_TZ = False + +Setting up PostgreSQL +---------------- + +We recommend using PostgreSQL in order to be able to use the collation utf8mb64_unicode_ci and thus being able to display all languages. + +To use PostgreSQL, add the following to your local_settings.py (before migrating) and add your credentials:: + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': '', + 'USER': '', + 'PASSWORD': '', + 'HOST': 'localhost', + 'PORT': '5432' + } +} + + Setting up MySQL ---------------- diff --git a/program/migrations/0018_auto_20190810_1146.py b/program/migrations/0018_auto_20190810_1146.py new file mode 100644 index 0000000000000000000000000000000000000000..1ed33a09088bd7febb08de51589c1d280b1beef0 --- /dev/null +++ b/program/migrations/0018_auto_20190810_1146.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.3 on 2019-08-10 11:46 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0017_auto_20180314_1409'), + ] + + operations = [ + migrations.AlterField( + model_name='show', + name='cba_series_id', + field=models.IntegerField(blank=True, help_text="Link your show to a CBA series by giving its ID. This will enable CBA upload and will automatically link your show to your CBA archive. Find out your show's ID under https://cba.fro.at/series", null=True, verbose_name='CBA Series ID'), + ), + migrations.AlterField( + model_name='show', + name='fallback_id', + field=models.IntegerField(blank=True, help_text='If a timeslot of your show is empty, this playlist will be aired as a backup.', null=True, verbose_name='Fallback ID'), + ), + migrations.AlterField( + model_name='show', + name='logo', + field=models.ImageField(blank=True, help_text='Upload a logo of your show.', null=True, upload_to='show_images', verbose_name='Logo'), + ), + migrations.AlterField( + model_name='show', + name='short_description', + field=models.TextField(help_text='Describe your show for your listeners in some sentences. Avoid technical data like airing times and contact information. They will be added automatically.', verbose_name='Short description'), + ), + ] diff --git a/pv/settings.py b/pv/settings.py index fd964b15dcf5e60a0de609e1f05244a9bd43d813..5ece1568bef969b3930a01912d34a0f665af0d6d 100644 --- a/pv/settings.py +++ b/pv/settings.py @@ -43,6 +43,15 @@ DATABASES = { 'NAME': os.path.join(PROJECT_DIR, 'dev_data.sqlite'), }, + """ + 'default': { + 'ENGINE': 'django.db.backends.postgresql', + 'OPTIONS': { + 'read_default_file': os.path.join(PROJECT_DIR, 'postgresql.cnf'), + }, + }, + """ + """ # MySQL 'default': { @@ -50,8 +59,9 @@ DATABASES = { 'OPTIONS': { 'read_default_file': os.path.join(PROJECT_DIR, 'mysql.cnf'), }, - } + }, """ + # Deprecated 'nop': { 'ENGINE': 'django.db.backends.sqlite3', diff --git a/requirements.txt b/requirements.txt index aa2c64880c7cb62edc57812e8e4427ed1baa278b..1e1560ab962cefc3418a8ef41f81ff328e73ccb2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,8 @@ Django==1.11.3 mysqlclient +postgresql +postgresql-contrib +psycopg2 Pillow==4.2.1 PyYAML==3.12 django-tinymce==2.6.0