summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2014-02-23 18:02:40 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2014-02-23 18:02:40 (GMT)
commitf136e6bb921b424692e7f29c93cfbf804622d47f (patch)
tree6d960430fed69d777913b6278b25c86d73b88970
parent4590065b6ca9d7698c22277a4da1505486c8b637 (diff)
parent902cc6cfbef3f50268f73dc8690295bf2d556e30 (diff)
Merge branch 'master' of https://github.com/nnrcschmdt/helsinki
-rw-r--r--README.rst17
-rw-r--r--program/utils.py10
-rw-r--r--pv/templates/program/show_detail.html5
-rw-r--r--pv/wsgi.py4
4 files changed, 24 insertions, 12 deletions
diff --git a/README.rst b/README.rst
index 674be87..de16aff 100644
--- a/README.rst
+++ b/README.rst
@@ -10,30 +10,33 @@ To get setup you must have the following installed:
* Python 2.7
* virtualenv 1.11
+
Setting up the environment
--------------------------
Create a virtual environment where the dependencies will live::
- $ virtualenv --no-site-packages helsinki
- $ source helsinki/bin/activate
- (helsinki)$
+ $ virtualenv -p python2.7 python
+ $ source python/bin/activate
+ (python)$
Install the project dependencies::
- (helsinki)$ pip install -r requirements.txt
+ (python)$ 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
+ (python)$ python manage.py syncdb
+ (python)$ python manage.py loaddata program/fixtures/*.yaml
+
Running a web server
--------------------
In development you should run::
- (helsinki)$ python manage.py runserver
+ (python)$ python manage.py runserver
diff --git a/program/utils.py b/program/utils.py
index 5798c11..cdc6a09 100644
--- a/program/utils.py
+++ b/program/utils.py
@@ -3,7 +3,11 @@ from django.conf import settings
import json
import urllib
+
def get_automation_id_choices():
- shows_list = json.load(urllib.urlopen(settings.AUTOMATION_BASE_URL))['shows']
- shows = [(s['id'], s['title']) for s in shows_list]
- return shows \ No newline at end of file
+ base_url = getattr(settings, 'AUTOMATION_BASE_URL', None)
+ shows = []
+ if base_url:
+ shows_list = json.load(urllib.urlopen(base_url))['shows']
+ shows = [(s['id'], s['title']) for s in shows_list]
+ return shows
diff --git a/pv/templates/program/show_detail.html b/pv/templates/program/show_detail.html
index c75b322..0f4b302 100644
--- a/pv/templates/program/show_detail.html
+++ b/pv/templates/program/show_detail.html
@@ -67,7 +67,10 @@
<h2>Sendungstipps</h2>
<ul class="recommendations-list">
{% for note in show.notes.all reversed %}
- <li><a href="{% url timeslot-detail note.timeslot.id %}" title="{{ note.title }}">{{ note.start|date:"d. M Y" }}:</a> {{ note.title }}</li>
+ <li>
+ <a href="{% url timeslot-detail note.timeslot.id %}" title="{{ note.title }}">{{ note.start|date:"d. M Y" }}:</a>
+ <div class="title">{{ note.title }}</div>
+ </li>
{% endfor %}
</ul>
{% endif %}
diff --git a/pv/wsgi.py b/pv/wsgi.py
index c51af8c..e5b7531 100644
--- a/pv/wsgi.py
+++ b/pv/wsgi.py
@@ -13,7 +13,9 @@ middleware here, or combine a Django application with an application of another
framework.
"""
-import os
+import os, sys
+
+sys.path.append('/var/www/pv/helsinki')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pv.settings")