From fb3075fbe2a6db9c14b5e71cc3d560f21b864946 Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Fri, 4 Apr 2014 17:48:17 +0200 Subject: [PATCH 1/3] Updated settings --- shelfzilla/settings/base.py | 39 +++++++++++++++++++++++++++++++ shelfzilla/settings/production.py | 19 +++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 shelfzilla/settings/production.py diff --git a/shelfzilla/settings/base.py b/shelfzilla/settings/base.py index 20f1f57..d3745d5 100644 --- a/shelfzilla/settings/base.py +++ b/shelfzilla/settings/base.py @@ -168,3 +168,42 @@ THUMBNAIL_PROCESSORS = ( COVER_FOLDER_PK = 1 COVER_FOLDER_OWNER_PK = 1 + +STORAGES = { + 'public': { + 'main': { + 'ENGINE': 'django.core.files.storage.FileSystemStorage', + 'OPTIONS': {}, + 'UPLOAD_TO': 'shelfzilla.utils.generate_randomized', + 'UPLOAD_TO_PREFIX': 'public', + }, + 'thumbnails': { + 'ENGINE': 'django.core.files.storage.FileSystemStorage', + 'OPTIONS': {}, + 'THUMBNAIL_OPTIONS': { + 'base_dir': 'public_thumbnails', + }, + }, + }, + 'private': { + 'main': { + 'ENGINE': 'filer.storage.PrivateFileSystemStorage', + 'OPTIONS': { + 'location': os.path.abspath( + os.path.join(MEDIA_ROOT, '../smedia/private')), + 'base_url': '/smedia/private/', + }, + 'UPLOAD_TO': 'shelfzilla.utils.generate_randomized', + 'UPLOAD_TO_PREFIX': '', + }, + 'thumbnails': { + 'ENGINE': 'filer.storage.PrivateFileSystemStorage', + 'OPTIONS': { + 'location': os.path.abspath( + os.path.join(MEDIA_ROOT, '../smedia/private_thumbnails')), + 'base_url': '/smedia/private_thumbnails/', + }, + 'THUMBNAIL_OPTIONS': {}, + }, + }, +} diff --git a/shelfzilla/settings/production.py b/shelfzilla/settings/production.py new file mode 100644 index 0000000..abfe87d --- /dev/null +++ b/shelfzilla/settings/production.py @@ -0,0 +1,19 @@ +import os +import dj_database_url +from .base import * + + +DEBUG = False +TEMPLATE_DEBUG = False + +DATABASES = { + 'default': dj_database_url.parse(os.environ['APP_DATABASE_URL']) +} + +STATIC_ROOT = os.environ['APP_STATIC_ROOT'] +MEDIA_ROOT = os.environ['APP_MEDIA_ROOT'] + +SECRET_KEY = os.environ['APP_SECRET_KEY'] + +INTERNAL_IPS = environ['APP_INTERNAL_IPS'].split(',') +ALLOWED_HOSTS = environ['APP_ALLOWED_HOSTS'].split(',') From 9e477bd092301eb7cf89a1cdb14b165242d660ba Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Fri, 4 Apr 2014 18:00:10 +0200 Subject: [PATCH 2/3] grunt compile now bowers --- gruntfile.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gruntfile.coffee b/gruntfile.coffee index 5da48a4..478f638 100644 --- a/gruntfile.coffee +++ b/gruntfile.coffee @@ -119,9 +119,11 @@ module.exports = (grunt) -> ] grunt.registerTask 'compile', [ + "bower", "less", "coffee", "concat", 'uglify', "clean:development" ] grunt.registerTask 'build', [ + "bower", "less", "coffee", "concat", "uglify", 'clean:production' ] From 9c519e5764504436c8b3add237f612b06d681540 Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Fri, 4 Apr 2014 18:24:14 +0200 Subject: [PATCH 3/3] Added "other" filter to series listing --- shelfzilla/apps/manga/views/series.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shelfzilla/apps/manga/views/series.py b/shelfzilla/apps/manga/views/series.py index c5234ea..ce8c7a1 100644 --- a/shelfzilla/apps/manga/views/series.py +++ b/shelfzilla/apps/manga/views/series.py @@ -38,8 +38,7 @@ class SeriesListView(SeriesView): elif letter == 'all': result = Series.objects.all() elif letter == 'other': - # result = Series.objects.filter(name__regex=r'') - result = [] + result = Series.objects.exclude(name__regex=r'^[a-zA-Z]') return result