fmartingr
/
shelfzilla
Archived
1
0
Fork 0

Fixed API media URL for covers

This commit is contained in:
Felipe Martín 2015-04-06 07:27:52 +02:00
parent 8d61bfbfae
commit 4427d339b4
3 changed files with 4 additions and 8 deletions

View File

@ -47,10 +47,10 @@ class VolumeSerializer(serializers.ModelSerializer):
def get_cover_thumbnail(self, obj):
if obj.cover:
path = get_thumbnailer(obj.cover).get_thumbnail({
url = get_thumbnailer(obj.cover).get_thumbnail({
'size': (100, 100), 'crop': 'scale', 'autocrop': True,
}).url
return '{}{}'.format(settings.BASE_URL, path)
return url
return None
class Meta:

View File

@ -325,5 +325,3 @@ DJOSER = {
'LOGIN_AFTER_ACTIVATION': True,
'SEND_ACTIVATION_EMAIL': False,
}
BASE_URL = 'https://shelfzilla.com'

View File

@ -28,12 +28,10 @@ INSTALLED_APPS += (
FILER_DUMP_PAYLOAD = True
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
MEDIA_URL = 'http://localhost:8000/media/'
STATIC_URL = 'http://localhost:8000/static/'
EMAIL_BACKEND = 'django_mailgun.MailgunBackend'
MAILGUN_ACCESS_KEY = 'key-fdfc57f2bfb35a4ba5f9c1e3c30af373'
MAILGUN_SERVER_NAME = 'sandbox2dd21e486d144dc59742738b15e494ee.mailgun.org'
FROM_EMAIL = 'info@shelfzilla.com'
BASE_URL = 'http://localhost:8000'