From 103a909a999ecb8e2bce2cf84e4ec39968223a53 Mon Sep 17 00:00:00 2001
From: Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com>
Date: Wed, 13 Apr 2011 20:53:29 +0200
Subject: [PATCH] getting real.

---
 .gitignore                                    |  3 +-
 docs/LICENSE.rst => LICENSE                   |  0
 README.rst                                    | 46 +++++++++++++------
 helsinki/program/__init__.py => __init__.py   |  0
 helsinki/__init__.py                          |  6 ---
 helsinki/program/search_sites.py              |  2 -
 .../search/indexes/program/note_text.txt      |  2 -
 .../search/indexes/program/show_text.txt      |  3 --
 helsinki/program/urls_program.py              | 35 --------------
 helsinki/program/manage.py => manage.py       |  0
 .../templatetags => program}/__init__.py      |  0
 {helsinki/program => program}/admin.py        |  0
 .../fixtures/broadcastformats.yaml            |  0
 .../program => program}/fixtures/hosts.yaml   |  0
 .../fixtures/musicfocus.yaml                  |  0
 .../program => program}/fixtures/rrules.yaml  |  0
 .../fixtures/showinformation.yaml             |  0
 .../program => program}/fixtures/shows.yaml   |  0
 .../fixtures/showtopics.yaml                  |  0
 .../management/__init__.py                    |  0
 .../management/commands/__init__.py           |  0
 .../management/commands/importhosts.py        |  2 +-
 .../management/commands/importnotes.py        |  2 +-
 .../management/commands/importprogramslots.py |  2 +-
 .../management/commands/importshows.py        |  2 +-
 {helsinki/program => program}/models.py       |  0
 .../program => program}/search_indexes.py     |  6 +--
 .../templatetags/__init__.py                  |  0
 .../templatetags/content_boxes.py             | 16 +++----
 program/urls.py                               | 35 ++++++++++++++
 {helsinki/program => program}/views.py        | 15 ++----
 requirements.txt                              |  7 +++
 search_sites.py                               |  2 +
 helsinki/program/settings.py => settings.py   | 33 +++++++------
 setup.py                                      | 35 --------------
 .../site_media => site_media}/styles/base.css |  0
 .../program/templates => templates}/404.html  |  0
 .../program/templates => templates}/500.html  |  0
 .../program/templates => templates}/base.html |  0
 .../program/boxes/broadcastformat.html        |  2 +-
 .../program/boxes/current.html                |  0
 .../program/boxes/musicfocus.html             |  2 +-
 .../program/boxes/recommendations.html        |  0
 .../program/boxes/showinformation.html        |  2 +-
 .../program/boxes/showtopic.html              |  2 +-
 .../program/day_schedule.html                 |  0
 .../program/host_detail.html                  |  0
 .../program/host_list.html                    |  0
 .../program/recommendations.html              |  0
 .../program/show_detail.html                  |  3 +-
 .../program/show_list.html                    |  0
 .../program/timeslot_detail.html              |  0
 .../program/week_schedule.html                |  0
 .../indexes/program/note_SearchableText.txt   |  0
 .../indexes/program/show_SearchableText.txt   |  0
 helsinki/program/urls.py => urls.py           |  6 +--
 56 files changed, 118 insertions(+), 153 deletions(-)
 rename docs/LICENSE.rst => LICENSE (100%)
 rename helsinki/program/__init__.py => __init__.py (100%)
 delete mode 100644 helsinki/__init__.py
 delete mode 100644 helsinki/program/search_sites.py
 delete mode 100644 helsinki/program/templates/search/indexes/program/note_text.txt
 delete mode 100644 helsinki/program/templates/search/indexes/program/show_text.txt
 delete mode 100644 helsinki/program/urls_program.py
 rename helsinki/program/manage.py => manage.py (100%)
 rename {helsinki/program/templatetags => program}/__init__.py (100%)
 rename {helsinki/program => program}/admin.py (100%)
 rename {helsinki/program => program}/fixtures/broadcastformats.yaml (100%)
 rename {helsinki/program => program}/fixtures/hosts.yaml (100%)
 rename {helsinki/program => program}/fixtures/musicfocus.yaml (100%)
 rename {helsinki/program => program}/fixtures/rrules.yaml (100%)
 rename {helsinki/program => program}/fixtures/showinformation.yaml (100%)
 rename {helsinki/program => program}/fixtures/shows.yaml (100%)
 rename {helsinki/program => program}/fixtures/showtopics.yaml (100%)
 rename {helsinki/program => program}/management/__init__.py (100%)
 rename {helsinki/program => program}/management/commands/__init__.py (100%)
 rename {helsinki/program => program}/management/commands/importhosts.py (95%)
 rename {helsinki/program => program}/management/commands/importnotes.py (97%)
 rename {helsinki/program => program}/management/commands/importprogramslots.py (98%)
 rename {helsinki/program => program}/management/commands/importshows.py (97%)
 rename {helsinki/program => program}/models.py (100%)
 rename {helsinki/program => program}/search_indexes.py (67%)
 rename docs/CHANGES.rst => program/templatetags/__init__.py (100%)
 rename {helsinki/program => program}/templatetags/content_boxes.py (54%)
 create mode 100644 program/urls.py
 rename {helsinki/program => program}/views.py (93%)
 create mode 100644 requirements.txt
 create mode 100644 search_sites.py
 rename helsinki/program/settings.py => settings.py (70%)
 delete mode 100644 setup.py
 rename {helsinki/program/site_media => site_media}/styles/base.css (100%)
 rename {helsinki/program/templates => templates}/404.html (100%)
 rename {helsinki/program/templates => templates}/500.html (100%)
 rename {helsinki/program/templates => templates}/base.html (100%)
 rename helsinki/program/templates/program/box_broadcastformat.html => templates/program/boxes/broadcastformat.html (74%)
 rename helsinki/program/templates/program/current_box.html => templates/program/boxes/current.html (100%)
 rename helsinki/program/templates/program/box_musicfocus.html => templates/program/boxes/musicfocus.html (82%)
 rename helsinki/program/templates/program/recommendations_box.html => templates/program/boxes/recommendations.html (100%)
 rename helsinki/program/templates/program/box_showinformation.html => templates/program/boxes/showinformation.html (82%)
 rename helsinki/program/templates/program/box_showtopic.html => templates/program/boxes/showtopic.html (83%)
 rename {helsinki/program/templates => templates}/program/day_schedule.html (100%)
 rename {helsinki/program/templates => templates}/program/host_detail.html (100%)
 rename {helsinki/program/templates => templates}/program/host_list.html (100%)
 rename {helsinki/program/templates => templates}/program/recommendations.html (100%)
 rename {helsinki/program/templates => templates}/program/show_detail.html (94%)
 rename {helsinki/program/templates => templates}/program/show_list.html (100%)
 rename {helsinki/program/templates => templates}/program/timeslot_detail.html (100%)
 rename {helsinki/program/templates => templates}/program/week_schedule.html (100%)
 rename {helsinki/program/templates => templates}/search/indexes/program/note_SearchableText.txt (100%)
 rename {helsinki/program/templates => templates}/search/indexes/program/show_SearchableText.txt (100%)
 rename helsinki/program/urls.py => urls.py (69%)

diff --git a/.gitignore b/.gitignore
index 3011f78b..eb29dcd0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 *.pyc
-*.sqlite
\ No newline at end of file
+dev_data.sqlite
+local_settings.py
diff --git a/docs/LICENSE.rst b/LICENSE
similarity index 100%
rename from docs/LICENSE.rst
rename to LICENSE
diff --git a/README.rst b/README.rst
index 0667df6f..8480e0b3 100644
--- a/README.rst
+++ b/README.rst
@@ -1,19 +1,39 @@
+=================================
 Radio Helsinki Program Management
 =================================
 
-Requirements
-------------
+Installation
+============
+
+To get setup you must have the following installed:
+
+ * Python 2.6
+ * virtualenv 1.5
+
+Setting up the environment
+--------------------------
+
+Create a virtual environment where the dependencies will live::
+
+    $ virtualenv --no-site-packages helsinki
+    $ source helsinki/bin/activate
+    (helsinki)$
+
+Install the project dependencies::
+
+    (helsinki)$ pip install -r requirements.txt
+
+Setting up the database
+-----------------------
+
+By default the project is set up to run on a SQLite database.  You can run::
+
+    (helsinki)$ python manage.py syncdb
+    (helsinki)$ python manage.py loaddata program/fixtures/*.yaml
 
-- Django 1.2.5: http://pypi.python.org/pypi/Django/1.2.5
-- PIL: http://pypi.python.org/pypi/PIL/1.1.6
-- python-dateutil: http://pypi.python.org/pypi/python-dateutil/1.5
-- PyYAML: http://pypi.python.org/pypi/PyYAML/3.09
-- MySQL-python: http://pypi.python.org/pypi/MySQL-python/1.2.3
-- django-haystack: http://pypi.python.org/pypi/django-haystack/1.1.0
-- pysolr: http://pypi.python.org/pypi/pysolr/2.0.13
+Running a web server
+--------------------
 
-Author
-------
+In development you should run::
 
-Ernesto Rico-Schmidt
-Contributions: Johannes Raggam
+    (helsinki)$ python manage.py runserver
diff --git a/helsinki/program/__init__.py b/__init__.py
similarity index 100%
rename from helsinki/program/__init__.py
rename to __init__.py
diff --git a/helsinki/__init__.py b/helsinki/__init__.py
deleted file mode 100644
index f48ad105..00000000
--- a/helsinki/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
-try:
-    __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
-    from pkgutil import extend_path
-    __path__ = extend_path(__path__, __name__)
diff --git a/helsinki/program/search_sites.py b/helsinki/program/search_sites.py
deleted file mode 100644
index fe5127ac..00000000
--- a/helsinki/program/search_sites.py
+++ /dev/null
@@ -1,2 +0,0 @@
-import haystack
-haystack.autodiscover()
\ No newline at end of file
diff --git a/helsinki/program/templates/search/indexes/program/note_text.txt b/helsinki/program/templates/search/indexes/program/note_text.txt
deleted file mode 100644
index 2421b4f0..00000000
--- a/helsinki/program/templates/search/indexes/program/note_text.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-{{ object.title }}
-{{ object.content }}
\ No newline at end of file
diff --git a/helsinki/program/templates/search/indexes/program/show_text.txt b/helsinki/program/templates/search/indexes/program/show_text.txt
deleted file mode 100644
index f08b515a..00000000
--- a/helsinki/program/templates/search/indexes/program/show_text.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ object.name }}
-{{ object.description }}
-{{ object.short_description }}
\ No newline at end of file
diff --git a/helsinki/program/urls_program.py b/helsinki/program/urls_program.py
deleted file mode 100644
index a93db83d..00000000
--- a/helsinki/program/urls_program.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from django.conf.urls.defaults import *
-
-from django.views.generic.list_detail import object_detail, object_list
-
-from models import BroadcastFormat, Host, Show, TimeSlot
-from views import current_show, day_schedule, recommendations, show_list, week_schedule
-
-host_dict = {
-    'queryset': Host.objects.all(),
-    'template_object_name': 'host'
-}
-show_dict = {
-    'queryset': Show.objects.all(),
-    'template_object_name': 'show'
-}
-timeslot_dict = {
-    'queryset': TimeSlot.objects.all(),
-    'template_object_name': 'timeslot'
-}
-recommendation_dict = {'template_name': 'program/recommendations_box.html'}
-
-urlpatterns = patterns('',
-    (r'^today/?$', day_schedule),
-    (r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/?$', day_schedule),
-    (r'^(?P<year>\d{4})/(?P<week>\d{1,2})/?$', week_schedule),
-    (r'^current_box/?$', current_show),
-    (r'^hosts/?$', object_list, host_dict),
-    url(r'^hosts/(?P<object_id>\d+)/?$', object_detail, host_dict, name='host-detail'),
-    (r'^tips/?$', recommendations),
-    (r'^tips_box/?$', recommendations, recommendation_dict),
-    (r'^shows/?$', show_list),
-    url(r'^shows/(?P<slug>[\w-]+)/?$', object_detail, show_dict, name='show-detail'),
-    url(r'^(?P<object_id>\d+)/?$', object_detail, timeslot_dict, name='timeslot-detail'),
-    (r'^week/?$', week_schedule)
-)
diff --git a/helsinki/program/manage.py b/manage.py
similarity index 100%
rename from helsinki/program/manage.py
rename to manage.py
diff --git a/helsinki/program/templatetags/__init__.py b/program/__init__.py
similarity index 100%
rename from helsinki/program/templatetags/__init__.py
rename to program/__init__.py
diff --git a/helsinki/program/admin.py b/program/admin.py
similarity index 100%
rename from helsinki/program/admin.py
rename to program/admin.py
diff --git a/helsinki/program/fixtures/broadcastformats.yaml b/program/fixtures/broadcastformats.yaml
similarity index 100%
rename from helsinki/program/fixtures/broadcastformats.yaml
rename to program/fixtures/broadcastformats.yaml
diff --git a/helsinki/program/fixtures/hosts.yaml b/program/fixtures/hosts.yaml
similarity index 100%
rename from helsinki/program/fixtures/hosts.yaml
rename to program/fixtures/hosts.yaml
diff --git a/helsinki/program/fixtures/musicfocus.yaml b/program/fixtures/musicfocus.yaml
similarity index 100%
rename from helsinki/program/fixtures/musicfocus.yaml
rename to program/fixtures/musicfocus.yaml
diff --git a/helsinki/program/fixtures/rrules.yaml b/program/fixtures/rrules.yaml
similarity index 100%
rename from helsinki/program/fixtures/rrules.yaml
rename to program/fixtures/rrules.yaml
diff --git a/helsinki/program/fixtures/showinformation.yaml b/program/fixtures/showinformation.yaml
similarity index 100%
rename from helsinki/program/fixtures/showinformation.yaml
rename to program/fixtures/showinformation.yaml
diff --git a/helsinki/program/fixtures/shows.yaml b/program/fixtures/shows.yaml
similarity index 100%
rename from helsinki/program/fixtures/shows.yaml
rename to program/fixtures/shows.yaml
diff --git a/helsinki/program/fixtures/showtopics.yaml b/program/fixtures/showtopics.yaml
similarity index 100%
rename from helsinki/program/fixtures/showtopics.yaml
rename to program/fixtures/showtopics.yaml
diff --git a/helsinki/program/management/__init__.py b/program/management/__init__.py
similarity index 100%
rename from helsinki/program/management/__init__.py
rename to program/management/__init__.py
diff --git a/helsinki/program/management/commands/__init__.py b/program/management/commands/__init__.py
similarity index 100%
rename from helsinki/program/management/commands/__init__.py
rename to program/management/commands/__init__.py
diff --git a/helsinki/program/management/commands/importhosts.py b/program/management/commands/importhosts.py
similarity index 95%
rename from helsinki/program/management/commands/importhosts.py
rename to program/management/commands/importhosts.py
index 39a8afd5..a2abbd36 100644
--- a/helsinki/program/management/commands/importhosts.py
+++ b/program/management/commands/importhosts.py
@@ -2,7 +2,7 @@ from django.core.management.base import NoArgsCommand
 
 import MySQLdb
 
-from helsinki.program.models import Host
+from models import Host
 
 USER = 'helsinki'
 PASSWD = 'helsinki'
diff --git a/helsinki/program/management/commands/importnotes.py b/program/management/commands/importnotes.py
similarity index 97%
rename from helsinki/program/management/commands/importnotes.py
rename to program/management/commands/importnotes.py
index 19ddfede..48e047cb 100644
--- a/helsinki/program/management/commands/importnotes.py
+++ b/program/management/commands/importnotes.py
@@ -5,7 +5,7 @@ from django.utils.html import clean_html, strip_tags
 
 import MySQLdb
 
-from helsinki.program.models import Note, Show, TimeSlot
+from models import Note, Show, TimeSlot
 
 USER = 'helsinki'
 PASSWD = 'helsinki'
diff --git a/helsinki/program/management/commands/importprogramslots.py b/program/management/commands/importprogramslots.py
similarity index 98%
rename from helsinki/program/management/commands/importprogramslots.py
rename to program/management/commands/importprogramslots.py
index 52aa73ac..86e30387 100644
--- a/helsinki/program/management/commands/importprogramslots.py
+++ b/program/management/commands/importprogramslots.py
@@ -5,7 +5,7 @@ from django.utils.html import strip_tags
 from datetime import time
 import MySQLdb
 
-from helsinki.program.models import Show, ProgramSlot, RRule
+from models import Show, ProgramSlot, RRule
 
 USER = 'helsinki'
 PASSWD = 'helsinki'
diff --git a/helsinki/program/management/commands/importshows.py b/program/management/commands/importshows.py
similarity index 97%
rename from helsinki/program/management/commands/importshows.py
rename to program/management/commands/importshows.py
index b013dabf..0f619b5d 100644
--- a/helsinki/program/management/commands/importshows.py
+++ b/program/management/commands/importshows.py
@@ -5,7 +5,7 @@ from django.utils.html import clean_html, strip_tags
 
 import MySQLdb
 
-from helsinki.program.models import BroadcastFormat, Host, Show
+from models import BroadcastFormat, Host, Show
 
 USER = 'helsinki'
 PASSWD = 'helsinki'
diff --git a/helsinki/program/models.py b/program/models.py
similarity index 100%
rename from helsinki/program/models.py
rename to program/models.py
diff --git a/helsinki/program/search_indexes.py b/program/search_indexes.py
similarity index 67%
rename from helsinki/program/search_indexes.py
rename to program/search_indexes.py
index 745f3793..4b0cf74b 100644
--- a/helsinki/program/search_indexes.py
+++ b/program/search_indexes.py
@@ -1,9 +1,7 @@
-from haystack.indexes import CharField, DateTimeField, SearchIndex
+from haystack.indexes import CharField, SearchIndex
 from haystack import site
 
-from datetime import datetime
-
-from program.models import Note, Show
+from models import Note, Show
 
 class NoteIndex(SearchIndex):
     SearchableText = CharField(document=True, use_template=True)
diff --git a/docs/CHANGES.rst b/program/templatetags/__init__.py
similarity index 100%
rename from docs/CHANGES.rst
rename to program/templatetags/__init__.py
diff --git a/helsinki/program/templatetags/content_boxes.py b/program/templatetags/content_boxes.py
similarity index 54%
rename from helsinki/program/templatetags/content_boxes.py
rename to program/templatetags/content_boxes.py
index 56c0afbf..7108c5a8 100644
--- a/helsinki/program/templatetags/content_boxes.py
+++ b/program/templatetags/content_boxes.py
@@ -1,30 +1,26 @@
-# http://docs.djangoproject.com/en/dev/howto/custom-template-tags/
+# http://docs.djangoproject.com/en/1.2/howto/custom-template-tags/
 
 from django import template
 register = template.Library()
 
-from helsinki.program.models import (
-        BroadcastFormat,
-        MusicFocus,
-        ShowInformation,
-        ShowTopic)
+from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTopic
 
-@register.inclusion_tag('program/box_broadcastformat.html')
+@register.inclusion_tag('program/boxes/broadcastformat.html')
 def broadcastformat():
     broadcastformats = BroadcastFormat.objects.all()
     return {'broadcastformats': broadcastformats}
 
-@register.inclusion_tag('program/box_musicfocus.html')
+@register.inclusion_tag('program/boxes/musicfocus.html')
 def musicfocus():
     musicfoci = MusicFocus.objects.all()
     return {'musicfoci': musicfoci}
 
-@register.inclusion_tag('program/box_showinformation.html')
+@register.inclusion_tag('program/boxes/showinformation.html')
 def showinformation():
     showinformations = ShowInformation.objects.all()
     return {'showinformations': showinformations}
 
-@register.inclusion_tag('program/box_showtopic.html')
+@register.inclusion_tag('program/boxes/showtopic.html')
 def showtopic():
     showtopics = ShowTopic.objects.all()
     return {'showtopics': showtopics}
diff --git a/program/urls.py b/program/urls.py
new file mode 100644
index 00000000..b9df4964
--- /dev/null
+++ b/program/urls.py
@@ -0,0 +1,35 @@
+from django.conf.urls.defaults import patterns, url
+
+from django.views.generic.list_detail import object_detail, object_list
+
+from models import Host, Show, TimeSlot
+from views import current_show, day_schedule, recommendations, show_list, week_schedule
+
+hosts_dict = {
+    'queryset': Host.objects.all(),
+    'template_object_name': 'host'
+}
+shows_dict = {
+    'queryset': Show.objects.all(),
+    'template_object_name': 'show'
+}
+timeslots_dict = {
+    'queryset': TimeSlot.objects.all(),
+    'template_object_name': 'timeslot'
+}
+recommendations_dict = {'template_name': 'program/boxes/recommendations.html'}
+
+urlpatterns = patterns('',
+    url(r'^today/?$', day_schedule),
+    url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/?$', day_schedule),
+    url(r'^(?P<year>\d{4})/(?P<week>\d{1,2})/?$', week_schedule),
+    url(r'^current_box/?$', current_show),
+    url(r'^hosts/?$', object_list, hosts_dict),
+    url(r'^hosts/(?P<object_id>\d+)/?$', object_detail, hosts_dict, name='host-detail'),
+    url(r'^tips/?$', recommendations),
+    url(r'^tips_box/?$', recommendations, recommendations_dict),
+    url(r'^shows/?$', show_list),
+    url(r'^shows/(?P<slug>[\w-]+)/?$', object_detail, shows_dict, name='show-detail'),
+    url(r'^(?P<object_id>\d+)/?$', object_detail, timeslots_dict, name='timeslot-detail'),
+    url(r'^week/?$', week_schedule)
+)
diff --git a/helsinki/program/views.py b/program/views.py
similarity index 93%
rename from helsinki/program/views.py
rename to program/views.py
index a9c7b676..59e8fdf7 100644
--- a/helsinki/program/views.py
+++ b/program/views.py
@@ -1,20 +1,11 @@
-from django.views.generic import list_detail
-from django.views.generic import simple
+from django.views.generic import list_detail, simple
 from django.shortcuts import get_object_or_404
 
-from helsinki.program.models import (
-        BroadcastFormat,
-        MusicFocus,
-        Note,
-        Show,
-        ShowInformation,
-        ShowTopic,
-        TimeSlot)
+from models import BroadcastFormat, MusicFocus, Note, Show, ShowInformation, ShowTopic, TimeSlot
 
 from datetime import date, datetime, time, timedelta
 
 def show_list(request):
-
     if 'broadcastformat' in request.GET:
         broadcastformat = get_object_or_404(BroadcastFormat, slug=request.GET['broadcastformat'])
 
@@ -72,7 +63,7 @@ def current_show(request):
 
     extra_context = dict(current=current, next=next, after_next=after_next)
 
-    return simple.direct_to_template(request, template='program/current_box.html', extra_context=extra_context)
+    return simple.direct_to_template(request, template='program/boxes/current.html', extra_context=extra_context)
 
 def week_schedule(request, year=None, week=None):
     if year is None and week is None:
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 00000000..32201d5d
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,7 @@
+Django==1.2.5
+MySQL-python==1.2.3
+PIL==1.1.7
+PyYAML==3.09
+django-haystack==1.1.0
+pysolr==2.0.13
+python-dateutil==1.5
diff --git a/search_sites.py b/search_sites.py
new file mode 100644
index 00000000..e8d4e130
--- /dev/null
+++ b/search_sites.py
@@ -0,0 +1,2 @@
+import haystack
+haystack.autodiscover()
diff --git a/helsinki/program/settings.py b/settings.py
similarity index 70%
rename from helsinki/program/settings.py
rename to settings.py
index 036fe3e2..a48b53ea 100644
--- a/helsinki/program/settings.py
+++ b/settings.py
@@ -1,22 +1,19 @@
-import os
-
 # Django settings for helsinki project.
 
+import os.path
+PROJECT_DIR = os.path.dirname(__file__)
+
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG
 
-ADMINS = (
-    # ('Your Name', 'your_email@example.com'),
-)
+ADMINS = ( )
 
 MANAGERS = ADMINS
 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.mysql',
-        'NAME': 'helsinki2',
-        'USER': 'helsinki',
-        'PASSWORD': 'helsinki'
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': os.path.join(PROJECT_DIR, 'dev_data.sqlite'),
     }
 }
 
@@ -27,16 +24,14 @@ LANGUAGE_CODE = 'de'
 SITE_ID = 1
 
 USE_I18N = True
-
 USE_L10N = True
 
 MEDIA_ROOT = ''
-
 MEDIA_URL = ''
 
 ADMIN_MEDIA_PREFIX = '/media/'
 
-SECRET_KEY = 'oepk-$!=)c)7+y%cdz-x46_h5bp!o-*9%dv!(sf=3r4zfqk_(t'
+SECRET_KEY = ''
 
 TEMPLATE_LOADERS = (
     'django.template.loaders.filesystem.Loader',
@@ -52,10 +47,10 @@ MIDDLEWARE_CLASSES = (
     'django.contrib.messages.middleware.MessageMiddleware',
 )
 
-ROOT_URLCONF = 'helsinki.program.urls'
+ROOT_URLCONF = 'helsinki.urls'
 
 TEMPLATE_DIRS = (
-    os.path.join(os.path.dirname(__file__), "templates"),
+    os.path.join(PROJECT_DIR, "templates"),
 )
 
 INSTALLED_APPS = (
@@ -65,12 +60,16 @@ INSTALLED_APPS = (
     'django.contrib.sites',
     'django.contrib.messages',
     'django.contrib.admin',
-    'helsinki.program',
+    'program',
     'haystack',
 )
 
-HAYSTACK_SITECONF = 'helsinki.program.search_sites'
+HAYSTACK_SITECONF = 'helsinki.search_sites'
 HAYSTACK_SEARCH_ENGINE = 'solr'
 HAYSTACK_SOLR_URL = 'http://localhost:8988/solr'
-# plone integration
 HAYSTACK_ID_FIELD = 'docid'
+
+try:
+    from local_settings import *
+except ImportError:
+    pass
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 767fcc24..00000000
--- a/setup.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from setuptools import setup, find_packages
-import os
-
-version = '0.1'
-
-setup(name='helsinki.program',
-      version=version,
-      description="Program Management for Radio Helsinki, Graz",
-      long_description=open("README.rst").read() + "\n" +
-                       open(os.path.join("docs", "CHANGES.rst")).read(),
-      # Get more strings from http://www.python.org/pypi?:action=list_classifiers
-      classifiers=[
-        "Programming Language :: Python",
-        "Topic :: Software Development :: Libraries :: Python Modules",
-        ],
-      keywords='django radio',
-      author='Ernesto Rico-Schmidt',
-      author_email='',
-      url='https://github.com/nnrcschmdt/helsinki/',
-      license='GPL',
-      packages=find_packages(exclude=['ez_setup']),
-      namespace_packages=['helsinki',],
-      include_package_data=True,
-      zip_safe=False,
-      install_requires=[
-          'setuptools',
-          # -*- Extra requirements: -*-
-          'Django',
-          'python-dateutil',
-          'PyYAML',
-          'MySQL-python',
-          'django-haystack',
-          'pysolr'
-      ],
-)
diff --git a/helsinki/program/site_media/styles/base.css b/site_media/styles/base.css
similarity index 100%
rename from helsinki/program/site_media/styles/base.css
rename to site_media/styles/base.css
diff --git a/helsinki/program/templates/404.html b/templates/404.html
similarity index 100%
rename from helsinki/program/templates/404.html
rename to templates/404.html
diff --git a/helsinki/program/templates/500.html b/templates/500.html
similarity index 100%
rename from helsinki/program/templates/500.html
rename to templates/500.html
diff --git a/helsinki/program/templates/base.html b/templates/base.html
similarity index 100%
rename from helsinki/program/templates/base.html
rename to templates/base.html
diff --git a/helsinki/program/templates/program/box_broadcastformat.html b/templates/program/boxes/broadcastformat.html
similarity index 74%
rename from helsinki/program/templates/program/box_broadcastformat.html
rename to templates/program/boxes/broadcastformat.html
index 20e914f7..3ae00e1a 100644
--- a/helsinki/program/templates/program/box_broadcastformat.html
+++ b/templates/program/boxes/broadcastformat.html
@@ -3,7 +3,7 @@
   <dt class="portletHeader"><span>Legende<span></dt>
   {% for broadcastformat in broadcastformats %}
   <dd class="portletItem bcformat bf-{{ broadcastformat.slug }}">
-    <a href="?broadcastformat={{ broadcastformat.slug }}">{{ broadcastformat.format }}</a>
+    <a href="../?broadcastformat={{ broadcastformat.slug }}">{{ broadcastformat.format }}</a>
   </dd>
   {% endfor %}
 </dl>
diff --git a/helsinki/program/templates/program/current_box.html b/templates/program/boxes/current.html
similarity index 100%
rename from helsinki/program/templates/program/current_box.html
rename to templates/program/boxes/current.html
diff --git a/helsinki/program/templates/program/box_musicfocus.html b/templates/program/boxes/musicfocus.html
similarity index 82%
rename from helsinki/program/templates/program/box_musicfocus.html
rename to templates/program/boxes/musicfocus.html
index da2c90f7..7b78f819 100644
--- a/helsinki/program/templates/program/box_musicfocus.html
+++ b/templates/program/boxes/musicfocus.html
@@ -5,7 +5,7 @@
     <ul>
       {% for item in musicfoci %}
       <li class="mf-{{ item.abbrev }}">
-        <a href="?musicfocus={{ item.slug }}">{{ item }}</a>
+        <a href="../?musicfocus={{ item.slug }}">{{ item }}</a>
       </li>
       {% endfor %}
     </ul>
diff --git a/helsinki/program/templates/program/recommendations_box.html b/templates/program/boxes/recommendations.html
similarity index 100%
rename from helsinki/program/templates/program/recommendations_box.html
rename to templates/program/boxes/recommendations.html
diff --git a/helsinki/program/templates/program/box_showinformation.html b/templates/program/boxes/showinformation.html
similarity index 82%
rename from helsinki/program/templates/program/box_showinformation.html
rename to templates/program/boxes/showinformation.html
index a3171d0c..bff9486a 100644
--- a/helsinki/program/templates/program/box_showinformation.html
+++ b/templates/program/boxes/showinformation.html
@@ -5,7 +5,7 @@
     <ul>
       {% for item in showinformations %}
       <li class="si-{{ item.abbrev }}">
-        <a href="?showinformation={{ item.slug }}">{{ item }}</a>
+        <a href="../?showinformation={{ item.slug }}">{{ item }}</a>
       </li>
       {% endfor %}
     </ul>
diff --git a/helsinki/program/templates/program/box_showtopic.html b/templates/program/boxes/showtopic.html
similarity index 83%
rename from helsinki/program/templates/program/box_showtopic.html
rename to templates/program/boxes/showtopic.html
index 79e95197..b545476e 100644
--- a/helsinki/program/templates/program/box_showtopic.html
+++ b/templates/program/boxes/showtopic.html
@@ -5,7 +5,7 @@
     <ul>
       {% for item in showtopics %}
       <li class="st-{{ item.abbrev }}">
-        <a href="?showtopic={{ item.slug }}">{{ item }}</a>
+        <a href="../?showtopic={{ item.slug }}">{{ item }}</a>
       </li>
       {% endfor %}
     </ul>
diff --git a/helsinki/program/templates/program/day_schedule.html b/templates/program/day_schedule.html
similarity index 100%
rename from helsinki/program/templates/program/day_schedule.html
rename to templates/program/day_schedule.html
diff --git a/helsinki/program/templates/program/host_detail.html b/templates/program/host_detail.html
similarity index 100%
rename from helsinki/program/templates/program/host_detail.html
rename to templates/program/host_detail.html
diff --git a/helsinki/program/templates/program/host_list.html b/templates/program/host_list.html
similarity index 100%
rename from helsinki/program/templates/program/host_list.html
rename to templates/program/host_list.html
diff --git a/helsinki/program/templates/program/recommendations.html b/templates/program/recommendations.html
similarity index 100%
rename from helsinki/program/templates/program/recommendations.html
rename to templates/program/recommendations.html
diff --git a/helsinki/program/templates/program/show_detail.html b/templates/program/show_detail.html
similarity index 94%
rename from helsinki/program/templates/program/show_detail.html
rename to templates/program/show_detail.html
index 0238ad30..76144969 100644
--- a/helsinki/program/templates/program/show_detail.html
+++ b/templates/program/show_detail.html
@@ -40,11 +40,10 @@
 
     <div id="hosts">
     {% for host in show.hosts.all %}
-        <div class="host">{{ host }}</div>
+        <div class="host"><a href="{% url host-detail host.id %}">{{ host }}</a></div>
     {% endfor %}
     </div>
 
-
     <div id="description">{{ show.description|safe }}</div>
 
     {% if show.email %}
diff --git a/helsinki/program/templates/program/show_list.html b/templates/program/show_list.html
similarity index 100%
rename from helsinki/program/templates/program/show_list.html
rename to templates/program/show_list.html
diff --git a/helsinki/program/templates/program/timeslot_detail.html b/templates/program/timeslot_detail.html
similarity index 100%
rename from helsinki/program/templates/program/timeslot_detail.html
rename to templates/program/timeslot_detail.html
diff --git a/helsinki/program/templates/program/week_schedule.html b/templates/program/week_schedule.html
similarity index 100%
rename from helsinki/program/templates/program/week_schedule.html
rename to templates/program/week_schedule.html
diff --git a/helsinki/program/templates/search/indexes/program/note_SearchableText.txt b/templates/search/indexes/program/note_SearchableText.txt
similarity index 100%
rename from helsinki/program/templates/search/indexes/program/note_SearchableText.txt
rename to templates/search/indexes/program/note_SearchableText.txt
diff --git a/helsinki/program/templates/search/indexes/program/show_SearchableText.txt b/templates/search/indexes/program/show_SearchableText.txt
similarity index 100%
rename from helsinki/program/templates/search/indexes/program/show_SearchableText.txt
rename to templates/search/indexes/program/show_SearchableText.txt
diff --git a/helsinki/program/urls.py b/urls.py
similarity index 69%
rename from helsinki/program/urls.py
rename to urls.py
index f90a332e..27fbf2ec 100644
--- a/helsinki/program/urls.py
+++ b/urls.py
@@ -2,18 +2,18 @@ from django.conf import settings
 from django.conf.urls.defaults import *
 from django.contrib import admin
 
-import os
+import os.path
 
 admin.autodiscover()
 
 urlpatterns = patterns('',
     (r'^admin/', include(admin.site.urls)),
-    (r'^program/', include('helsinki.program.urls_program')),
+    (r'^program/', include('program.urls')),
 )
 if settings.DEBUG:
     urlpatterns += patterns('',
         (r'^site_media/(?P<path>.*)$',
          'django.views.static.serve',
-         {'document_root': os.path.join(os.path.dirname(__file__), 'site_media')}
+         {'document_root': os.path.join(settings.PROJECT_DIR, 'site_media')}
         ),
     )
-- 
GitLab