Hm, this might be something.  I never thought of viewing the source for my
HTML page.  Actually, what I get when I do that is the following:

<link rel="stylesheet" href="stylesheet <goog_2069433266>.css"
type="text/css" />

And then when I click on the "stylesheet.css" hyperlink, I get what
looks like another source page, but this one is some kind of error
page (just to clarify in case
it's necessary, the page http://127.0.0.1:8000/view/ is the original
view my question was referring to, the one that isn't showing any of
the desired CSS):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<html lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title>Page not found at /view/stylesheet.css</title>
  <meta name="robots" content="NONE,NOARCHIVE">
</head>
<body>
  <div id="summary">
    <h1>Page not found <span>(404)</span></h1>
    <table class="meta">
      <tr>
        <th>Request Method:</th>
        <td>GET</td>
      </tr>
      <tr>
        <th>Request URL:</th>
      <td>http://127.0.0.1:8000/view/stylesheet.css</td>
      </tr>
    </table>
  </div>
  <div id="info">

      <p>
      Using the URLconf defined in <code>project.urls</code>,
      Django tried these URL patterns, in this order:
      </p>
      <ol>
 ....
(LIST OF URL PATTERNS)
.....
     </ol>
      <p>The current URL, <code>view/stylesheet.css</code>, didn't
match any of these.</p>

  </div>

  <div id="explanation">
    <p>
      You're seeing this error because you have <code>DEBUG = True</code> in
      your Django settings file. Change that to <code>False</code>, and Django
      will display a standard 404 page.
    </p>
  </div>
</body>
</html>
It looks like it's trying to open a page called
http://127.0.0.1:8000/view/stylesheet.css that I didn't include in my
URL conf.  Is this what I'm missing?  Do I need such a
page in order for Django to be able to use "stylesheet.css" while
running the dev server?  And if so, how do I create it (aside from
writing a URL pattern in the urls.py
file)?

Finally, I have another question.  In my settings.py file, there is
actually no section for TEMPLATE_CONTEXT_PROCESSORS.  I have noticed
in the documentation
that it seems like it's supposed to be in the settings.py file, but
mine doesn't have such a section (nor do I remember it ever being
there).  Should I just add it in?

thanks,
Guillaume

On Tue, Nov 22, 2011 at 6:56 PM, Ivo Brodien <[email protected]> wrote:

> Does your generated HTML source say:
>
> <link rel="stylesheet" href=“/static/stylesheet.css"
> type="text/css" />
>
> ??
>
> In your settings the TEMPLATE_CONTEXT_PROCESSORS
>
> should have:
>
> “django.core.context_processors.static”
>
> The CSS File should go into a folder: myapp/static/stylesheet.css
>
> > urlpatterns += staticfiles_urlpatterns()
>
> I think you don’t need this. If you have the static app in your
> INSTALLED_APPS, it does this for you because it overrides te runserver
> command.
>
> good luck
>
> On Nov 22, 2011, at 11:16 , Gchorn wrote:
>
> > Oh yes, I definitely have this in my INSTALLED_APPS list (as simply
> > 'myapp').  Sorry I left it out; I thought this was necessary
> > regardless of whether or not I was using static files, so I didn't
> > include it in the list of settings I changed just to enable static
> > files.   I do want to reiterate that I followed the tutorial closely
> > in creating my project so I already have pretty much anything from
> > there.
> >
> > Any other ideas?
> >
> > thanks,
> > Guillaume
> >
> > On Nov 22, 2:47 pm, Xavier Ordoquy <[email protected]> wrote:
> >> Hi,
> >>
> >>> What follows are my current settings.  In settings.py, I have:
> >>
> >>> STATIC_URL = '/static/'
> >>> INSTALLED_APPS = ('django.contrib.staticfiles',)
> >>
> >> In order to get their static files served, apps need to be listed in
> the INSTALLED_APPS list.
> >> As you don't mention it, you probably need to add myapp in the
> INSTALLED_APPS.
> >>
> >> Regards,
> >> Xavier,
> >> Linovia.
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> [email protected].
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to