Commits

Scott Nixon committed d18ba15

Initial import and migration from SVN

Comments (0)

Files changed (23)

bpd/__init__.py

Empty file added.
+#!/usr/bin/env python
+from django.core.management import execute_manager
+try:
+    import settings # Assumed to be in the same directory.
+except ImportError:
+    import sys
+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+    sys.exit(1)
+
+if __name__ == "__main__":
+    execute_manager(settings)

bpd/photos/__init__.py

Empty file added.
+from django.contrib import admin
+from django.db import models
+from models import BeerPhotos
+
+class BeerPhotoAdmin(admin.ModelAdmin):
+    image_url = models.CharField()
+    list_display = ['user_email', 'image_url', 'pub_date']
+    
+admin.site.register(BeerPhotos, BeerPhotoAdmin)
+from django.contrib.syndication.feeds import Feed
+from photos.models import BeerPhotos
+
+class BeerPorn(Feed):
+	title = "BeerPornDaily.com - Photo Stream"
+	link = "http://beerporndaily.com/"
+	description = "Daily Beer Porn updates to feed your Craft Beer addiction."
+	
+	def items(self):
+		return BeerPhotos.active.all().order_by('-pub_date')[:10]
+	
+	def item_pub_date(self, item):
+		return item.pub_date
+from django.db import models
+from django import forms
+from django.forms import ModelForm
+from photos.models import BeerPhotos
+
+class BeerPhotoForm(ModelForm):
+	class Meta:
+		model = BeerPhotos
+		exclude = ('beer_slug',  'add_date', 'pub_date', 'publish')

bpd/photos/managers.py

+import datetime
+from django.db import models
+
+class ActivePhotos(models.Manager):
+	def get_query_set(self):
+		return super(ActivePhotos, self).get_query_set().filter(publish=1).filter(pub_date__lte=datetime.datetime.now())
+from django.db import models
+from django.core.files.storage import default_storage as s3_storage
+from managers import ActivePhotos
+from autoslug import AutoSlugField
+
+class BeerPhotos(models.Model):
+	beer_slug = AutoSlugField(populate_from='user_desc', max_length=50,unique=True)
+	image_url = models.ImageField(upload_to='public',verbose_name='**Select Image')
+	user_email = models.EmailField(verbose_name='**Email')
+	user_twittername = models.CharField(blank=True,max_length=100,verbose_name='Twitter name')
+	user_website = models.URLField(verify_exists=True, max_length=200, blank=True,verbose_name='Website')
+	user_desc = models.TextField(max_length=200,verbose_name='**Description')
+	add_date = models.DateField(auto_now_add=True)
+	pub_date = models.DateField(blank=True)
+	publish = models.BooleanField(default=False,blank=True)
+	
+	objects = models.Manager()
+	active = ActivePhotos()
+	
+	def __unicode__(self):
+		return self.user_desc
+	
+
+	class Meta:
+		ordering = ('image_url',)
+	
+	@models.permalink
+	def get_absolute_url(self):
+		return ('photos.views.photo_detail',  None, { 'beer_slug': self.beer_slug })
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+
+import mimetypes, imghdr 
+from django.shortcuts import render_to_response, get_object_or_404
+from django.core.paginator import Paginator, InvalidPage, EmptyPage
+from django.http import HttpResponse, Http404, HttpResponseRedirect
+from django.template import RequestContext
+from django.core.urlresolvers import reverse
+from django.views.generic.create_update import create_object
+from django.core.files.storage import default_storage
+from django.forms.util import ErrorList
+#from boto.s3.connection import S3Connection
+#from boto.s3.key import Key
+from forms import BeerPhotoForm
+from models import BeerPhotos
+from managers import ActivePhotos
+from django.core.mail import send_mail, mail_managers
+from local_settings import *
+
+def main_index(request):
+	porn_list = BeerPhotos.active.all().order_by('-pub_date')
+	
+	paginator = Paginator(porn_list, 6) # Show 6 posts per page
+
+    # Make sure page request is an int. If not, deliver first page.
+	try:
+		page = int(request.GET.get('page', '1'))
+	except ValueError:
+		page = 1
+
+    # If page request (9999) is out of range, deliver last page of results.
+	try:
+		porn_list = paginator.page(page)
+	except (EmptyPage, InvalidPage):
+		porn_list = paginator.page(paginator.num_pages)
+
+	return render_to_response('homepage.html', locals(),context_instance=RequestContext(request))	
+	
+def submit_photo(request):
+	if request.method == 'POST':
+		request.session['to'] = request.POST['user_email']
+		request.session['desc'] = request.POST['user_desc']
+		return create_object(request, form_class=BeerPhotoForm, template_name="photos/submit_photos.html", post_save_redirect=(reverse('photos.views.thanks')))
+		#def store_in_s3(filename, content):
+		#	conn = S3Connection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
+		#	bucket = conn.create_bucket(AWS_STORAGE_BUCKET_NAME)
+		#	mime = mimetypes.guess_type(filename)[0] 
+		#	k = Key(bucket)
+		#	k.key = filename
+		#	k.set_metadata("Content-Type", mime)
+		#	k.set_contents_from_file(content)
+		#	k.set_acl('public-read')
+		
+		
+		#qw = request.FILES['image_url']
+		#filename = qw.name
+		#image = filename
+		#content = qw.file
+		#url  = "http://bpd-public.s3.amazonaws.com/" + image
+				
+		#data = {image_url : url, user_email : request.POST['user_email'], user_twittername : request.POST['user_twittername'], user_website : request.POST['user_website'], user_desc : request.POST['user_desc']}
+		#s = BeerPhotoForm(request.POST, request.FILES)
+		#if s.is_valid():
+			#import pdb; pdb.set_trace()
+			#if imghdr.what(request.FILES['image_url']):
+			#s.save()
+			#store_in_s3(filename, content)		
+			#return HttpResponseRedirect(reverse('photos.views.thanks'))
+			#s = s['image_url'].errors.apppend(u'Please only add image files.')	
+		#form = BeerPhotoForm(request.POST, request.FILES)	
+		#return  render_to_response('photos/submit_photos.html', locals(),context_instance=RequestContext(request))
+		#else:			
+			#return "What!"
+			#HttpResponse(status=205)
+			#self._errors["image_url"] = ErrorList([msg])
+			
+	else:
+		form = BeerPhotoForm()
+	
+	return render_to_response('photos/submit_photos.html', locals(),context_instance=RequestContext(request))
+	
+def photo_detail(request, beer_slug):
+	porn = get_object_or_404(BeerPhotos, beer_slug=beer_slug)
+
+	return render_to_response('photos/photo_detail.html', locals(),context_instance=RequestContext(request))	
+	
+def photo_index(request):
+	objects = BeerPhotos.objects.all()[:5]
+	return render_to_response('homepage.html', locals(),context_instance=RequestContext(request))
+	
+def thanks(request):
+	try:
+		mail_managers('new BPD photo', "BPD submission.\n\nFROM:" + request.session['to']
+			      + "\ndescription:" + request.session['desc'] + "\n\nWoot!",fail_silently=False)
+	except:
+		pass
+	try:
+		send_mail('BeerPornDaily photo submission',
+			'Thanks for your submission to BeerPornDaily! It usually takes our staff a few days to sort through the photos. Our goal is to share great content and spread craft beer through awesome photos.\n\n Please share again!\n\n Thanks, Scott\n\n http://beerporndaily.com/', 'hops@beerporndaily.com', [request.session['to']], fail_silently=False)
+	except:
+		pass
+	del request.session['to']
+	del request.session['desc']
+	return render_to_response('photos/Submission_thankyou.html', locals(), context_instance=RequestContext(request))
+	
+# Django settings for beerporn project.
+
+CSS_PATH = ""
+	
+SEND_BROKEN_LINK_EMAILS = False
+
+ADMINS = (
+    ('Scott Nixon', 'citadelgrad@gmail.com'),
+)
+
+MANAGERS = ADMINS
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'America/New_York'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = '/media/'
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = '/media/admin/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = '+tsfi914!$up991o%wgz((11^2n3=0k*7)=vwcux)8^+zrei)b'
+
+# 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',
+)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+)
+
+ROOT_URLCONF = 'urls'
+
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.admin',
+    'photos',
+)
+
+FILE_UPLOAD_MAX_MEMORY_SIZE = 2048
+
+
+try:
+    from local_settings import *
+except ImportError, exp:
+    pass
+from django.conf.urls.defaults import *
+from django.contrib import admin
+from photos.feeds import BeerPorn
+admin.autodiscover()
+
+feeds = {
+	'rss' : BeerPorn,
+}
+
+urlpatterns = patterns('',
+    (r'^admin/', include(admin.site.urls)),
+    (r'^$', 'photos.views.main_index'),
+    (r'^photos/$', 'photos.views.photo_index'),
+    (r'^submit/$', 'photos.views.submit_photo'),
+    (r'^thanks/$', 'photos.views.thanks'),
+    (r'^photo/(?P<beer_slug>[-\w]+)/$', 'photos.views.photo_detail'),
+    (r'^(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
+    (r'^media/(?P<path>.*)$', 'django.views.static.serve',
+			{'document_root': 'C:/beerporndaily/media/'}),
+)
+body {
+        background-color: white;
+        font-family: Helvetica Neue, Helvetica, sans-serif;
+}
+a, a:active, a:hover, a:visited {
+        color: #0187C5;
+        text-decoration: none;
+}
+#doc3 {
+        margin: 0;
+}
+#hd, #ft {
+        margin: 1.2em 0em 1.2em 0em;
+        padding: 0em;
+}
+#bd {
+        padding: 0em 2em 2em 3em;
+}
+#blurb li {
+        display:inline;
+        list-style: none;
+        font-size: 1.2em;
+}
+.ads{
+	width: 848px;
+	margin-left: auto;
+	margin-right: auto;
+}
+#featuredpub {
+	position:absolute;
+	top: 10px;
+	right:10px;
+}
+p {
+        margin: 0.4em 0.4em 0.4em 0em;
+}
+.container {
+        display:inline-block;
+        margin: 0em 3em 2em 0em;
+        padding: 10px 10px 25px 10px;
+        background: #eee;
+        border: 1px solid #fff;
+        -moz-box-shadow: 0px 2px 15px #333;
+        -webkit-box-shadow: rgb(51, 51, 51) 0px 2px 15px;
+}
+.photoinfo {
+        margin: 0.4em 0em 0.4em 0em;
+}
+ul.gallery li a {
+        float: left;
+        padding: 10px 10px 25px 10px;
+        background: #eee;
+        border: 1px solid #fff;
+        -moz-box-shadow: 0px 2px 15px #333;
+        position: relative;
+}
+
+grey a {
+        background-color: #EEE;
+        padding: 5px;
+}
+#blurb  {
+        background-color:#EEEEEE;
+        border-bottom:1px solid #D0D0D0;
+        border-top:1px solid #D0D0D0;
+        margin-bottom:1em;
+        margin-top:0.5em;
+        text-align:left;
+}
+ul.errorlist li {
+	font-size: small;
+	color: red;
+	clear:left;
+}
+.right-align {
+	float:right;
+}
+
+/*
+body{
+font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
+font-size:12px;
+}*/
+p, h1, form, button{border:0; margin:0; padding:0;} 
+.spacer{clear:both; height:1px;}
+/* ----------- My Form ----------- */
+.myform{
+	margin: 0 auto auto auto;
+	width: 400px;
+	padding: 14px;
+}
+
+/* ----------- stylized ----------- */
+#stylized{
+    border:solid 2px #b7ddf2;
+    background:#ebf4fb;
+}
+#stylized h1 {
+    font-size:18px;
+    font-weight:bold;
+    margin-bottom:8px;
+}
+#stylized .header {
+    font-size:14px;
+}
+#stylized p{
+    font-size:11px;
+    color:#666666;
+    margin-bottom:20px;
+    border-bottom:solid 1px #b7ddf2;
+    padding-bottom:10px;
+}
+#stylized label{
+    display:block;
+    font-weight:bold;
+    text-align:right;
+    width:140px;
+    float:left;
+}
+#stylized .small{
+    color:#666666;
+    display:block;
+    font-size:11px;
+    font-weight:normal;
+    text-align:right;
+    width:140px;
+}
+#stylized input{
+    float:left;
+    font-size:12px;
+    padding:4px 2px;
+    border:solid 1px #aacfe4;
+    width:200px;
+    margin:2px 0 20px 10px;
+}
+#stylized textarea{
+    float:left;
+    font-size:12px;
+    padding:4px 2px;
+    border:solid 1px #aacfe4;
+    width:200px;
+    height: 160px;
+    margin:2px 0 20px 10px;
+}
+#stylized select{
+    float:left;
+    font-size:12px;
+    padding:4px 2px;
+    border:solid 1px #aacfe4;
+    width:200px;
+    margin:2px 0 20px 10px;
+}
+#stylized button{
+    clear:both;
+    margin-left:150px;
+    width:125px;
+    height:31px;
+    background:#666666;
+    text-align:center;
+    line-height:31px;
+    color:#FFFFFF;
+    font-size: large;
+    font-weight:bold;
+}
+#postlist li {
+    font-size: 1.3em;
+    margin-left: 1.3em;
+    list-style: disc;
+    
+}
+
+.greenbutton {
+	background-color: green;
+	font-weight: bolder;
+	color: white;
+	font-size: 18px;
+        margin-left: 10em;
+}
+.largetext {
+	width:200px;
+	height:100px;
+}

media/googleanalytics.js

+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-15221640-1");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+{% extends "index.html" %}
+
+{% block title %} 404 Error Page {% endblock %}
+
+{% block content %}
+<div>
+	<div class="title"><span>Sorry the page your are requesting does not exist.</span></div>
+	<div class="menu_content">
+		<h3>Check your link try again. Or just click on the logo to start again.</h3>
+	</div>
+</div>
+{% endblock %}
+
+{% block sidebar %}   
+	
+
+
+{% endblock %} 
+{% extends "inbox.html" %}
+
+{% block title %}{% endblock %}
+
+{% block content %} 
+<div class="box_content margin">
+	<div class="title"><span>Server Error.</span></div>
+	<div class="menu_content">
+		<h3>Sorry there has been an error on the Server. Our system has automatically notified of this issue and will work to resolve it.</h3>
+	</div>
+</div><!
+
+
+{% endblock %}
+
+{% block sidebar %}   
+	
+
+
+{% endblock %} 

templates/feeds/rss_description.html

+Description: {{ obj.user_desc|safe }}

templates/feeds/rss_title.html

+BeerPorn by {% if obj.user_twittername %}@{{ obj.user_twittername }} {% endif %} {% if obj.user_twittername %}{{ obj.user_website|safe }}{% endif %}

templates/homepage.html

+{% extends "index.html" %}
+
+{% block title %} Beer Porn from the Craft Beer Community {% endblock %}
+
+{% block content %}
+{% if porn_list.object_list %}
+{% spaceless %}
+    {% for object in porn_list.object_list %}
+    <div class="container">
+        <div id='image'><img src='{{ object.image_url }}' height='450' /></div>
+        <div class='photoinfo'><a href='{{ object.user_website }}'>{{ object.user_website|urlizetrunc:45 }}</a><a class='right-align' href="http://twitter.com/{{ object.user_twittername }}">@{{ object.user_twittername }}</a>
+             <p>{{ object.user_desc }}</p>
+        </div>
+    </div>
+    {% endfor %}
+    
+    <!-- pagination -->
+	<div class="pagination">
+		<span class="step-links">
+			{% if porn_list.has_previous %}
+				<a href="?page={{ porn_list.previous_page_number }}">previous</a>
+			{% endif %}
+
+			<span class="current">
+				Page {{ porn_list.number }} of {{ porn_list.paginator.num_pages }}.
+			</span>
+
+			{% if porn_list.has_next %}
+				<a href="?page={{ porn_list.next_page_number }}">next</a>
+			{% endif %}
+		</span>
+	</div><!-- end pagination -->
+{% endspaceless %}
+{% else %}
+<p>No photos exist.</p>
+{% endif %}
+
+
+{% endblock %}
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+	<meta http-equiv="Content-Language" content="en-us" />
+	<meta name="ROBOTS" content="ALL" />
+	<meta http-equiv="imagetoolbar" content="no" />
+	<meta name="MSSmartTagsPreventParsing" content="true" />
+	
+	<meta name="Copyright" content="This site's design and contents Copyright (c) 2010 BeerPornDaily.com." />
+	<meta name="keywords" content="Beer Porn, BeerPorn, Craft Beer, Beer, CraftBeer, Beer Fingers, BeerFingers" />
+	<meta name="description" content="Daily Beer Porn updates to feed your Craft Beer addiction." />
+	<link rel="alternate" type="application/rss+xml" title="BeerPornDaily Photos RSS" href="/rss/">
+	<title>{% block title %}{{ title }}| BeerPornDaily.com{% endblock %}</title>
+<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0r4/build/reset-fonts-grids/reset-fonts-grids.css">
+<link rel="stylesheet" type="text/css" href="http://photos01.beerporndaily.com/CSS/bpd-main.css">
+</head>
+<body>
+<div id="doc3">
+   <div id="hd">
+	<div class="ads">
+		<script type='text/javascript'><!--//<![CDATA[
+		var m3_u = (location.protocol=='https:'?'https://ads.foodbuzz.com/www/delivery/ajs.php':'http://ads.foodbuzz.com/www/delivery/ajs.php');
+		var m3_r = Math.floor(Math.random()*99999999999);
+		if (!document.MAX_used) document.MAX_used = ',';
+		document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
+		document.write ("?zoneid=3873");
+		document.write ('&amp;cb=' + m3_r);
+		if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
+		document.write ("&amp;loc=" + escape(window.location));
+		if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
+		if (document.context) document.write ("&context=" + escape(document.context));
+		if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
+		document.write ("'><\/scr"+"ipt>");
+	     //]]>--></script>
+		<noscript><a href='http://ads.foodbuzz.com/www/delivery/ck.php?n=aba26f37&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.foodbuzz.com/www/delivery/avw.php?zoneid=3873&amp;n=aba26f37' border='0' alt='' /></a></noscript>
+		
+	</div>
+	<div id="featuredpub"><a href="http://www.foodbuzz.com/foodies/profile/beerporndaily" target="foodbuzz"><img src="http://www.foodbuzz.com/images/foodbuzz_120x60_badge_pub.gif?64349" title="Foodbuzz" alt="Foodbuzz" style="border:none;" /></a></div>
+	<div id="blurb">
+	<ul>
+	<li><a href="{% url photos.views.main_index %}"><img src='http://photos01.beerporndaily.com/logos/BeerPornDailyLogov2.png' alt='Daily Beer Porn updates to feed your Craft Beer addiction.'></a></li>
+	<li class='grey'><a href="{% url photos.views.submit_photo %}">Submit a Photo</a></li>
+	</ul>
+	</div>
+   </div> 
+   <div id="bd">
+	<div style="float: right; position: absolute; top: 708px; right: 5px;"></div>
+	{% block content %}   
+	{% endblock %}
+   </div>
+   <div><a href="/rss/" rel="BeerPornDaily.com Photo RSS feed"><img src="http://img1.happyherbivore.com/social/rss_16.png" alt="RSS Icon" height="16" width="16"/></a></div>
+   <div id="ft">Brought to you by <a href="http://beerfingers.com/">BeerFingers</a> follow us on <a href="http://twitter.com/beerfingers">BeerFingers Twitter</a> and <a href="http://twitter.com/beerporndaily">Beer Porn Daily Twitter.</a> Copyright BeerPornDaily 2010.
+   {% if user.is_superuser %} <p><a href="/admin/">Admin</a></p>{% endif %}</div> 
+</div>
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-15221640-1");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+</body>
+</html>

templates/photos/Submission_thankyou.html

+{% extends "index.html" %}
+
+{% block title %} Thank you {% endblock %}
+
+{% block content %}
+	<h3>Cheers to you, thanks for submitting a photo!</h3>
+
+{% endblock %}

templates/photos/photo_detail.html

+{% extends "index.html" %}
+
+{% block title %} Beer Porn from the Craft Beer Community {% endblock %}
+
+{% block content %}
+{% if porn %}
+    {% spaceless %}
+        <div class="container">
+            <div id='image'><img src='{{ porn.image_url }}' height='450' /></div>
+            <div class='photoinfo'><a href='{{ porn.user_website }}'>
+            {{ porn.user_website|urlizetrunc:45 }}</a><a class='right-align' href="http://twitter.com/{{ porn.user_twittername }}">
+            @{{ porn.user_twittername }}</a>
+                 <p>{{ porn.user_desc }}</p>
+            </div>
+        </div>
+        
+    {% endspaceless %}
+{% else %}
+    <p>No photos exist.</p>
+{% endif %}
+
+
+{% endblock %}

templates/photos/submit_photos.html

+{% extends "index.html" %}
+
+{% block title %} Submit a Photo {% endblock %}
+
+{% block content %}
+<div id="stylized" class="myform">
+	<form action="." method="post" enctype="multipart/form-data" width="450px">
+		<h1>Photo Submission</h1>
+		<p class="header">Submit your photos to use and if we use your photo we will link your work back to your website and twitter.
+			<ul id='postlist'>
+			  <li>It must be beer or about beer.</li>
+			  <li>High quality photos are preferred and should be at least 450px by 450px.</li>
+			  <li>Photos are limited to 2MB.</li>
+			  <li>You must own the rights to the photo.</li>
+			</ul>
+		</p>
+		{% for field in form %}
+				{{ field.errors }}
+				{{ field.label_tag }} {{ field }}
+		{% endfor %}
+        <label><span>** = Required</span></label>      
+	<input type="submit" class="greenbutton" value="Submit your Photo" />
+	</form>
+	<div class="spacer"></div>
+</div>
+{% endblock %}