From 3bbc364b2f6d8b4199ed9ffcbd6bf79a8192cb8b Mon Sep 17 00:00:00 2001 From: bkfox Date: Fri, 29 Jul 2016 14:29:45 +0200 Subject: [PATCH] documentation and setup.py --- README.md | 90 ++++++++++++++++++++++++++++++++++++++++--- controllers/models.py | 2 +- requirements.txt | 6 +-- 3 files changed, 88 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 68bfd68..8bf059b 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,91 @@ Platform to manage a radio, schedules, website, and so on. We use the power of g * **cms**: defines models and templates to generate a website connected to Aircox; ## Installation -For now, we provide only applications availables under the aircox directory. Create a django project, and add the aircox applications directory. +### Dependencies +Python modules: +* `django-taggits`: `aircox.programs`, `aircox.cms` +* `watchdog`: `aircox.programs` (used for files monitoring) +* `wagtail`: `aircox.cms` +* `django-honeypot`: `aircox.cms` +* `dateutils`: `aircox.programs` (used for tests) -Later we would provide a package, but now we have other priorities. +Applications: +* `liquidsoap`: `aircox.controllers` (generation of the audio streams) + +### settings.py +Base configuration: + + ```python + INSTALLED_APPS = ( + # dependencies + 'wagtail.wagtailforms', + 'wagtail.wagtailredirects', + 'wagtail.wagtailembeds', + 'wagtail.wagtailsites', + 'wagtail.wagtailusers', + 'wagtail.wagtailsnippets', + 'wagtail.wagtaildocs', + 'wagtail.wagtailimages', + 'wagtail.wagtailsearch', + 'wagtail.wagtailadmin', + 'wagtail.wagtailcore', + 'wagtail.contrib.settings', + 'taggit', + 'honeypot', + + # ... + + # aircox + 'aircox.programs', + 'aircox.controllers', + 'aircox.cms', + ) + + MIDDLEWARE_CLASSES = ( + # ... + 'wagtail.wagtailcore.middleware.SiteMiddleware', + 'wagtail.wagtailredirects.middleware.RedirectMiddleware', + ) + + TEMPLATES = [ + { + # ... + 'OPTIONS': { + 'context_processors': ( + # ... + 'wagtail.contrib.settings.context_processors.settings', + ), + }, + }, + ] + + # define your wagtail site name + WAGTAIL_SITE_NAME = 'My Radio' + ``` + +To enable logging: + + ```python + LOGGING = { + # ... + 'loggers': { + 'aircox.core': { + 'handlers': ['console'], + 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), + }, + 'aircox.test': { + 'handlers': ['console'], + 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), + }, + 'aircox.tools': { + 'handlers': ['console'], + 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), + }, + }, + } + ``` + +Each application have a `settings.py` that defines options that can be reused in application's `settings.py` file. -Dependencies: -* wagtail (cms) -* honeypot (cms) -* taggit (cms, programs) diff --git a/controllers/models.py b/controllers/models.py index 05f7031..d3648d4 100644 --- a/controllers/models.py +++ b/controllers/models.py @@ -28,7 +28,7 @@ import aircox.controllers.settings as settings from aircox.controllers.plugins.plugins import Plugins -logger = logging.getLogger('aircox.controllers') +logger = logging.getLogger('aircox.core') Plugins.discover() diff --git a/requirements.txt b/requirements.txt index a7d5ac1..0f8f0d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ Django>=1.9a1 django-taggit>=0.12.1 -django-suit>=0.2.15 -django-autocomplete-light>=2.2.8 -easy-thumbnails>=2.2 watchdog>=0.8.3 +wagtail>=1.5.3 +django-honeypot>=0.5.0 +dateutils>=0.6.6