# HG changeset patch # User Brian Neal # Date 1378777988 18000 # Node ID d33bedc3be74deff7689688c12ae9ea8eda46d0b # Parent 67f8d49a9377d1eaef853533b101d50c05893668# Parent efb525863a75bd105d740b682591ecf319be7f73 Merge private messages fix with current development of S3 photo upload. diff -r efb525863a75 -r d33bedc3be74 potd/models.py --- a/potd/models.py Mon Sep 09 20:30:13 2013 -0500 +++ b/potd/models.py Mon Sep 09 20:53:08 2013 -0500 @@ -32,7 +32,7 @@ thumb = models.ImageField(upload_to='potd/%Y/%m/%d/thumbs', blank=True, null=True) caption = models.CharField(max_length=128) description = models.TextField() - user = models.ForeignKey(User) + user = models.ForeignKey(User, related_name='potd_set') date_added = models.DateField() potd_count = models.IntegerField(default=0) diff -r efb525863a75 -r d33bedc3be74 sg101/settings/base.py --- a/sg101/settings/base.py Mon Sep 09 20:30:13 2013 -0500 +++ b/sg101/settings/base.py Mon Sep 09 20:53:08 2013 -0500 @@ -141,6 +141,7 @@ 'potd', 'shoutbox', 'smiley', + 'user_photos', 'weblinks', 'wiki', 'ygroup', @@ -290,6 +291,15 @@ WIKI_COOKIE_AGE = SESSION_COOKIE_AGE WIKI_REDIS_SET = 'wiki_cookie_keys' +# User photo upload settings +USER_PHOTOS_ENABLED = True +USER_PHOTOS_ACCESS_KEY = SECRETS['AWS_ACCESS_KEY'] +USER_PHOTOS_SECRET_KEY = SECRETS['AWS_SECRET_KEY'] +USER_PHOTOS_BUCKET = 'sg101.user.photos' +USER_PHOTOS_BASE_URL = 'https://s3-us-west-1.amazonaws.com' +USER_PHOTOS_MAX_SIZE = (660, 720) +USER_PHOTOS_THUMB_SIZE = (120, 120) + ####################################################################### # Asynchronous settings (queues, queued_search, redis, celery, etc) ####################################################################### diff -r efb525863a75 -r d33bedc3be74 sg101/templates/user_photos/photo_detail.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sg101/templates/user_photos/photo_detail.html Mon Sep 09 20:53:08 2013 -0500 @@ -0,0 +1,18 @@ +{% extends 'base.html' %} +{% block title %}User Photo Details{% endblock %} +{% block content %} +

User Photo Details

+ +