Note that there are some explanatory texts on larger screens.

plurals
  1. PONewbie Guide For Adding CSS To Django 1.4 Templates
    primarykey
    data
    text
    <p>I'm really confused. I'm using Django 1.4 and I've been searching for this the whole day, and it seems like that everything has changed in the latest version of Django and the documentation isn't helpful at all (at least to me). Please help me attach a CSS file to my template.</p> <p>So, this is my settings.py file</p> <pre><code>STATIC_ROOT = 'F:/Django/mysite/mysite/static/' STATIC_URL = '/static/' STATICFILES_DIRS = ( "F:/Django/mysite/mysite/static/", ) </code></pre> <p>Here's my urls</p> <pre><code>from django.conf.urls.defaults import * from myste.views import hello, home from django.views.static import * from django.conf import settings urlpatterns = patterns('', ('^home/$', home) ) </code></pre> <p>This is the views</p> <pre><code>def home(request): return render_to_response('home.html', locals(),context_instance=RequestContext(request)) </code></pre> <p>And finally this is the template (home.html)</p> <pre><code>url: {{ STATIC_URL }} </code></pre> <p>Oh, and I'm not sure what I should put in my TEMPLATE_CONTEXT_PROCESSORS but this is it so far.</p> <pre><code>TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", ) </code></pre> <p>And this is the output I get when running the server</p> <pre><code>url: </code></pre> <p>I know there might be some huge mistakes in these codes, but that's because I've been reading different sources for different django versions. And yes, I've read the documentations but as I said it didn't help me that much.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload