Opened 10 years ago

Closed 10 years ago

#22560 closed Uncategorized (invalid)

Tutorial 1/2/6 - CSS Problem

Reported by: Briksins@… Owned by: nobody
Component: Documentation Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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 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 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

Attachments (1)

Admin_View_no_css.JPG (58.0 KB ) - added by Briksins@… 10 years ago.
Admin View without CSS - Screenshot

Download all attachments as: .zip

Change History (6)

by Briksins@…, 10 years ago

Attachment: Admin_View_no_css.JPG added

Admin View without CSS - Screenshot

comment:1 by Briksins@…, 10 years ago

Component: UncategorizedDocumentation

Just got to the Tutorial 6 where exactly explained how to use static files, however newly created CSS file is also give the same error in the console:

Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://localhost:8000/static/polls/style.css". 

and if turn off debug mode, static folder become not visible at all what produce the same error as in main ticket - "404 (NOT FOUND)"

comment:2 by anonymous, 10 years ago

Summary: Tutorial 1/2 - CSS ProblemTutorial 1/2/6 - CSS Problem

comment:3 by Tim Graham, 10 years ago

I cannot reproduce this. What version of Chrome are you using? Does it work in other browsers?

comment:4 by anonymous, 10 years ago

I'm using latest Chrome: Version 34.0.1847.131 m (Google Chrome is up to date.)
Also i test it in IE11 (Version: 11.0.9600.16659) - IE Console give me nearly the same error:

SEC7113: CSS was ignored due to mime type mismatch
File: style.css

comment:5 by Tim Graham, 10 years ago

Resolution: invalid
Status: newclosed

I think you probably made an error in following the tutorial. See this question on stackoverflow for an example. To debug the issue, you can try loading one of the CSS files and see what Django is actually serving. If you have problems, please use our support channels rather than this ticket tracker. Thanks.

Note: See TracTickets for help on using tickets.
Back to Top