Greg Lindstrom wrote:
> Hello Everyone-
>
> I started learning Django at PyCon in Chicago and have worked most of 
> the way through the "Django Book" and Sams "Teach Yourself Django", as 
> well as "Head First HTML with CSS and XHTML".  It's been quite a lot 
> for this old dog, but I'd like to take a crack a writing my own web 
> site using Django.  I have two problems, and I think they are 
> related.  The first is how to get images in my site and the next is 
> how to use css.
>
> I wrote Jacob about images and he was kind enough to point me to 
> documentation on how to get the web server to "serve" the images.  I 
> hate to put it this bluntly, but I don't know what that means (I've 
> been programming database applications for 20 years and all this web 
> stuff is still pretty new to me).  Is there something that explains to 
> someone like me how to get images into the site?  Though I'm running 
> Django on my Ubuntu laptop, I would like to eventually have it 
> hosted.  I would like to know how to "do" images locally, then what I 
> need to do when I host my site.
>
> The other problem is getting css to work with my site.  I have set up 
> a base.html template (I love the templates, thank-you) and extend it 
> with other templates, call one greg.html.  The html generates just as 
> I expect it to (overriding blocks just as it should), but it doesn't 
> "see" the style sheet.  One it gets "in" the template I'm OK; the 
> "Head First" book did a pretty good job explaining it.  I even put a 
> syntax error in my view  so Django would list out the settings, but 
> couldn't find where Django is looking for the css file.  I suspect it 
> is a similar problem to the images, but I just don't know.
The basic point here is that while django is good for generating dynamic 
pages which are created in code from a database, it's not so good (quick 
/ reliable / secure) for just serving static pages that don't change. So 
the preferred solution is to have django do the bit it's good at, and 
use a standard webserver to do the static pages (including images and 
css). There is a django module for serving static content, but the docs 
say this should only be used during development, not in your final site.

--~--~---------~--~----~------------~-------~--~----~
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