#22560: Tutorial 1/2 - CSS Problem -------------------------------+-------------------- Reporter: Briksins@… | Owner: nobody Type: Uncategorized | Status: new Component: Uncategorized | Version: 1.6 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+-------------------- DJango v1.6.4
Hello During implementation of tutorials (part 1/2 which are related to admin view) i spot that on the screenshots in the tutorial admin view looks nice and colored, in my case it just raw black and white (see screenshot attached) I opened Chrome browser console (F12) i spot 2 warning messages: {{{ Resource interpreted as Stylesheet but transferred with MIME type text/plain: "*localhost blah blah*/static/admin/css/base.css". localhost/:5 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "*localhost blah blah*/static/admin/css/forms.css". localhost/:6 }}} That makes me thing that CSS files were treated as simple plain text instead of CSS files - thats why admin view broken. I google how to fix it but didint find - however [https://www.google.ie/search?q=Resource+interpreted+as+Stylesheet+but+transferred+with+MIME+type+text%2Fplain&oq=Resource+interpreted+as+Stylesheet+but+transferred+with+MIME+type+text%2Fplain&aqs=chrome..69i57j0l5.6114j0j7&sourceid=chrome&es_sm=0&ie=UTF-8 there are similar problems] but with JavaScript when script treated as plain text and doesnt works all those case related to the project specific problem, however in my case im fallowing tutorial and it should work out of the box. As anotehr way of fixing it, i tried to switch off debug mode, then it tells me that cant find those files: '''Tracker things it is spam ticket - so, first part of the links are modified to "localhost blah blah"''' {{{ GET *localhost blah blah*/static/admin/css/base.css 404 (NOT FOUND) localhost/:5 GET *localhost blah blah*/static/admin/css/forms.css 404 (NOT FOUND) localhost/:6 GET *localhost blah blah*/static/admin/js/admin/RelatedObjectLookups.js 404 (NOT FOUND) (index):13 GET *localhost blah blah*/static/admin/js/core.js 404 (NOT FOUND) (index):12 GET *localhost blah blah*/static/admin/js/jquery.min.js 404 (NOT FOUND) (index):14 GET *localhost blah blah*/static/admin/js/jquery.init.js 404 (NOT FOUND) (index):15 GET *localhost blah blah*/static/admin/js/actions.min.js 404 (NOT FOUND) (index):16 GET *localhost blah blah*/static/admin/js/calendar.js 404 (NOT FOUND) (index):17 GET *localhost blah blah*/static/admin/js/admin/DateTimeShortcuts.js 404 (NOT FOUND) (index):18 GET *localhost blah blah*/static/admin/js/collapse.min.js 404 (NOT FOUND) (index):19 GET *localhost blah blah*/static/admin/js/inlines.min.js 404 (NOT FOUND) }}} I did try to create local folders set "static/admin/css" and "static/admin/js" but it also didnt work out. im new to django, and so far tutorial doesnt explain how to define static resources. I did find [https://docs.djangoproject.com/en/dev/howto/static-files/ these instructions] and was playing with it for a long time, but still didnt manage to solve my problem, those files are still missing. so the problem is not solved, and i enable debug mode back and give up fixing this problem. Would be nice if that would be fixed or what is better - tutorial will on purpose teach how to attache static files(css/img) to the project Best Regards Vadims Briksins -- Ticket URL: <https://code.djangoproject.com/ticket/22560> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/061.515878bf6e93777a6a1fd1a08e099457%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.