[Django] #22560: Tutorial 1/2 - CSS Problem

19 views
Skip to first unread message

Django

unread,
May 2, 2014, 5:45:18 AM5/2/14
to django-...@googlegroups.com
#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.

Django

unread,
May 2, 2014, 6:11:38 AM5/2/14
to django-...@googlegroups.com
#22560: Tutorial 1/2 - CSS Problem
-------------------------------+--------------------------------------

Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Briksins@…):

* needs_better_patch: => 0
* component: Uncategorized => Documentation
* needs_tests: => 0
* needs_docs: => 0


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/22560#comment:1>

Django

unread,
May 2, 2014, 6:12:29 AM5/2/14
to django-...@googlegroups.com
#22560: Tutorial 1/2/6 - CSS Problem
-------------------------------+--------------------------------------

Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/22560#comment:2>

Django

unread,
May 2, 2014, 6:54:10 AM5/2/14
to django-...@googlegroups.com
#22560: Tutorial 1/2/6 - CSS Problem
-------------------------------+--------------------------------------
Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by timo):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/22560#comment:3>

Django

unread,
May 2, 2014, 6:59:01 AM5/2/14
to django-...@googlegroups.com
#22560: Tutorial 1/2/6 - CSS Problem
-------------------------------+--------------------------------------
Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by anonymous):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/22560#comment:4>

Django

unread,
May 2, 2014, 7:45:59 AM5/2/14
to django-...@googlegroups.com
#22560: Tutorial 1/2/6 - CSS Problem
-------------------------------+--------------------------------------
Reporter: Briksins@… | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 1.6
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => invalid


Comment:

I think you probably made an error in following the tutorial. See
[http://stackoverflow.com/questions/10683228/how-to-do-i-resolve-resource-
interpreted-as-script-but-transferred-with-mime-ty 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
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
use our support channels] rather than this ticket tracker. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/22560#comment:5>

Reply all
Reply to author
Forward
0 new messages