Commits

Mark Lavin committed a62be8f Draft Merge

Merge latest default changes to stable.

  • Participants
  • Parent commits ee06f2e, d6aaea4
  • Branches stable

Comments (0)

Files changed (20)

File bethandmark/customize/views.py

-from django.shortcuts import render_to_response
-from django.template import RequestContext
+from django.shortcuts import render
 
 from photobook.models import Photo
 
 
 def homepage(request):
     photos = Photo.objects.published().order_by('?')[:10]
-    return render_to_response(
-            'flatfiles/homepage.html',
-            {'photos': photos},
-            context_instance=RequestContext(request)
-    )
+    return render(request, 'flatfiles/homepage.html', {'photos': photos})

File bethandmark/photobook/templates/photobook/gallery_archive.html

 {% extends "photobook/gallery_list.html" %}
+{% load url from future %}
 
 {% block title %}Latest Photo Galleries{% endblock %}
 
 {% else %}
     <p>No galleries were found.</p>
 {% endif %}
-<p style="clear:both"><a href="{% url gallery-list 1 %}">View all galleries.</a></p>
+<p style="clear:both"><a href="{% url 'gallery-list' 1 %}">View all galleries.</a></p>
 {% endblock %}

File bethandmark/photobook/templates/photobook/gallery_archive_day.html

 {% extends "photobook/gallery_list.html" %}
+{% load url from future %}
 
 {% block title %}Galleries for {{ day|date }}{% endblock %}
 
 {% else %}
     <p>No galleries were found.</p>
 {% endif %}
-<p style="clear:both"><a href="{% url gallery-list 1 %}">View all galleries.</a></p>
+<p style="clear:both"><a href="{% url 'gallery-list' 1 %}">View all galleries.</a></p>
 {% endblock %}

File bethandmark/photobook/templates/photobook/gallery_archive_month.html

 {% extends "photobook/gallery_list.html" %}
+{% load url from future %}
 
 {% block title %}Galleries for {{ month|date:"F Y" }}{% endblock %}
 
 {% else %}
     <p>No galleries were found.</p>
 {% endif %}
-<p style="clear:both"><a href="{% url gallery-list 1 %}">View all galleries.</a></p>
+<p style="clear:both"><a href="{% url 'gallery-list' 1 %}">View all galleries.</a></p>
 {% endblock %}

File bethandmark/photobook/templates/photobook/gallery_archive_year.html

 {% extends "photobook/root.html" %}
+{% load url from future %}
 
 {% block title %}Galleries for {{ year }}{% endblock %}
 
 <h1>Galleries for {{ year }}</h1>
 <ul>
 {% for date in date_list %}
-<li><a href="{{ date|date:"m" }}/">{{ date|date:"F" }}</a></li>
+<li><a href="{{ date|date:'m' }}">{{ date|date:"F" }}</a></li>
 {% endfor %}
 </ul>
-<p><a href="{% url gallery-list 1 %}">View all galleries.</a></p>
+<p><a href="{% url 'gallery-list' 1 %}">View all galleries.</a></p>
 {% endblock %}

File bethandmark/photobook/templates/photobook/gallery_detail.html

 {% extends "photobook/root.html" %}
+{% load url from future %}
 
 {% block title %}{{ object.title }}{% endblock %}
 
     {% endfor %}
     </ul>
 </div>
-<p style="clear:both"><a href="{% url gallery-list 1 %}">View all galleries</a></p>
+<p style="clear:both"><a href="{% url 'gallery-list' 1 %}">View all galleries</a></p>
 {% endblock %}
 
 {% block content-related %}
 {% if gallery_archive %}
     {% for month in gallery_archive %}
         <ul>
-        <li><a href="{% url gallery-archive-month month.year,month|date:"m" %}">{{ month|date:"F, Y" }}</a></li>
+        <li><a href="{% url 'gallery-archive-month' month.year month|date:'m' %}">{{ month|date:"F, Y" }}</a></li>
         </ul>
     {% endfor %}
     {% else %}

File bethandmark/photobook/templates/photobook/gallery_form.html

+{% load url from future %}
 {% if photos %}
     {% for photo in photos %}
         <img src="{{ photo.admin_thumbnail.url }}" alt="{{ photo.display.url }}" title="{{ photo.title }}" />
     {% endfor %}
 {% else %}
-    <form id="gallery-form" action="{% url admin:photobook_photo_ajax_gallery %}" method="get">
+    <form id="gallery-form" action="{% url 'admin:photobook_photo_ajax_gallery' %}" method="get">
         {% csrf_token %}
         {{ form.as_p }}
     </form>

File bethandmark/photobook/templates/photobook/gallery_list.html

 {% extends "photobook/root.html" %}
+{% load url from future %}
 
 {% block title %}All Galleries{% if tag %} Tagged '{{ tag.name}}'{% endif %}{% endblock %}
 
 {% if is_paginated %}
 <p style="clear:both">{{ hits }} galleries total.</p>
 <div id="page_controls">
-    <p>{% if has_previous %}<a href="{% url gallery-list prev %}">Previous</a> | {% endif %} page {{ page }} of {{ pages }} {% if has_next %}| <a href="{% url gallery-list next %}">Next</a>{% endif %}</p>
+    <p>{% if has_previous %}<a href="{% url 'gallery-list' prev %}">Previous</a> | {% endif %} page {{ page }} of {{ pages }} {% if has_next %}| <a href="{% url 'gallery-list' next %}">Next</a>{% endif %}</p>
 </div>
 {% endif %}
 {% endblock %}
 {% if gallery_archive %}
     {% for month in gallery_archive %}
         <ul class="clean-list">
-        <li><a href="{% url gallery-archive-month month.year,month|date:"m" %}">{{ month|date:"F, Y" }}</a></li>
+        <li><a href="{% url 'gallery-archive-month' month.year month|date:'m' %}">{{ month|date:"F, Y" }}</a></li>
         </ul>
     {% endfor %}
     {% else %}

File bethandmark/photobook/templates/photobook/upload_form.html

+{% load url from future %}
 {% if photo  %}
     <img id="new-upload-image" src="{{ photo.display.url }}" alt="{{ photo.title }}" title="{{ photo.title }}" />
 {% else %}
-    <form id="upload-form" action="{% url admin:photobook_photo_ajax_upload %}" method="post" enctype="multipart/form-data">
+    <form id="upload-form" action="{% url 'admin:photobook_photo_ajax_upload' %}" method="post" enctype="multipart/form-data">
         {% csrf_token %}
         {{ form.as_p }}
         <p><input type="submit" name="upload" value="Upload" /></p>

File bethandmark/settings.py

 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-    'django.template.loaders.eggs.load_template_source',
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
 )
 
 AUTHENTICATION_BACKENDS = (
 )
 
 TEMPLATE_CONTEXT_PROCESSORS = (
-    'django.core.context_processors.auth',
     'django.core.context_processors.debug',
-    #'django.core.context_processors.i18n',
+    'django.core.context_processors.i18n',
     'django.core.context_processors.media',
+    'django.core.context_processors.static',
+    'django.contrib.auth.context_processors.auth',
+    'django.contrib.messages.context_processors.messages',
     'django.core.context_processors.request',
-    'staticfiles.context_processors.static_url',
 )
 
 ROOT_URLCONF = 'bethandmark.urls'
     'django.contrib.admin',
     'django.contrib.flatpages',
     'django.contrib.markup',
+    'django.contrib.staticfiles',
     # external apps
-    'staticfiles',
     'disqus',
     'diario',
     'tagging',
     'photobook',
 )
 
+INTERNAL_IPS = ('127.0.0.1', )
+
+STATIC_ROOT = os.path.join(LOCAL_PATH, 'static')
+
+STATIC_URL = '/static/'
+
+STATICFILES_FINDERS = (
+    "django.contrib.staticfiles.finders.FileSystemFinder",
+    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
+)
+
+STATICFILES_DIRS = (
+    os.path.join(PROJECT_PATH, 'static'),
+)
+
 # Application settings
 
 DIARIO_NUM_LATEST = 3
 
 ROBOTS_CACHE_TIMEOUT = 60*60*24
 
-INTERNAL_IPS = ('127.0.0.1', )
-
-# django-staticfiles configuration
-STATIC_ROOT = os.path.join(LOCAL_PATH, 'static')
-STATIC_URL = '/static/'
-STATICFILES_MEDIA_DIRNAMES = ('static', 'media', )
-STATICFILES_PREPEND_LABEL_APPS = ('django.contrib.admin', )
-STATICFILES_DIRS = (
-    os.path.join(PROJECT_PATH, 'static'),
-)
-
-

File bethandmark/urls.py

 from django.conf import settings
 from django.contrib import admin
 from django.contrib.sitemaps import FlatPageSitemap
+
 from diario.feeds.entries import RssEntriesFeed, AtomEntriesFeed
-from diario.feeds.tagged import RssEntriesByTagFeed, AtomEntriesByTagFeed
 from diario.sitemaps import DiarioSitemap
 from photobook.sitemaps import GallerySitemap
 
 admin.autodiscover()
 
-entries_feeds = {
-    'rss': RssEntriesFeed,
-    'atom': AtomEntriesFeed,
-}
-
-entries_by_tag_feeds = {
-    'rss': RssEntriesByTagFeed,
-    'atom': AtomEntriesByTagFeed,
-}
 
 sitemaps = {
     'flatpages': FlatPageSitemap,
     # weblog
     (r'^blog/', include('diario.urls.entries')),
     (r'^blog/tags/', include('diario.urls.tagged')),
-    (r'^blog/(?P<slug>(rss|atom))/$', 'diario.views.syndication.feed', {'feed_dict': entries_feeds}),
+    (r'^blog/rss/$', RssEntriesFeed()),
+    (r'^blog/atom/$', AtomEntriesFeed()),
     # photos & homepage
     (r'^gallery/', include('bethandmark.photobook.urls')),
     (r'^', include('bethandmark.customize.urls')),
 
 )
 
-if getattr(settings, 'SERVE_STATIC_MEDIA', False):
-    from staticfiles.urls import staticfiles_urlpatterns
-    urlpatterns += staticfiles_urlpatterns()
-
 #        local('pg_restore -d %(NAME)s -U %(USER)s temp-backup.sql' % db_settings)
 
 def build_static():
-    run('%(virtualenv_root)s/bin/python %(code_root)s/%(project_name)s/manage.py build_static --noinput' % env)
+    run('%(virtualenv_root)s/bin/python %(code_root)s/%(project_name)s/manage.py collectstatic --noinput' % env)
 
 def run_photologue_migration():
     run('%(virtualenv_root)s/bin/python %(code_root)s/%(project_name)s/manage.py migrate_photologue_data' % env)

File requirements.txt

 PIL
 psycopg2
 simplejson==2.1.1
-markdown==2.0.3
-Django==1.2.5
+markdown==2.1.1
+Django==1.3.1
 django-robots==0.6.1
 django-tagging==0.3.1
 django-disqus==0.3
-django-debug-toolbar==0.8.4
+django-debug-toolbar==0.9.4
 south==0.7.3
 django-imagekit==0.3.3
-django-staticfiles==0.3.4
 django-oembed==0.1.3
--e hg+http://bitbucket.org/discovery/django-bitly/#egg=django_bitly
--e git+git://github.com/joshthecoder/tweepy.git#egg=tweepy
-
+django-bitly==0.6
+tweepy==1.9
+django-diario==0.4.0

File templates/base.html

+{% load url from future %}
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB">
 <head>
 <body>
 <div id="header">
     <div class="drop-shadow raised light-blue">
-        <a href="{% url homepage %}">
+        <a href="{% url 'homepage' %}">
             <img  src="{{ STATIC_URL }}images/BethandMark_Header.jpg" alt="Beth and Mark in love" />
         </a>
     </div>
-	<h1><a href="{% url homepage %}" class="title">The Adventures of Beth and Mark</a></h1>
+	<h1><a href="{% url 'homepage' %}" class="title">The Adventures of Beth and Mark</a></h1>
     <noscript><p>It appears you aren't using Javascript.  This site isn't going to be as much fun without it.</p></noscript>
-    {% url diario-entry-list as blog %}
-    {% url gallery-archive as gallery %}
+    {% url 'diario-entry-list' as blog %}
+    {% url 'gallery-archive' as gallery %}
     {% load navigation_tags %}
     <div id="boxtab"><ul>
-        <li class="{% active request '^/$' %}"><a href="{% url homepage %}">Home</a></li>
+        <li class="{% active request '^/$' %}"><a href="{% url 'homepage' %}">Home</a></li>
         <li class="{% active request blog %}"><a href="{{ blog }}">Blog</a></li>
         <li class="{% active request gallery %}"><a href="{{ gallery }}">Pictures</a></li>    
 	    <li class="{% active request '/about/' %}"><a href="/about/">About</a></li>

File templates/diario/blog_base.html

 {% extends "base.html" %}
+{% load url from future %}
 
 {% block content-related %}
 {% load diario_entries diario_tagged %}
 {% if blog_archive %}
     {% for month in blog_archive %}
         <ul class="clean-list">
-        <li><a href="{% url diario-archive-month month.year,month|date:"m" %}">{{ month|date:"F, Y" }}</a></li>
+        <li><a href="{% url 'diario-archive-month' month.year month|date:'m' %}">{{ month|date:"F, Y" }}</a></li>
         </ul>
     {% endfor %}
     {% tag_cloud_for_entries as blog_tags %}
     <h2>Most Popular Tags</h2>
     <ul class="clean-list">
     {% for tag in blog_tags|dictsortreversed:"count"|slice:":10" %}
-    <li><a href="{% url diario-tagged-entry-list tag.name %}">{{ tag.name }} ({{ tag.count}})</a></li>
+    <li><a href="{% url 'diario-tagged-entry-list' tag.name %}">{{ tag.name }} ({{ tag.count}})</a></li>
     {% endfor %}
     </ul>
     <p>See Full TagCloud
-    <a href="{% url tagcloud %}">Here</a>
+    <a href="{% url 'tagcloud' %}">Here</a>
     </p>
 {% else %}
     <p>Empty archive. No entries published.</p>

File templates/diario/entry_detail.html

 {% extends "diario/blog_base.html" %}
+{% load url from future %}
 {% load disqus_tags tagging_tags oembed_tags %}
 
 {% block title %}Blog Entry | {{ entry.title|escape }}{% endblock %}
 {{ entry.body|oembed:"450X450"|safe }}
 <p class="entry-sig"><span class="date">Posted on {{ entry.pub_date|date:"F j, Y" }} by {% if entry.author.first_name %}{{ entry.author.first_name }}{% else %}{{ entry.author.username }}{% endif %}</span>
 {% if tag_list %}
-<br />Tagged: {% for tag in tag_list %}<a href="{% url diario-tagged-entry-list tag.name %}">{{ tag.name }}</a> {% endfor %}
+<br />Tagged: {% for tag in tag_list %}<a href="{% url 'diario-tagged-entry-list' tag.name %}">{{ tag.name }}</a> {% endfor %}
 {% endif %}
 </p>
 {% if debug %}

File templates/diario/entry_list.html

 {% extends "diario/blog_base.html" %}
+{% load url from future %}
 {% load tagging_tags disqus_tags oembed_tags %}
+
 {% block title %}Blog{% endblock %}
 
 {% block extra-meta %}
     <div class="entry-wrapper">
     {{ entry.body|oembed:"450X450"|safe }}
     <p class="entry-sig"><span class="date">Posted on {{ entry.pub_date|date:"F j, Y" }} by {% if entry.author.first_name %}{{ entry.author.first_name }}{% else %}{{ entry.author.username }}{% endif %}</span>
-    {% if tag_list %}<br />Tagged: {% for tag in tag_list %}<a href="{% url diario-tagged-entry-list tag.name %}">{{ tag.name }}</a> {% endfor %}
+    {% if tag_list %}<br />Tagged: {% for tag in tag_list %}<a href="{% url 'diario-tagged-entry-list' tag.name %}">{{ tag.name }}</a> {% endfor %}
     {% endif %}
     {% if debug %}{% disqus_dev %}{% endif %}
     | <a href="{{ entry.get_absolute_url }}#disqus_thread">View Comments</a>

File templates/diario/entry_preview.html

+{% load url from future %}
 {% load tagging_tags oembed_tags %}
+
 {% tags_for_object entry as tag_list %}
 <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
 {{ entry.body|oembed:"250X250"|safe|truncatewords_html:20 }}
 {% if entry.author.first_name %}{{ entry.author.first_name }}{% else %}
 {{ entry.author.username }}{% endif %}</span>
 {% if tag_list %}
-<br />Tagged: {% for tag in tag_list %}<a href="{% url diario-tagged-entry-list tag.name %}">{{ tag.name }}</a> {% endfor %}
+<br />Tagged: {% for tag in tag_list %}<a href="{% url 'diario-tagged-entry-list' tag.name %}">{{ tag.name }}</a> {% endfor %}
 {% endif %}
 </p>

File templates/diario/tagcloud.html

 {% extends "diario/blog_base.html" %}
+{% load url from future %}
 {% load diario_tagged %}
 
 {% block title %}Blog{% endblock %}
 {% tag_cloud_for_entries as blog_tags with steps=9 distribution=linear %}
 <h1>Blog TagCloud</h1><div>
 {% for tag in blog_tags %}
-<a href="{% url diario-tagged-entry-list tag.name %}" style="font-size: {{ tag.font_size|add:"10"}}pt;">{{ tag.name }}</a> 
+<a href="{% url 'diario-tagged-entry-list' tag.name %}" style="font-size: {{ tag.font_size|add:"10"}}pt;">{{ tag.name }}</a> 
 {% endfor %}
-
 </div>
 {% endblock %}

File templates/flatfiles/homepage.html

 {% extends "base.html" %}
+{% load url from future %}
 
 {% block extra-js %}
 {{ block.super }}
 
 {% block content-main %}
 <h1>Welcome to the Adventures of Beth and Mark</h1>
-<p>Check out our <a href="{% url diario-entry-list %}">blog</a> to follow our adventures as "<a href="/about/">re-transplants</a>" in Raleigh, NC or poke around our <a href="{% url gallery-archive %}">photo galleries</a> for pictures we've taken along the way.</p>
+<p>Check out our <a href="{% url 'diario-entry-list' %}">blog</a> to follow our adventures as "<a href="/about/">re-transplants</a>" in Raleigh, NC or poke around our <a href="{% url 'gallery-archive' %}">photo galleries</a> for pictures we've taken along the way.</p>
 {% if photos %}
 <div class="slidetabs">
     {% for photo in photos %}