Remove race condition in building ebooks.
[wolnelektury.git] / src / wolnelektury / settings / static.py
1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
3 #
4 from os import path
5 from .paths import VAR_DIR
6
7 # Absolute path to the directory that holds media.
8 # Example: "/home/media/media.lawrence.com/"
9 MEDIA_ROOT = path.join(VAR_DIR, 'media/')
10 STATIC_ROOT = path.join(VAR_DIR, 'static/')
11 SEARCH_INDEX = path.join(VAR_DIR, 'search_index/')
12
13 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
14 # trailing slash if there is a path component (optional in other cases).
15 # Examples: "http://media.lawrence.com", "http://example.com/media/"
16 MEDIA_URL = '/media/'
17 STATIC_URL = '/static/'
18
19 IMAGE_DIR = 'book/pictures/'
20
21 # CSS and JavaScript file groups
22
23 PIPELINE = {
24     'STYLESHEETS': {
25         'main': {
26             # styles both for mobile and for big screen
27             'source_filenames': [
28                 'css/import/gelasio.css',
29
30                 'css/jquery.countdown.css',
31                 'jplayer/jplayer.blue.monday.css',
32
33                 'sponsors/css/sponsors.css',
34
35                 'annoy/banner.scss',
36
37                 'css/ui-lightness/jquery-ui-1.8.16.custom.css',
38
39                 'css/tlite.css',
40
41                 'scss/main.scss',
42             ],
43             'output_filename': 'css/compressed/main.css',
44         },
45         'book': {
46             'source_filenames': [
47                 'css/import/gelasio.css',
48                 'css/master.book.css',
49             ],
50             'output_filename': 'css/compressed/book.css',
51         },
52         'book_text': {
53             'source_filenames': [
54                 'css/import/gelasio.css',
55                 'scss/book_text.scss',
56                 'css/new.book.css',
57                 'annoy/banner.scss',
58                 'annoy/book_text.scss',
59
60                 'css/master.picture.css',
61             ],
62             'output_filename': 'css/compressed/book_text.css',
63         },
64         'forum': {
65             'source_filenames': [
66                 'scss/forum.scss',
67             ],
68             'output_filename': 'css/compressed/compressed/forum.css',
69         },
70         'picture': {
71             'source_filenames': [
72                 'css/import/gelasio.css',
73                 'css/master.book.css',
74                 'css/master.picture.css',
75             ],
76             'output_filename': 'css/compressed/picture.css',
77         },
78         'player': {
79             'source_filenames': [
80                 'jplayer/jplayer.blue.monday.css',
81                 'player/player.css',
82             ],
83             'output_filename': 'css/compressed/player.css',
84         },
85         'simple': {
86             'source_filenames': ('css/simple.css',),
87             'output_filename': 'css/compressed/simple.css',
88         },
89         'widget': {
90             'source_filenames': ('scss/widget.scss',),
91             'output_filename': 'css/compressed/widget.css',
92         },
93     },
94     'JAVASCRIPT': {
95         'base': {
96             'source_filenames': (
97                 'js/contrib/jquery.cycle2.min.js',
98                 'js/contrib/jquery.jqmodal.js',
99                 'js/contrib/jquery.form.js',
100                 'js/contrib/jquery.paging.min.js',
101                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
102                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
103                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
104                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
105                 'js/contrib/jquery.shorten.js',
106
107                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
108
109                 'js/contrib/tlite.min.js',
110
111                 'jplayer/jquery.jplayer.min.js',
112                 'jplayer/jplayer.playlist.min.js',
113                 'player/player.js',
114
115                 'js/locale.js',
116                 'js/dialogs.js',
117                 'js/base.js',
118                 'pdcounter/pdcounter.js',
119                 'sponsors/js/sponsors.js',
120                 'player/openplayer.js',
121                 'js/search.js',
122                 'funding/funding.js',
123                 'club/form.js',
124
125                 'annoy/banner.js',
126                 ),
127             'output_filename': 'js/base.min.js',
128         },
129         'player': {
130             'source_filenames': [
131                 'jplayer/jquery.jplayer.min.js',
132                 'jplayer/jplayer.playlist.min.js',
133                 'player/player.js',
134             ],
135             'output_filename': 'js/player.min.js',
136         },
137         'book': {
138             'source_filenames': [
139                 'js/contrib/jquery.eventdelegation.js',
140                 'js/contrib/jquery.scrollto.js',
141                 'js/contrib/jquery.highlightfade.js',
142                 'js/book_text/other.js',
143                 'js/book.js',
144
145                 'js/contrib/raphael-min.js',
146                 'js/contrib/progressSpin.min.js',
147                 'js/picture.js',
148             ],
149             'output_filename': 'js/book.min.js',
150         },
151         'book_text': {
152             'source_filenames': [
153                 'js/contrib/jquery.cycle2.min.js',
154                 'js/contrib/jquery.form.js',
155                 'js/contrib/jquery.jqmodal.js',
156                 'js/book_text/info.js',
157                 'js/book_text/menu.js',
158                 'js/book_text/note.js',
159                 'js/book_text/settings.js',
160                 'js/book_text/toc.js',
161                 'js/locale.js',
162                 'js/dialogs.js',
163                 'annoy/book_text.js',
164
165                 'js/contrib/jquery.highlightfade.js',
166                 'js/contrib/raphael-min.js',
167                 'player/openplayer.js',
168                 'js/contrib/progressSpin.min.js',
169                 'annoy/banner.js',
170             ],
171             'output_filename': 'js/book_text.js',
172         },
173         'picture': {
174             'source_filenames': [
175                 'js/picture.js',
176             ],
177             'output_filename': 'js/picture.min.js',
178         },
179         'book_ie': {
180             'source_filenames': ('js/contrib/ierange-m2.js',),
181             'output_filename': 'js/book_ie.min.js',
182         },
183         'widget': {
184             'source_filenames': (
185                 'js/contrib/jquery.js',
186                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
187                 'js/search.js',
188                 'js/widget_run.js',
189             ),
190             'output_filename': 'js/widget.min.js',
191         },
192     },
193     'CSS_COMPRESSOR': None,
194     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
195     'COMPILERS': (
196         'libsasscompiler.LibSassCompiler',
197     )
198 }
199
200 STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineCachedStorage'
201 #STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
202
203 # PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
204 # PIPELINE_PYSCSS_ARGUMENTS = ''
205
206
207 STATICFILES_FINDERS = [
208     'django.contrib.staticfiles.finders.FileSystemFinder',
209     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
210     'pipeline.finders.CachedFileFinder',
211     'pipeline.finders.PipelineFinder',
212 ]
213
214
215 from machina import MACHINA_MAIN_STATIC_DIR
216 STATICFILES_DIRS = (
217     MACHINA_MAIN_STATIC_DIR,
218 )