If I add few files in a new skin, like logo and css files. If I run everything under django, well my new media files are preferred over the ones in default skin and everything else is picked from the default skin. Some Python code imports all of that as I have looked.

Now the question is, if I get nginx to serve the media files, how would that work? Do I have to manually overwrite the media files I want modified, over top of the existing one?

asked 15 Jul '11, 16:22

Valentino%20Lee's gravatar image

Valentino Lee
1112
accept rate: 0%

@Valentino Lee, we require all postings to have a clear, specific QUESTION in the title field. Please edit this right away to rephrase the title as a proper question.

(18 Jul '11, 09:28) rickross ♦♦

Apparently, it should work ok, as long as you don't link to those files directly.

I think this is how it should work in theory:

In your template, you should invoke the inclusion of the css, like this:

 <link href="{% media custom_css %}" rel="stylesheet" type="text/css" />

And NOT like this:

<link href="/m/mytheme/css/mycss.css" rel="stylesheet" type="text/css" />

As long as you use that {% url custom_css %} tag, then the Django that generates the page should automagically choose your skin css file first, if it's available, and then fall back to the default one.

NB I haven't checked this. I just copied the whole skin over, and then modified it. But if the above method works, I'd recommend doing that instead.

link

answered 16 Jul '11, 01:24

Andrew_S's gravatar image

Andrew_S ♦
5.6k45674
accept rate: 21%

edited 18 Jul '11, 06:56

Not the url tag, its media. That custom_css url points to the file generated bases on your custom css setting. Take a look at base_content.html and see for example:

<link href="{% media  "/media/style/style.css" %}" rel="stylesheet" type="text/css" />
(17 Jul '11, 17:25) Hernani Cerq... ♦♦

Thanks Hernani - I've corrected my answer accordingly. That might explain a few things - I don't know how my custom skin got de-synced from the trunk - I must have botched one of the merges - but I'll fix my custom skin, and see what happens.

(18 Jul '11, 06:57) Andrew_S ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×45
×29
×5
×3

Asked: 15 Jul '11, 16:22

Seen: 518 times

Last updated: 18 Jul '11, 09:28

powered by OSQA