You cannot put images in your templates directory. You need to make a
media folder and map it properly as detailed here:

http://www.djangoproject.com/documentation/static_files/

On Feb 10, 1:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I am a bit of a newbie when it comes to Django so I apologize in
> advance. I know this is something simple I'm doing wrong but after
> hours of reading articles on the Django site and searching for answers
> I've had enough. I decided to bite the bullet and just ask :-)
>
> My problem is I went through the tutorial on the site, all worked
> first time great. Then I decided to try putting a more interesting
> template HTML page into the polls app, just for an experiment really.
> I took an XHTML/CSS design I had done for a site previously and copied
> the files into the folder where I keep the templates for the the Polls
> tutorial. Thinking all I needed to do was tell point HTTPResonse of
> the main view to the new file and it would all work. I was wrong.
>
> It loads the new HTML file fine but none of the links to images or the
> stylesheet coded in the file work. I have looked around trying to find
> what I need to do to get this working, I've moved the files around
> trying to find the right location for them, read the full Template
> guide on the Django site and even tried to see how it's done in the
> Admin HTML templates that come with Django. Nothing has worked.
>
> My site is structured like so:
> mysite - folder created by Django_Admin.py
> -------> Polls - folder contains all the .py files for the Polls app
> -------> Templates - folder containing all the HTML templates for the
> site
> ------------->Polls - folder for all the templates for Polls app
> -------------------->Images folder - contains all the images used in
> the template
> -------------------->index.html
> -------------------->screen.css
>
> The stylesheet is linked with the following syntax in the HTML
> template:
>
> <link href="screen.css" rel="stylesheet" />
>
> The links work fine when you load the HTML file in a browser so I
> assume it's something to do with the Django template settings in
> settings.py I tried experimenting with the media folder settings at
> well but I'm getting nowhere. The Django development server gives 404
> error for the stylesheet and images when I run it, just appears with
> plain HTML text.
>
> Can anyone help? It would be greatly appreciated. No doubt it will be
> something simple in the settings.
>
> Thanks in advance.
>
> Dan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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