Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial code dump

  • Loading branch information...
commit 8c55abc45d47de02c97818be377044ff362adb4f 0 parents
@willkg authored
Showing with 10,403 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +5 −0 AUTHORS
  3. +41 −0 COPYING
  4. +49 −0 README.rst
  5. +17 −0 apps/pages/__init__.py
  6. +24 −0 apps/pages/urls.py
  7. +20 −0 apps/pages/views.py
  8. +17 −0 apps/sitenews/__init__.py
  9. +25 −0 apps/sitenews/admin.py
  10. +51 −0 apps/sitenews/models.py
  11. +27 −0 apps/sitenews/templates/sitenews/macros.html
  12. +44 −0 apps/sitenews/templates/sitenews/news.html
  13. +43 −0 apps/sitenews/templates/sitenews/news_list.html
  14. +29 −0 apps/sitenews/tests/__init__.py
  15. +34 −0 apps/sitenews/urls.py
  16. +59 −0 apps/sitenews/views.py
  17. +17 −0 apps/videos/__init__.py
  18. +39 −0 apps/videos/admin.py
  19. +165 −0 apps/videos/models.py
  20. +42 −0 apps/videos/search_indexes.py
  21. +3 −0  apps/videos/templates/search/indexes/videos/video_rendered.txt
  22. +19 −0 apps/videos/templates/search/indexes/videos/video_text.txt
  23. +39 −0 apps/videos/templates/videos/category.html
  24. +34 −0 apps/videos/templates/videos/category_list.html
  25. +47 −0 apps/videos/templates/videos/macros.html
  26. +61 −0 apps/videos/templates/videos/search.html
  27. +37 −0 apps/videos/templates/videos/speaker.html
  28. +38 −0 apps/videos/templates/videos/speaker_list.html
  29. +136 −0 apps/videos/templates/videos/video.html
  30. +17 −0 apps/videos/tests/__init__.py
  31. +50 −0 apps/videos/urls.py
  32. +78 −0 apps/videos/views.py
  33. +153 −0 docs/Makefile
  34. +48 −0 docs/administration.rst
  35. +248 −0 docs/conf.py
  36. +52 −0 docs/deploy.rst
  37. +8 −0 docs/dev_contribute.rst
  38. +90 −0 docs/dev_conventions.rst
  39. +139 −0 docs/dev_hacking.rst
  40. +51 −0 docs/dev_layout.rst
  41. +150 −0 docs/dev_resources.rst
  42. +14 −0 docs/dev_testing.rst
  43. +48 −0 docs/index.rst
  44. +167 −0 docs/install.rst
  45. +661 −0 licenses/AGPLv3.txt
  46. +202 −0 licenses/APLv2.txt
  47. +26 −0 manage.py
  48. +6 −0 requirements/base.txt
  49. +5 −0 requirements/development.txt
  50. +17 −0 richard/__init__.py
  51. +24 −0 richard/context_processors.py
  52. +223 −0 richard/settings.py
  53. +1 −0  richard/settings_test.py
  54. +581 −0 richard/static/bootstrap/css/bootstrap-responsive.css
  55. +4 −0 richard/static/bootstrap/css/bootstrap-responsive.min.css
  56. +3,496 −0 richard/static/bootstrap/css/bootstrap.css
  57. +632 −0 richard/static/bootstrap/css/bootstrap.min.css
  58. BIN  richard/static/bootstrap/img/glyphicons-halflings-white.png
  59. BIN  richard/static/bootstrap/img/glyphicons-halflings.png
  60. +1,720 −0 richard/static/bootstrap/js/bootstrap.js
  61. +1 −0  richard/static/bootstrap/js/bootstrap.min.js
  62. 0  richard/static/css/README
  63. +14 −0 richard/static/css/richard.css
  64. 0  richard/static/img/README
  65. 0  richard/static/js/README
  66. +58 −0 richard/templates/base.html
  67. +84 −0 richard/templates/home.html
  68. +29 −0 richard/templates/pages/about.html
  69. +28 −0 richard/templates/pages/contact.html
  70. +33 −0 richard/urls.py
  71. +34 −0 richard/views.py
  72. +44 −0 richard/wsgi.py
5 .gitignore
@@ -0,0 +1,5 @@
+*.pyc
+*~
+richard/settings_local.py
+
+docs/_build/
5 AUTHORS
@@ -0,0 +1,5 @@
+=========
+ AUTHORS
+=========
+
+* Will Kahn-Greene
41 COPYING
@@ -0,0 +1,41 @@
+=========
+ COPYING
+=========
+
+richard
+=======
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public
+License along with this program, in the file ``licenses/AGPLv3.txt``.
+If not, see <http://www.gnu.org/licenses/>.
+
+
+bootstrap
+=========
+
+Located in: ``richard/static/bootstrap/``
+
+Copyright 2012 Twitter, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
49 README.rst
@@ -0,0 +1,49 @@
+========
+ README
+========
+
+Richard is a Django project (not a Django app) for video index sites.
+
+It currently has no features. If you're looking at this or using it at this
+stage, then you're either a friend of mine or you're intrigued by the
+future possibilities.
+
+My priorities:
+
+1. Maximize ease of finding the video you're looking for.
+2. Minimize site upkeep and maintenance---it's an index and it should pretty
+ much run itself.
+3. Minimize work for adding video.
+
+Things I'd like to implement at some point in the future:
+
+* search: terms search for quickly finding things
+* navigation: from a given video, easily navigate to related videos on a
+ variety of axes like speaker, conference, keywords, ...
+* feeds: every listing should have a feed view of it
+* Universal Subtitles
+* Popcorn.js
+* democratizing video metadata upkeep: this is foo-foo speak for making it
+ easy for anyone to help maintain the metadata and make it better
+
+
+Code
+====
+
+Code is not currently available.
+
+
+Documentation
+=============
+
+Documentation is in the ``docs/`` directory.
+
+Installation and upgrade documentation is in ``docs/install.rst``.
+
+
+Tests
+=====
+
+Run::
+
+ ./manage.py test
17 apps/pages/__init__.py
@@ -0,0 +1,17 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
24 apps/pages/urls.py
@@ -0,0 +1,24 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.conf.urls.defaults import patterns, url
+
+
+urlpatterns = patterns(
+ 'pages.views',
+
+ url(r'(?P<page>[\w-]+)/?$', 'pages_view', name='pages_view'),
+ )
20 apps/pages/views.py
@@ -0,0 +1,20 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import jingo
+
+def pages_view(request, page):
+ return jingo.render( request, 'pages/%s.html' % page, {})
17 apps/sitenews/__init__.py
@@ -0,0 +1,17 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
25 apps/sitenews/admin.py
@@ -0,0 +1,25 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.contrib import admin
+from sitenews.models import SiteNews
+
+
+class SiteNewsAdmin(admin.ModelAdmin):
+ pass
+
+
+admin.site.register(SiteNews, SiteNewsAdmin)
51 apps/sitenews/models.py
@@ -0,0 +1,51 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.db import models
+from django.template.defaultfilters import slugify
+
+
+class SiteNews(models.Model):
+ """
+ This is a really basic site news model. It's not designed to be
+ WordPress. It is designed so it's easy to do site news on the site
+ in the same style.
+ """
+ title = models.CharField(max_length=50)
+ summary = models.TextField(help_text='Two sentences. Use HTML.')
+ content = models.TextField(help_text='Use HTML.')
+ # TODO: make this a django user instead?
+ author = models.CharField(max_length=50)
+
+ updated = models.DateTimeField(auto_now=True)
+ created = models.DateTimeField(auto_now_add=True)
+
+ slug = models.SlugField(unique=True)
+
+ class Meta(object):
+ get_latest_by = "updated"
+ ordering = ["-updated"]
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('news', (self.pk, self.slug))
+
+ def __unicode__(self):
+ return '<SiteNews: %s>' % self.title
+
+ def save(self):
+ self.slug = slugify(self.title)
+ super(SiteNews, self).save()
27 apps/sitenews/templates/sitenews/macros.html
@@ -0,0 +1,27 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% macro archivebar(archives, activeyear=None) %}
+<div class="well">
+ <ul class="nav nav-list">
+ <li class="nav-header">Archives</li>
+ {% for year in archives %}
+ <li class="{{ 'active' if year == activeyear }}"><a href="{{ url('news_archive_year', year=year) }}">{{ year }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+{% endmacro %}
44 apps/sitenews/templates/sitenews/news.html
@@ -0,0 +1,44 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% import "sitenews/macros.html" as macros %}
+{% block content %}
+<div class="row-fluid">
+ <div class="span2">
+ {{ macros.archivebar(archives) }}
+ </div>
+
+ <div class="span10">
+ <div class="section">
+ <h1>{{ item.title }}</h1>
+ <div class="summary">
+ {{ item.summary|safe }}
+ </div>
+ <div class="content">
+ {{ item.content|safe }}
+ </div>
+ <div class="meta">
+ Author: {{ item.author }} |
+ Created: {{ item.created|datetime }} |
+ Updated: {{ item.updated|datetime }} |
+ <a href="{{ item.get_absolute_url() }}">Permalink</a>
+ </div>
+ </div>
+ </div>
+</div>
+{% endblock %}
43 apps/sitenews/templates/sitenews/news_list.html
@@ -0,0 +1,43 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% import "sitenews/macros.html" as macros %}
+{% block content %}
+<div class="row-fluid">
+ <div class="span2">
+ {{ macros.archivebar(archives, activeyear) }}
+ </div>
+
+ <div class="span10">
+ {% for item in items %}
+ <div class="news-item">
+ <h1><a href="{{ item.get_absolute_url() }}">{{ item.title }}</a></h1>
+ <div class="summary">
+ {{ item.summary|safe }}
+ </div>
+ <div class="meta">
+ Author: {{ item.author }}
+ Created: {{ item.created }}
+ Updated: {{ item.updated }}
+ <a href="{{ item.get_absolute_url() }}">Permalink</a>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+</div>
+{% endblock %}
29 apps/sitenews/tests/__init__.py
@@ -0,0 +1,29 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import datetime
+from sitenews import models
+
+
+def sitenews_maker(**kw):
+ """Builds a SiteNews object with appropriate defaults"""
+ defaults = dict(created=datetime.now(), updated=datetime.now())
+ defaults.update(kw)
+ if 'author' not in kw:
+ defaults['author'] = u'Joe'
+ if 'summary' not in kw:
+ defaults['summary'] = u'Summary: ' + defaults['title']
+ return models.SiteNews(**kw)
34 apps/sitenews/urls.py
@@ -0,0 +1,34 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.conf.urls.defaults import patterns, url
+
+
+urlpatterns = patterns(
+ 'sitenews.views',
+
+ # news item
+ url(r'entry/(?P<news_id>[0-9]+)/(?P<slug>[\w-]*)/?$',
+ 'news', name='news'),
+
+ # news archive for a year
+ url(r'archives/(?P<year>[0-9]{4})/?$',
+ 'news_archive_year', name='news_archive_year'),
+
+ # news listing
+ url(r'/?$',
+ 'news_list', name='news_list'),
+)
59 apps/sitenews/views.py
@@ -0,0 +1,59 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.shortcuts import get_object_or_404
+import jingo
+
+from sitenews import models
+
+
+def get_years():
+ return [d.year for d in models.SiteNews.objects.dates('updated', 'year')]
+
+
+def news_list(request):
+ # TODO: paginate this
+ items = models.SiteNews.objects.all()[0:10]
+
+ ret = jingo.render(
+ request, 'sitenews/news_list.html',
+ {'title': 'News List',
+ 'items': items,
+ 'archives': get_years()})
+ return ret
+
+
+def news(request, news_id, slug):
+ item = get_object_or_404(models.SiteNews, pk=news_id)
+
+ ret = jingo.render(
+ request, 'sitenews/news.html',
+ {'item': item,
+ 'archives': get_years()})
+ return ret
+
+
+def news_archive_year(request, year):
+ year = int(year)
+ items = models.SiteNews.objects.filter(updated__year=year)
+
+ ret = jingo.render(
+ request, 'sitenews/news_list.html',
+ {'title': 'News List - %s' % year,
+ 'items': items,
+ 'archives': get_years(),
+ 'activeyear': year})
+ return ret
17 apps/videos/__init__.py
@@ -0,0 +1,17 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
39 apps/videos/admin.py
@@ -0,0 +1,39 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.contrib import admin
+from videos.models import Video, Category, Speaker
+
+
+class VideoAdmin(admin.ModelAdmin):
+ pass
+
+
+admin.site.register(Video, VideoAdmin)
+
+
+class CategoryAdmin(admin.ModelAdmin):
+ pass
+
+
+admin.site.register(Category, CategoryAdmin)
+
+
+class SpeakerAdmin(admin.ModelAdmin):
+ pass
+
+
+admin.site.register(Speaker, SpeakerAdmin)
165 apps/videos/models.py
@@ -0,0 +1,165 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.db import models
+from django.template.defaultfilters import slugify
+
+
+USE_HTML_HELP_TEXT = "Use HTML."
+
+
+class Category(models.Model):
+ KIND_CONFERENCE = 1
+ KIND_PUG = 2
+
+ KIND_CHOICES = (
+ (KIND_CONFERENCE, u'Conference'),
+ (KIND_PUG, u'Python User Group'),
+ )
+
+ kind = models.IntegerField(choices=KIND_CHOICES)
+
+ # e.g. 'PyCon', 'ChiPy', ...
+ name = models.CharField(max_length=255)
+
+ # e.g. 'PyCon 2010', 'ChiPy', ...
+ title = models.CharField(max_length=255)
+
+ description = models.TextField(blank=True, default=u'',
+ help_text=USE_HTML_HELP_TEXT)
+ url = models.URLField(blank=True, default=u'')
+ slug = models.SlugField(unique=True)
+ notes = models.TextField(blank=True, default=u'')
+ start_date = models.DateField(null=True)
+
+ def __unicode__(self):
+ return '<Category %s>' % self.title
+
+ class Meta(object):
+ ordering = ["name", "title"]
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('category', (self.pk, self.slug))
+
+
+class Speaker(models.Model):
+ name = models.CharField(max_length=255)
+ slug = models.SlugField(unique=True)
+
+ def __unicode__(self):
+ return '<Speaker %s: %s>' % (self.id, self.name)
+
+ class Meta(object):
+ ordering = ['name']
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('speaker', (self.pk, self.slug))
+
+
+class Tag(models.Model):
+ tag = models.CharField(max_length=30)
+
+ def __unicode__(self):
+ return '<Tag %s>' % self.tag
+
+ class Meta(object):
+ ordering = ['tag']
+
+
+class Video(models.Model):
+ STATE_LIVE = 1
+ STATE_DRAFT = 2
+
+ STATE_CHOICES = (
+ (STATE_LIVE, u'Live'),
+ (STATE_DRAFT, u'Draft'),
+ )
+
+ state = models.IntegerField(choices=STATE_CHOICES, null=True)
+
+ title = models.CharField(max_length=255)
+ summary = models.TextField(blank=True, default=u'',
+ help_text=USE_HTML_HELP_TEXT)
+ description = models.TextField(blank=True, default=u'',
+ help_text=USE_HTML_HELP_TEXT)
+ tags = models.ManyToManyField(Tag)
+ category = models.ForeignKey(Category)
+ speakers = models.ManyToManyField(Speaker)
+
+ # notes for quality issues (audio or video) in the video
+ quality_notes = models.TextField(blank=True, default=u'',
+ help_text=USE_HTML_HELP_TEXT)
+
+ # text for copyright/license--for now it's loose form.
+ # if null, use source video link.
+ copyright_text = models.TextField(null=True)
+
+ # embed for flash player things
+ embed = models.TextField(null=True, blank=True)
+
+ # url for the thumbnail
+ thumbnail_url = models.URLField(max_length=255, null=True)
+
+ # these are downloadable urls
+ video_ogv_length = models.IntegerField(null=True)
+ video_ogv_url = models.URLField(max_length=255, null=True)
+ video_mp4_length = models.IntegerField(null=True)
+ video_mp4_url = models.URLField(max_length=255, null=True)
+ video_webm_length = models.IntegerField(null=True)
+ video_webm_url = models.URLField(max_length=255, null=True)
+
+ # source url in case we need to find things again
+ source_url = models.URLField(max_length=255, null=True)
+
+ # whiteboard for editor notes
+ whiteboard = models.CharField(max_length=255, blank=True, default=u'')
+
+ # when the video was originally recorded
+ recorded = models.DateField(null=True)
+
+ # when the video was added to this site
+ added = models.DateTimeField(auto_now_add=True)
+
+ # when the video metadata was last updated
+ updated = models.DateTimeField(auto_now=True)
+
+ slug = models.SlugField(unique=True)
+
+ def __unicode__(self):
+ return '<Video %s (%s)>' % (self.title[:30], self.category)
+
+ class Meta(object):
+ get_latest_by = 'recorded'
+ ordering = ['-recorded', 'title']
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('video', (self.pk, self.slug))
+
+ def save(self):
+ self.slug = slugify(self.title)
+ super(Video, self).save()
+
+
+class RelatedUrl(models.Model):
+ video = models.ForeignKey(Video, related_name='related_urls')
+ url = models.URLField(max_length=255)
+ description = models.CharField(max_length=255, blank=True, default=u'')
+
+ def __unicode__(self):
+ return '<URL %s>' % self.url
42 apps/videos/search_indexes.py
@@ -0,0 +1,42 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from haystack import indexes
+from videos.models import Video
+
+
+class VideoIndex(indexes.SearchIndex, indexes.Indexable):
+ text = indexes.CharField(document=True, use_template=True)
+ summary = indexes.CharField(model_attr='summary', indexed=False)
+ recorded = indexes.DateTimeField(model_attr='recorded', null=True)
+ video_id = indexes.IntegerField(model_attr='id', indexed=False)
+ slug = indexes.CharField(model_attr='slug', indexed=False)
+ tags = indexes.MultiValueField()
+ speakers = indexes.MultiValueField()
+
+ def prepare(self, obj):
+ self.prepared_data = super(VideoIndex, self).prepare(obj)
+
+ self.prepared_data['tags'] = [t.tag for t in obj.tags.all()]
+ self.prepared_data['speakers'] = [s.name for s in obj.speakers.all()]
+
+ return self.prepared_data
+
+ def get_model(self):
+ return Video
+
+ def index_queryset(self):
+ return self.get_model().objects.all()
3  apps/videos/templates/search/indexes/videos/video_rendered.txt
@@ -0,0 +1,3 @@
+<h2>{{ object.title }}</h2>
+<p>foo</p>
+<p>{{ object.summary }}</p>
19 apps/videos/templates/search/indexes/videos/video_text.txt
@@ -0,0 +1,19 @@
+{#
+ this just tosses everything into the "text". should do analysis at
+ some point as to whether that's a good idea.
+#}
+{{ object.title }}
+
+{{ object.summary }}
+
+{{ object.description }}
+
+{{ object.quality_notes }}
+
+{% for s in object.speakers.all() %}
+ {{ s.name }}
+{% endfor %}
+
+{% for t in object.tags.all() %}
+ {{ t.tag }}
+{% endfor %}
39 apps/videos/templates/videos/category.html
@@ -0,0 +1,39 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% import "videos/macros.html" as macros %}
+{% block content %}
+
+<div class="row-fluid">
+ <div class="span12">
+ <h1>{{ category.title }}</h1>
+ <p>
+ {{ category.description }}
+ </p>
+ {% if category.url %}
+ <p>
+ <a href="{{ category.url }}">{{ category.url }}</a>
+ </p>
+ {% endif %}
+ </div>
+</div>
+
+{% for v in category.video_set.all() %}
+ {{ macros.video_summary(v) }}
+{% endfor %}
+{% endblock %}
34 apps/videos/templates/videos/category_list.html
@@ -0,0 +1,34 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% block content %}
+<div class="row-fluid">
+ <div class="span12">
+ {% for kind, kind_name in kinds %}
+ <h2>{{ kind_name }}</h2>
+ <ul>
+ {% for cat in categories %}
+ {% if cat.kind == kind %}
+ <li><a href="{{ cat.get_absolute_url() }}">{{ cat.title }}</a></li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+ {% endfor %}
+ </div>
+</div>
+{% endblock %}
47 apps/videos/templates/videos/macros.html
@@ -0,0 +1,47 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% macro video_summary(v) -%}
+ <div class="row-fluid section">
+ <div class="span2">
+ <a href="{{ v.get_absolute_url() }}" class="thumbnail"><img src="{{ v.thumbnail_url }}"></a>
+ </div>
+
+ <div class="span7">
+ <div>
+ <a href="{{ v.get_absolute_url() }}">{{ v.title }}</a>
+ </div>
+ <div>
+ {{ v.summary|safe }}
+ </div>
+ </div>
+ <div class="span3">
+ Event: <a href="{{ v.category.get_absolute_url() }}">{{ v.category.title }}</a><br>
+ {% if v.speakers.all() %}
+ Speakers:
+ {% set pipe = joiner(", ") %}
+ {% for s in v.speakers.all() -%}
+ {{ pipe() }}<a href="{{ s.get_absolute_url() }}">{{ s.name }}</a>
+ {%- endfor %}
+ <br>
+ {% endif %}
+ {% if v.recorded %}
+ Recorded: {{ v.recorded | datetime }}<br>
+ {% endif %}
+ </div>
+ </div>
+{%- endmacro %}
61 apps/videos/templates/videos/search.html
@@ -0,0 +1,61 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% import "videos/macros.html" as macros %}
+{% block content %}
+<div class="row-fluid">
+ <div class="span12">
+ <form class="well form-search" method="get" action="/search/">
+ <input type="hidden" name="models" value="videos.video">
+ <input type="text" class="input-medium search-query" name="q" value="{{ query }}">
+ <button type="submit" class="btn">Search</button>
+ </form>
+ </div>
+</div>
+
+{% if query %}
+<div class="row-fluid">
+ <div class="span12">
+ <h3>Results</h3>
+ </div>
+</div>
+ {% for result in page.object_list %}
+ {{ macros.video_summary(result.object) }}
+ {% else %}
+ <div class="row-fluid">
+ <div class="span12">
+ No results
+ </div>
+ </div>
+ {% endfor %}
+
+ {% if page.has_previous() or page.has_next() %}
+ <div class="row-fluid">
+ <div class="span12">
+ <div class="section">
+ {% if page.has_previous() %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number() }}">{% endif %}&laquo; Previous{% if page.has_previous() %}</a>{% endif %}
+ |
+ {% if page.has_next() %}<a href="?q={{ query }}&amp;page={{ page.next_page_number() }}">{% endif %}Next &raquo;{% if page.has_next() %}</a>{% endif %}
+ </div>
+ </div>
+ </div>
+ {% endif %}
+{% else %}
+ {# Show some example queries to run, maybe query syntax, something else? #}
+{% endif %}
+{% endblock %}
37 apps/videos/templates/videos/speaker.html
@@ -0,0 +1,37 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% import "videos/macros.html" as macros %}
+{% block content %}
+
+<div class="row-fluid">
+ <div class="span12">
+ <h1>{{ speaker.name }}</h1>
+ </div>
+</div>
+
+<div class="row-fluid">
+ <div class="span12">
+ <h2>Videos</h2>
+ </div>
+</div>
+
+{% for v in speaker.video_set.all() %}
+ {{ macros.video_summary(v) }}
+{% endfor %}
+{% endblock %}
38 apps/videos/templates/videos/speaker_list.html
@@ -0,0 +1,38 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% block content %}
+<div class="row-fluid">
+ <div class="span12">
+ <h1>List of speakers</h1>
+ <div class="pagination">
+ <ul>
+ {% for c in 'abcdefghijklmnopqrstuvwxyz' %}
+ <li class="{{ 'active' if c == active_c }}"><a href="{{ url('speaker_list') }}?character={{ c }}">{{ c.upper() }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ <ul>
+ {% for s in speakers %}
+ <li><a href="{{ s.get_absolute_url() }}">{{ s.name }}</a>
+ ({{ s.video_set.count() }})</li>
+ {% endfor %}
+ </ul>
+ </div>
+</div>
+{% endblock %}
136 apps/videos/templates/videos/video.html
@@ -0,0 +1,136 @@
+{#
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#}
+{% extends "base.html" %}
+{% block content %}
+
+<div class="row-fluid">
+ <div id="videobox" class="span8">
+ <div class="videobox-inner">
+ {% if v.embed %}
+ {{ v.embed|safe }}
+ {% else %}
+ <video id="{{ v.slug }}">
+ {% if v.video_ogv_url %}
+ <source src="{{ v.video_ogv_url }}" type="video/ogv">
+ {% endif %}
+ {% if v.video_mp4_url %}
+ <source src="{{ v.video_mp4_url }}" type="video/mp4">
+ {% endif %}
+ {% if v.video_webm_url %}
+ <source src="{{ v.video_webm_url }}" type="video/webm">
+ {% endif %}
+ </video>
+ {% endif %}
+ </div>
+
+ {% if v.summary %}
+ <div class="section">
+ <h2>Summary</h2>
+ {{ v.summary|safe }}
+ </div>
+ {% endif %}
+
+ {% if v.description %}
+ <div class="section">
+ <h2>Description</h2>
+ {{ v.description|safe }}
+ </div>
+ {% endif %}
+ </div>
+
+
+ <div class="span4">
+ <div id="sidebar" class="well">
+ <h2>{{ v.title }}</h2>
+ <dl>
+ <dt>Category</dt>
+ <dd>
+ <a href="{{ v.category.get_absolute_url() }}">{{ v.category.title }}</a>
+ </dd>
+
+ {% if v.recorded %}
+ <dt>Recorded</dt>
+ <dd>{{ v.recorded | datetime }}</dd>
+ {% endif %}
+
+ <dt>Speakers</dt>
+ <dd>
+ {% if v.speakers.all() %}
+ {% for s in v.speakers.all() %}
+ <div><a href="{{ s.get_absolute_url() }}">{{ s.name }}</a></div>
+ {% endfor %}
+ {% else %}
+ Unknown
+ {% endif %}
+ </dd>
+
+ <dt>Download</dt>
+ <dd>
+ {% if v.video_ogv_url %}
+ <a href="{{ v.video_ogv_url }}">OGV</a>
+ {% endif %}
+ {% if v.video_mp4_url %}
+ <a href="{{ v.video_mp4_url }}">MP4</a>
+ {% endif %}
+ {% if v.video_webm_url %}
+ <a href="{{ v.video_webm_url }}">WEBM</a>
+ {% endif %}
+ </dd>
+
+ <dt>Tags</dt>
+ <dd>
+ {% if v.tags %}
+ {% for t in v.tags.all() %}
+ {{ t.tag }}
+ {% endfor %}
+ {% else %}
+ No tags
+ {% endif %}
+ </dd>
+
+ <dt>Video origin</dt>
+ <dd>
+ {% if v.source_url %}
+ <a href="{{ v.source_url }}">{{ v.source_url }}</a>
+ {% else %}
+ Unknown
+ {% endif %}
+ </dd>
+
+ <dt>Copyright</dt>
+ <dd>
+ {% if v.copyright_text %}
+ {{ v.copyright_text }}
+ {% elif v.source_url %}
+ See <a href="{{ v.source_url }}">{{ v.source_url }}</a>
+ for copyright information.
+ {% else %}
+ Unknown.
+ {% endif %}
+ </dd>
+
+ {% if v.updated %}
+ <dt>Last updated</dt>
+ <dd>{{ v.updated | datetime }}</dd>
+ {% endif %}
+ </dl>
+ </div>
+ </div>
+</div>
+
+{% endblock %}
17 apps/videos/tests/__init__.py
@@ -0,0 +1,17 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
50 apps/videos/urls.py
@@ -0,0 +1,50 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.conf.urls.defaults import patterns, url
+from haystack.views import SearchView, search_view_factory
+from haystack.forms import ModelSearchForm
+
+
+urlpatterns = patterns(
+ 'videos.views',
+
+ # categories
+ url(r'category/?$',
+ 'category_list', name='category_list'),
+ url(r'category/(?P<category_id>[0-9]+)/(?P<slug>[\w-]*)/?$',
+ 'category', name='category'),
+
+ # speakers
+ url(r'speaker/$',
+ 'speaker_list', name='speaker_list'),
+ url(r'speaker/(?P<speaker_id>[0-9]+)/?$',
+ 'speaker', name='speaker_no_slug'),
+ url(r'speaker/(?P<speaker_id>[0-9]+)/(?P<slug>[\w-]*)/?$',
+ 'speaker', name='speaker'),
+
+ # videos
+ url(r'video/(?P<video_id>[0-9]+)/(?P<slug>[\w-]*)/?$',
+ 'video', name='video'),
+
+ # search
+ url(r'^search/?$',
+ search_view_factory(
+ view_class=SearchView,
+ template='videos/search.html',
+ form_class=ModelSearchForm),
+ name='haystack_search'),
+)
78 apps/videos/views.py
@@ -0,0 +1,78 @@
+# richard -- video index system
+# Copyright (C) 2012 richard contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from django.shortcuts import get_object_or_404
+import jingo
+
+
+from videos import models
+
+
+def category_list(request):
+ categories = models.Category.objects.all()
+
+ ret = jingo.render(
+ request, 'videos/category_list.html',
+ {'title': 'Category List',
+ 'kinds': models.Category.KIND_CHOICES,
+ 'categories': categories})
+ return ret
+
+
+def category(request, category_id, slug):
+ obj = get_object_or_404(models.Category, pk=category_id)
+
+ ret = jingo.render(
+ request, 'videos/category.html',
+ {'category': obj})
+ return ret
+
+
+def speaker_list(request):
+ c = request.GET.get('character', 'a')
+ try:
+ if c not in 'abcdefghijklmnopqrstuvwxyz':
+ c = 'a'
+ except TypeError:
+ c = 'a'
+
+ # TODO: build list of "empty characters"
+ speakers = models.Speaker.objects.filter(name__istartswith=c)
+
+ ret = jingo.render(
+ request, 'videos/speaker_list.html',
+ {'active_c': c,
+ 'speakers': speakers})
+ return ret
+
+
+def speaker(request, speaker_id, slug=None):
+ obj = get_object_or_404(models.Speaker, pk=speaker_id)
+
+ ret = jingo.render(
+ request, 'videos/speaker.html',
+ {'speaker': obj})
+ return ret
+
+
+def video(request, video_id, slug):
+ obj = get_object_or_404(models.Video, pk=video_id)
+
+ ret = jingo.render(
+ request, 'videos/video.html',
+ {'v': obj})
+ return ret
+
153 docs/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Richard.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Richard.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/Richard"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Richard"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
48 docs/administration.rst
@@ -0,0 +1,48 @@
+========================
+ Running a richard site
+========================
+
+.. Note::
+
+ The information in this chapter is likely to change. I haven't spent
+ much time on the admin-side of things.
+
+
+Changing the theme/style/look-n-feel
+====================================
+
+Override the CSS, JS and templates.
+
+.. todo:: flesh out how to override css, js and templates
+
+
+Adding videos
+=============
+
+.. todo:: how to add videos to the site
+
+
+Editing videos
+==============
+
+.. todo:: how to edit videos on the site (probably through admin)
+
+
+Removing videos
+===============
+
+.. todo:: how to delete videos from the site (probably through admin)
+
+
+Updating the search index
+=========================
+
+Updating the index is a manual process. It's possible we could update the
+index as data is changed, but richard is currently not set up that way.
+
+Do this to update the index::
+
+ ./manage.py rebuild_index
+
+
+
248 docs/conf.py
@@ -0,0 +1,248 @@
+# -*- coding: utf-8 -*-
+#
+# Richard documentation build configuration file, created by
+# sphinx-quickstart on Sun Feb 12 11:15:53 2012.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.todo']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'Richard'
+copyright = u'2012, Will Kahn-Greene'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.0.1'
+# The full version, including alpha/beta/rc tags.
+release = '0.0.1'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# -- Options for todo ----------------------------------------------------------
+
+# http://sphinx.pocoo.org/ext/todo.html
+
+todo_include_todos = True
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'Richarddoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'Richard.tex', u'Richard Documentation',
+ u'Will Kahn-Greene', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'richard', u'Richard Documentation',
+ [u'Will Kahn-Greene'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'Richard', u'Richard Documentation',
+ u'Will Kahn-Greene', 'Richard', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
52 docs/deploy.rst
@@ -0,0 +1,52 @@
+==========================
+ Deploying a richard site
+==========================
+
+Deploying basics
+================
+
+Step 1:
+
+ Install richard using the installation instructions if you haven't
+ already.
+
+Step 2:
+
+ Configure richard by creating a settings file as described in the
+ installation instructions if you haven't already.
+
+Step 3:
+
+ Setting up your site for being served by a web server in a
+ production environment. This step is covered here.
+
+
+Directory structure
+-------------------
+
+Your site is an instance of richard with configuration, templates, and
+data that's specific to your site.
+
+I suggest something like the following::
+
+ your_site/ <-- your site directory
+ |- bin/ <-- directory for your .wsgi file
+ |- templates/ <-- your site-specific templates
+ |- media/ <-- images, js, css served by your web server
+ |- venv/ <-- virtual environment holding
+ |
+ |- richard/ <-- tarball / git repository
+ |- richard/ <-- richard django project
+ ...
+
+
+Apache and mod_wsgi
+===================
+
+http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
+
+A sample ``.wsgi`` file is in ``richard/`` in the repository.
+
+
+Templates
+=========
8 docs/dev_contribute.rst
@@ -0,0 +1,8 @@
+============
+ Contribute
+============
+
+Interested in building a video index system? Interested in running
+one? Then you should be interested in contributing to this project!
+
+.. todo:: contribute text
90 docs/dev_conventions.rst
@@ -0,0 +1,90 @@
+=============
+ Conventions
+=============
+
+Python code
+===========
+
+* PEP-8: http://www.python.org/dev/peps/pep-0008/
+* PEP-257: http://www.python.org/dev/peps/pep-0257/
+* Use pyflakes. Srsly.
+
+pep8 covers Python code conventions. pep257 covers Python docstring
+conventions.
+
+Minor caveats:
+
+* We use Sphinx, so do function definitions like they do:
+ `<http://packages.python.org/an_example_pypi_project/sphinx.html#function-definitions>`_.
+* Don't kill yourself over 80-character lines, but it is important.
+* If you're flummoxed by the conventions, just send me the patch and
+ as long as it functionally works, I can do a cleanup pass in a
+ later commit.
+
+
+HTML/Jinja2 templates
+=====================
+
+.. todo:: html/jinja2 template conventions
+
+
+CSS
+===
+
+.. todo:: css conventions
+
+
+JavaScript
+==========
+
+.. todo:: javascript conventions
+
+
+Git
+===
+
+I encourage good commit messages in a form that works well with
+git's various commands. Something like
+`<http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>`_. except
+that I don't care about verb tense or capitalization and if the
+commit message is tied to a bug report, the bug report number should
+be the first thing in the first line. Here's the tbaggery example
+with some adjustments::
+
+ 475. short summary (50 chars or less)
+
+ More detailed explanatory text, if necessary. Wrap it to about
+ 72 characters or so. In some contexts, the first line is
+ treated as the subject of an email and the rest of the text as
+ the body. The blank line separating the summary from the body
+ is critical (unless you omit the body entirely); tools like
+ rebase can get confused if you run the two together.
+
+ Further paragraphs come after blank lines.
+
+ - Bullet points are okay, too
+
+ - Typically a hyphen or asterisk is used for the bullet,
+ preceded by a single space, with blank lines in between, but
+ conventions vary here
+
+ - Use a hanging indent
+
+Why? Here's the reasons:
+
+* 50 characters or less works well with the various git commands
+ that show only the summary line and also on github.
+* Having the bug number as the first thing makes it easy to see
+ which commits covered which bugs without parsing the commit
+ message. We do that a lot ("When did the fix for bug xyz land?").
+* Wrapping the subsequent paragraphs allows them to show up nicely
+ in git output as well as on github.
+
+Why not the other things? Here's the reasons:
+
+* Capitalization or non-capitalization for a phrase doesn't affect
+ the output of git commands or my ability to quickly parse a
+ summary.
+* Ditto for verb tense.
+* I'm all for ditching convention baggage for things that don't matter.
+
139 docs/dev_hacking.rst
@@ -0,0 +1,139 @@
+=====================
+ Install for hacking
+=====================
+
+This covers how to clone richard and set it up for easy hacking.
+
+.. Note::
+
+ Richard is pretty new and is under heavy development. As such, the
+ documentation for it sucks and the installation guide may have as
+ much of a chance of helping you install Richard as it does helping
+ you make a quiche.
+
+ I'm really sorry about that, but I'm still bootstrapping the
+ project.
+
+
+Richard requires a bunch of stuff to run. I'm going to talk about this
+stuff in two groups:
+
+1. stuff that you should install with your package manager
+2. Python packages that should get installed in a virtual environment
+
+
+Things that you should install with your package manager
+========================================================
+
+You need the following things all of which should be provided by your
+system/package manager:
+
+* Python 2.6 or 2.7
+* pip
+* virtualenv
+* MySQL Server
+* MySQL client headers
+
+
+On Debian, this translates to::
+
+ apt-get install \
+ python \
+ python-pip \
+ python-virtualenv \
+ mysql-server \
+ mysql-client \
+ libmysqlclient-dev
+
+
+Python packages to install
+==========================
+
+Now you need to install some other things all of which are specified
+in the requirements files provided.
+
+Using pip, create a virtual environment and install everything into
+it::
+
+ $ pip install -E ./venv/ -r requirements/base.txt
+
+(Optional) If you plan on doing development work, running tests,
+building documentation or something along those lines, then do::
+
+ $ pip install -E ./venv/ -r requirements/development.txt
+
+.. Note::
+
+ This created a virtual environment. You'll need to use that virtual
+ environment to run Richard. To activate the virtual environment, do::
+
+ $ . ./venv/bin/activate
+
+
+Setting up the database
+=======================
+
+You need to create a database and a user for that database.
+
+For example, to create a database named ``richard`` with a user named
+``richard`` with password ``password``, you'd do::
+
+ $ mysql -u root -p
+ mysql> CREATE DATABASE richard;
+ mysql> GRANT ALL ON richard.* TO richard@localhost IDENTIFIED BY
+ 'password';
+
+(Optional) If you're a developer and plan to run the test suite,
+you'll also need to add permissions to the test database. The test
+database has the same name as the database prepended with ``test_``.
+For example::
+
+ $ mysql -u root -p
+ mysql> GRANT ALL ON test_richard.* TO richard@localhost IDENTIFIED
+ BY 'password';
+
+
+.. todo:: how to create the initial schema
+
+.. todo:: how to load sample data
+
+
+Configuration
+=============
+
+Default configuration for the project goes in ``richard/settings.py``.
+
+You will need to override some of those settings for your
+instance. To do that:
+
+1. create a file ``richard/settings_local.py``
+2. add configuration for your instance in that file
+
+If you're developing on Richard, you can use this sample
+``settings_local.py`` which uses database settings from the example
+database setup::
+
+ DEBUG = True
+ TEMPLATE_DEBUG = True
+
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.mysql',
+ 'NAME': 'richard',
+ 'USER': 'richard',
+ 'PASSWORD': 'password',
+ 'HOST': '',
+ 'PORT': '',
+ 'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
+ }
+ }
+
+
+Make sure to set a ``SECRET_KEY``::
+
+ # Make this unique, and don't share it with anybody.
+ SECRET_KEY = 'long secret key'
+
+.. todo:: create admin user
+
+.. todo:: list configuration settings that should be in settings_local.py
51 docs/dev_layout.rst
@@ -0,0 +1,51 @@
+================
+ Project layout
+================
+
+When you do a ``git clone ...`` of richard, you end up with a
+directory tree like this::
+
+ richard
+ |- docs/ -- documentation
+ |- requirements/ -- requirements files for pip
+ |- richard/ -- richard django project
+ \- apps/
+ |- pages/ -- code for "about", "contac", etc pages
+ |- sitenews/ -- code for sitenews
+ \- videos/ -- code for videos and search
+
+
+Here's what's there:
+
+**richard/docs/**
+
+ Documentation for the project build wtih Sphinx and formatted in
+ restructuredtext.
+
+**richard/requirements/**
+
+ .txt files that you use with pip to install richard's
+ requirements.
+
+**richard/richard/**
+
+ This is the "Django project" part of the project.
+
+**richard/apps/**
+
+ This is where the "Django apps" go. There are a few:
+
+ **pages**
+
+ Like django.contrib.flatpages except that nothing is in the
+ database---it's all done with templates.
+
+ **sitenews**
+
+ Bare-bones "blog" for your site allowing you to specify site
+ news like changes, new conferences added, etc.
+
+ **videos**
+
+ This app does most of the work and manages speakers,
+ categories (conferences, user groups, etc), videos and search.
150 docs/dev_resources.rst
@@ -0,0 +1,150 @@
+===========
+ Resources
+===========
+
+This chapter is a list of resources and notes that I thought would be
+helpful to new people who want to contribute to this software. There's
+also some design decisions and code conventions in here, too.
+
+.. contents::
+
+
+Project scaffolding
+===================
+
+* `playdoh <http://playdoh.readthedocs.org/en/latest/index.html>`_ and
+ `kitsune <http://kitsune.readthedocs.org/en/latest/>`_
+
+ Kitsune is the name of the project I work on at Mozilla. Playdoh is
+ the name of the Django web application template that most Mozilla
+ webdev projects are built on top of.
+
+ I use both for inspiration for project scaffolding.
+
+
+Settings
+--------
+
+`<https://docs.djangoproject.com/en/dev/topics/settings/#django.conf.settings.configure>`_
+talks about settings, but doesn't cover separating settings into
+multiple settings files.
+
+richard uses ``settings_local.py`` for locally overriding settings
+defaults. We do the same thing for some of our projects at
+Mozilla. Also, James Bennett talks about using ``local_settings.py`` in
+"Practical Django Projects" [PDP2009] which is essentially the same,
+but with a slightly different name. I like ``settings_local.py``
+better than ``local_settings.py`` since then all my settings files
+get listed next to each other when sorted alphabetically.
+
+.. [PDP2009] Practical Django Projects, by James Bennett
+
+For tests, richard uses ``settings_test.py`` which allows us to
+override settings explicitly for the test environment. We do this at
+Mozilla and it makes things a lot easier.
+
+
+Requirements / environments / deployment
+----------------------------------------
+
+* `virtualenv <http://pypi.python.org/pypi/virtualenv>`_ and
+ `pip <http://pypi.python.org/pypi/pip>`_
+
+ richard uses virtualenv and pip to build the environment for richard
+ to run.
+
+ Requirements are listed in ``requirements/`` in multiple files. The
+ base requirements are in ``requirements/base.txt`` and other
+ use-oriented requirements files include that and then add additional
+ requirements. This makes it easier to specify different kinds of
+ environments like development and deployment.
+
+ pip creates a virtual environment, reads the requirements files,
+ downloads requirements, and installs them into the virtual
+ environment.
+
+ It works pretty well except when PyPI is down.
+
+ We may revisit this later when/if we run into problems.
+
+
+Documentation
+-------------
+
+* `Sphinx <http://sphinx.pocoo.org/>`_ and
+ `restructuredtext <http://docutils.sourceforge.net/rst.html>`_
+
+ Documentation is in ``docs/`` and uses Sphinx for organizing and
+ building it and restructuredtext for the markup.
+
+
+Tools
+=====
+
+* `git <http://git-scm.com/>`_,
+ `github <http://help.github.com/>`_ and
+ `ProGit <http://progit.org/>`_
+
+ richard uses git for version control. This has a big effect on how
+ the project evolves in respects to code changes.
+
+* `pyflakes <http://pypi.python.org/pypi/pyflakes>`_
+
+ pyflakes is a great code checker that eliminates a class of possible
+ errors from your code. I highly recommend using it.
+
+ I use it with Emacs. `This page
+ <http://reinout.vanrees.org/weblog/2010/05/11/pep8-pyflakes-emacs.html>`_
+ covers setting up pyflakes with Emacs in a couple of different ways.
+
+ Another way to run it is as a pre-commit hook with `check.py
+ <https://github.com/jbalogh/check>`_.
+
+
+Django / nose / jinja2 / haystack / whoosh
+==========================================
+
+* `Django <https://www.djangoproject.com/>`_
+
+ This software is built using Django. I tried to use Django pieces
+ where possible.
+
+* `django-nose <https://github.com/jbalogh/django-nose>`_ and
+ `nose <http://readthedocs.org/docs/nose/en/latest/>`_
+
+ Testing is done using django-nose which replaces the default Django
+ test runner with nose. This makes it a one-liner to run all the
+ tests and also provides some nice scaffolding for building tests and
+ organizing them.
+
+* `jingo <https://github.com/jbalogh/jingo>`_ and
+ `jinja2 <http://jinja.pocoo.org/>`_
+
+ The Django templates are nice, but I prefer Jinja2 templates. The
+ Jinja2 docs cover `differences between Django and Jinja2 templating
+ engines <http://jinja.pocoo.org/docs/switching/#django>`_, though
+ Django 1.4 adds ``elif``, so that's no longer a difference.
+
+* `django-haystack <http://haystacksearch.org/>`_ and
+ `whoosh <https://bitbucket.org/mchaput/whoosh/wiki/Home>`_
+
+ This runs the search system. I picked whoosh because it's a pure Python
+ package and thus really easy to install and use.
+
+ You can pick something different and change ``settings_local.py`` with
+ the appropriate configuration.
+
+
+HtML / CSS / JavaScript
+=======================
+
+* `Learning HTML at MDN
+ <https://developer.mozilla.org/en-US/learn/html>`_,
+ `Learning CSS at MDN
+ <https://developer.mozilla.org/en-US/learn/css>`_ and
+ `Learning JavaScript at MDN
+ <https://developer.mozilla.org/en-US/learn/javascript>`_
+
+ These are great references for learning HTML, CSS and
+ JavaScript. Highly recommended reading before you jump into the
+ user-interface related code.
14 docs/dev_testing.rst
@@ -0,0 +1,14 @@
+=======
+ Tests
+=======
+
+richard uses ``django-nose`` to tie the Django test system to ``nose``.
+
+To run the tests::
+
+ ./manage.py test
+
+
+To add new tests:
+
+.. todo:: write adding tests
48 docs/index.rst
@@ -0,0 +1,48 @@
+=====================================
+ Welcome to Richard's documentation!
+=====================================
+
+Summary
+=======
+
+.. todo:: write summary here
+
+
+Administrators guide
+====================
+
+.. toctree::
+ :maxdepth: 2
+
+ install
+ deploy
+ administration
+
+
+Contributors guide
+==================
+
+.. toctree::
+ :maxdepth: 2
+
+ dev_contribute
+ dev_hacking
+ dev_layout
+ dev_testing
+ dev_conventions
+ dev_resources
+
+
+Documentation todo
+==================
+
+.. todolist::
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
167 docs/install.rst
@@ -0,0 +1,167 @@
+====================
+ Installing richard
+====================
+
+.. Note::
+
+ Richard is pretty new and is under heavy development. As such, the
+ documentation for it sucks and the installation guide may have as
+ much of a chance of helping you install Richard as it does helping
+ you make a quiche.
+
+ I'm really sorry about that, but I'm still bootstrapping the
+ project.
+
+ If you have thoughts on better instructions, let me know.
+
+
+Richard requires a bunch of stuff to run. I'm going to talk about this
+stuff in two groups:
+
+1. stuff that you should install with your package manager
+2. Python packages that should get installed in a virtual environment
+
+
+Things that you should install with your package manager
+========================================================
+
+You need the following things all of which should be provided by your
+system/package manager:
+
+* Python 2.6 or 2.7
+* pip
+* virtualenv
+* MySQL Server
+* MySQL client headers
+
+
+On Debian, this translates to::
+
+ apt-get install \
+ python \
+ python-pip \
+ python-virtualenv \
+ mysql-server \
+ mysql-client \
+ libmysqlclient-dev
+
+
+Setting up a directory structure
+================================
+
+Your site is an instance of richard with configuration, templates, and
+data that's specific to your site.
+
+I suggest something like the following::
+
+ your_site/ <-- your site directory
+ |- bin/ <-- directory for your .wsgi file
+ |- templates/ <-- your site-specific templates
+ |- media/ <-- images, js, css served by your web server
+ |- venv/ <-- virtual environment holding
+ |
+ |- richard/ <-- tarball / git repository
+ |- richard/ <-- richard django project
+ ...
+
+To generate that::
+
+ $ mkdir -p your_site \
+ your_site/bin \
+ your_site/templates \
+ your_site/media \
+ your_site/venv
+
+If you have a tarball::
+
+ $ cd your_site
+ $ tar -xzvf richard.tar.gz
+
+If you're cloning from git::
+
+ $ cd your_site
+ $ git clone git://path/to/richard
+
+
+.. Note::
+
+ The rest of these instructions assume your current working
+ directory is ``your_site``.
+
+
+Python packages to install
+==========================
+
+Now you need to install some other things all of which are specified
+in the requirements files provided.
+
+Using pip, create a virtual environment and install everything into
+it::
+
+ $ pip install -E ./venv/ -r requirements/base.txt
+
+
+.. Note::
+
+ This created a virtual environment. You'll need to use that virtual
+ environment to run Richard. To activate the virtual environment, do::
+
+ $ . ./venv/bin/activate
+
+
+Setting up the database
+=======================
+
+You need to create a database and a user for that database.
+
+For example, to create a database named ``richard`` with a user named
+``richard`` with password ``password``, you'd do::
+
+ $ mysql -u root -p
+ mysql> CREATE DATABASE richard;
+ mysql> GRANT ALL ON richard.* TO richard@localhost IDENTIFIED BY
+ 'password';
+
+(Optional) If you're a developer and plan to run the test suite,
+you'll also need to add permissions to the test database. The test
+database has the same name as the database prepended with ``test_``.
+For example::
+
+ $ mysql -u root -p
+ mysql> GRANT ALL ON test_richard.* TO richard@localhost IDENTIFIED
+ BY 'password';
+