Forgotten req.
[audio.git] / src / archive / settings.py
1 # -*- coding: utf-8 -*-
2
3 import os.path
4 from django.conf import settings
5
6 # this is where the end user puts new files
7 try:
8     NEW_PATH = settings.ARCHIVE_NEW_PATH
9 except AttributeError:
10     NEW_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
11                         "archive/new"))
12
13 # here the application keeps its managed files
14 try:
15     FILES_PATH = settings.ARCHIVE_FILES_PATH
16 except AttributeError:
17     FILES_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
18                         "archive/files"))
19
20 _media_root = os.path.abspath(settings.MEDIA_ROOT)
21 if FILES_PATH.startswith(_media_root):
22     FILES_SAVE_PATH = FILES_PATH[len(_media_root):].lstrip('/')
23
24
25 # here the app keeps the unmanaged (archive) files
26 try:
27     UNMANAGED_PATH = settings.ARCHIVE_UNMANAGED_PATH
28 except AttributeError:
29     UNMANAGED_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
30                         "archive/unmanaged"))
31
32
33 # here the app keeps the resulting (published) files
34 try:
35     FINAL_PATH = settings.ARCHIVE_FINAL_PATH
36 except AttributeError:
37     FINAL_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
38                         "archive/final"))
39
40
41 # here the app keeps temporary build files
42 try:
43     BUILD_PATH = settings.ARCHIVE_BUILD_PATH
44 except AttributeError:
45     BUILD_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
46                         "archive/build"))
47
48 UPLOAD_URL = getattr(
49     settings,
50     'ARCHIVE_UPLOAD_URL',
51     'audiobooks/'
52 )
53
54
55 try:
56     PROJECT = settings.ARCHIVE_PROJECT
57 except AttributeError:
58     PROJECT = u'Wolne Lektury'
59
60 try:
61     LICENSE = settings.ARCHIVE_LICENSE
62 except AttributeError:
63     LICENSE = u'http://creativecommons.org/licenses/by-sa/3.0/deed.pl'
64
65 try:
66     ORGANIZATION = settings.ARCHIVE_ORGANIZATION
67 except AttributeError:
68     ORGANIZATION = u'Fundacja Nowoczesna Polska'
69
70 try:
71     ADVERT = settings.ARCHIVE_ADVERT
72 except AttributeError:
73     ADVERT = u"""
74 Przekaż 1% podatku na rozwój Wolnych Lektur:
75 Fundacja Nowoczesna Polska
76 KRS 0000070056
77 http://nowoczesnapolska.org.pl/wesprzyj_nas/
78 """
79
80 try:
81     COVER_IMAGE = settings.ARCHIVE_COVER_IMAGE
82 except AttributeError:
83     COVER_IMAGE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'cover.png')
84