So, why are css & js files only served with "DEBUG = yes" ?
Hello List,
I did see this discussed in #180 <https://gitlab.com/mailman/postorius/issues/180>, but I didn't quite understand if this is an issue or not.
Why is it that I can run the development server just fine.
[07/May/2017 13:23:47] "GET
/static/postorius/libs/bootstrap/css/bootstrap.min.css HTTP/1.1" 304 0
[07/May/2017 13:23:47] "GET /static/postorius/css/style.css
HTTP/1.1" 304 0
[07/May/2017 13:23:47] "GET
/static/postorius/libs/bootstrap/js/bootstrap.min.js HTTP/1.1" 304 0
[07/May/2017 13:23:47] "GET /static/django-mailman3/js/main.js
HTTP/1.1" 304 0
[07/May/2017 13:23:47] "GET
/static/postorius/libs/jquery/jquery-1.11.3.min.js HTTP/1.1" 304 0
[07/May/2017 13:23:47] "GET /static/django-mailman3/css/main.css
HTTP/1.1" 304 0
[07/May/2017 13:23:47] "GET /static/postorius/js/script.js HTTP/1.1"
304 0
[07/May/2017 13:23:47] "GET
/static/postorius/img/mailman_logo_small_trans.png HTTP/1.1" 304 0
And as soon as I comment out
# SECURITY WARNING: don't run with debug turned on in production!
# DEBUG = True
in mailman-suite/mailman-suite_project/settings.py and restart it 404s on me.
[07/May/2017 13:41:36] "GET
/static/postorius/libs/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 127
[07/May/2017 13:41:36] "GET /static/django-mailman3/css/main.css
HTTP/1.1" 404 109
[07/May/2017 13:41:36] "GET /static/postorius/css/style.css
HTTP/1.1" 404 104
[07/May/2017 13:41:36] "GET /static/django-mailman3/js/main.js
HTTP/1.1" 404 107
[07/May/2017 13:41:36] "GET
/static/postorius/libs/bootstrap/js/bootstrap.min.js HTTP/1.1" 404 125
[07/May/2017 13:41:36] "GET
/static/postorius/libs/jquery/jquery-1.11.3.min.js HTTP/1.1" 404 123
[07/May/2017 13:41:36] "GET /static/postorius/js/script.js HTTP/1.1"
404 103
[07/May/2017 13:41:36] "GET
/static/postorius/img/mailman_logo_small_trans.png HTTP/1.1" 404 123
So the choice is insecure vs. ugly? Neither of those sounds very tempting.
I guess, I am missing something, or no?
Simon
js and css files are static and should be served by your web server of choice. In a development environment you usually don't have a web server running, so django serves the files itself.
Your webserver can serve these static files much faster than django can, so django doesn't serve them in production by default. You can find instructions on how to do so online (Google is your friend) but since that's not incouraged there is no point in including these in the repos.
Simon
Am 7. Mai 2017 16:06:17 MESZ schrieb Simon Liebold via Mailman-users <mailman-users@mailman3.org>:
Hello List,
I did see this discussed in #180 <https://gitlab.com/mailman/postorius/issues/180>, but I didn't quite understand if this is an issue or not.
Why is it that I can run the development server just fine.
[07/May/2017 13:23:47] "GET /static/postorius/libs/bootstrap/css/bootstrap.min.css HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/css/style.css HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/libs/bootstrap/js/bootstrap.min.js HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/django-mailman3/js/main.js HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/libs/jquery/jquery-1.11.3.min.js HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/django-mailman3/css/main.css HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/js/script.js HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/img/mailman_logo_small_trans.png HTTP/1.1" 304 0
And as soon as I comment out
# SECURITY WARNING: don't run with debug turned on in production! # DEBUG = True
in mailman-suite/mailman-suite_project/settings.py and restart it 404s on me.
[07/May/2017 13:41:36] "GET /static/postorius/libs/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 127 [07/May/2017 13:41:36] "GET /static/django-mailman3/css/main.css HTTP/1.1" 404 109 [07/May/2017 13:41:36] "GET /static/postorius/css/style.css HTTP/1.1" 404 104 [07/May/2017 13:41:36] "GET /static/django-mailman3/js/main.js HTTP/1.1" 404 107 [07/May/2017 13:41:36] "GET /static/postorius/libs/bootstrap/js/bootstrap.min.js HTTP/1.1" 404 125 [07/May/2017 13:41:36] "GET /static/postorius/libs/jquery/jquery-1.11.3.min.js HTTP/1.1" 404 123 [07/May/2017 13:41:36] "GET /static/postorius/js/script.js HTTP/1.1" 404 103 [07/May/2017 13:41:36] "GET /static/postorius/img/mailman_logo_small_trans.png HTTP/1.1" 404 123
So the choice is insecure vs. ugly? Neither of those sounds very tempting.
I guess, I am missing something, or no?
Simon
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Am 07.05.2017 um 16:12 schrieb Simon HANNA:
js and css files are static and should be served by your web server of choice. In a development environment you usually don't have a web server running, so django serves the files itself.
Your webserver can serve these static files much faster than django can, so django doesn't serve them in production by default. You can find instructions on how to do so online (Google is your friend) but since that's not incouraged there is no point in including these in the repos. Thanks, this answers my question. Simon Good name.
Simon
js and css files are static and should be served by your web server of choice.
Actually, Python is able to do this very nicely and quickly these days. I've started using WhiteNoise (added as a django staticfiles provider) which does all the right things for you directly (uses sendfile, sets cache headers, does compression correct, all real work done at initialization time, if you best speed just add CDN, etc etc). It might be something to make MM3 setup a bit nicer and quicker (note, I still haven't migrated to MM3 so don't know much about it);
A point against it is an extra dependency ofc.
Odin
2017-05-07 15:12 GMT+01:00 Simon HANNA <simon.hanna@serve-me.info>:
js and css files are static and should be served by your web server of choice. In a development environment you usually don't have a web server running, so django serves the files itself.
Your webserver can serve these static files much faster than django can, so django doesn't serve them in production by default. You can find instructions on how to do so online (Google is your friend) but since that's not incouraged there is no point in including these in the repos.
Simon
Am 7. Mai 2017 16:06:17 MESZ schrieb Simon Liebold via Mailman-users < mailman-users@mailman3.org>:
Hello List,
I did see this discussed in #180 <https://gitlab.com/mailman/postorius/issues/180>, but I didn't quite understand if this is an issue or not.
Why is it that I can run the development server just fine.
[07/May/2017 13:23:47] "GET /static/postorius/libs/bootstrap/css/bootstrap.min.css HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/css/style.css HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/libs/bootstrap/js/bootstrap.min.js HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/django-mailman3/js/main.js HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/libs/jquery/jquery-1.11.3.min.js HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/django-mailman3/css/main.css HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/js/script.js HTTP/1.1" 304 0 [07/May/2017 13:23:47] "GET /static/postorius/img/mailman_logo_small_trans.png HTTP/1.1" 304 0
And as soon as I comment out
# SECURITY WARNING: don't run with debug turned on in production! # DEBUG = True
in mailman-suite/mailman-suite_project/settings.py and restart it 404s on me.
[07/May/2017 13:41:36] "GET /static/postorius/libs/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 127 [07/May/2017 13:41:36] "GET /static/django-mailman3/css/main.css HTTP/1.1" 404 109 [07/May/2017 13:41:36] "GET /static/postorius/css/style.css HTTP/1.1" 404 104 [07/May/2017 13:41:36] "GET /static/django-mailman3/js/main.js HTTP/1.1" 404 107 [07/May/2017 13:41:36] "GET /static/postorius/libs/bootstrap/js/bootstrap.min.js HTTP/1.1" 404 125 [07/May/2017 13:41:36] "GET /static/postorius/libs/jquery/jquery-1.11.3.min.js HTTP/1.1" 404 123 [07/May/2017 13:41:36] "GET /static/postorius/js/script.js HTTP/1.1" 404 103 [07/May/2017 13:41:36] "GET /static/postorius/img/mailman_logo_small_trans.png HTTP/1.1" 404 123
So the choice is insecure vs. ugly? Neither of those sounds very tempting.
I guess, I am missing something, or no?
Simon
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Beste helsing, Odin Hørthe Omdal <odin.omdal@gmail.com> English, technical: http://tech.velmont.net Norsk, personleg: http://velmont.no
participants (3)
-
Odin Hørthe Omdal
-
Simon HANNA
-
Simon Liebold