1

I'm using django-generator and it has been working rather well.

However, on some of my machines it seems to have stopped translating url values inside CSS files. On some pages the CSS files will look like this:

background-image: url("../img/bg_icongray.png");

And on some of them they will look like this:

background-image: url("/media/img/logo_large.png?version=f764f4a8b01b957a45898cd7c065fcd61718b5ed");

Sometimes only some elements on the page will work, sometimes none of the will.

both MEDIA_DEV_MODE and DEBUG are set to True, DEV_MEDIA_URL and PRODUCTION_MEDIA_URL are both set to '/media/'. Also getting different results on different machines - behavior seems completely random.

I have nuked all of my *.pyc files and double-checked my settings.

Any suggestions on where to start looking?


Edit: As described here this has to do with django 1.4 and how runserver handles threading. This stopped being an issue if runserver is run with the --nothreading option.

NT3RP
  • 15,262
  • 9
  • 61
  • 97
Goro
  • 9,919
  • 22
  • 74
  • 108
  • Also, if you can provide the absolute path to both your CSS file and your images, it'd be great. – Chris Sep 18 '12 at 07:54

2 Answers2

1

Try setting MEDIA_ROOT to where your images are located, then in your CSS file definition use:

{{ MEDIA_URL }}logo.png

Also make sure your STATIC_URL is set appropriately.

Edit: Try also taking a look at this similar question: little link.

Community
  • 1
  • 1
Chris
  • 26,544
  • 5
  • 58
  • 71
1

if you on Chrome - use Tools-Developer console - and find what is actual url for you resource, what seems to be not loaded.

Sergey Lyapustin
  • 1,917
  • 17
  • 27