Are you using the development server, or are you running behind
apache or similar?

If the former, have you configured the development server to serve
static media?  See:

   http://docs.djangoproject.com/en/1.1/howto/static-files/

If the latter, have you configured the front end server to serve those
those directories at those urls.  This depends on the server, but
with apache you probably use an "Alias" command within your
<VirtualHost> tag (if used).  E.g.;

  Alias /media_sito/
"/home/lucak904/Scrivanai/Luca/Webframework/Jacopo/sito/sito_jacopo/media_sito/"

There may be other front end configuration to do, but if you have it
successfully
serving your admin media, it has probably been done.

Then your css should use "url(/media_sito/images/genova_3.JPG)".
You did copy, move, or link the file to your new images directory, didn't you?

You should be able to test this, in either case, by typing it's address in
your browser's location bar:

   http://dns_name_or_localhost_or_ip_address/media_sito/images/genova_3.JPG

This takes most of the custom app stuff you may be doing out of things,
and if you are using apache, Django and Python aren't involved at all.

(When this is working, you should consider putting the css in a css file,
using, for example, a class on the body tag, to select this styling.)

On Wed, Apr 28, 2010 at 11:53 AM, luca72 <lucabe...@libero.it> wrote:
> Hello and thanks for your reply i have this:
>
> MEDIA_ROOT = '/home/lucak904/Scrivania/Luca/Webframework/Jacopo/sito/
> sito_jacopo/media_sito/'
>
> MEDIA_URL = '/media_sito/'
>
> i have make u subfolder called images under media_sito, but the page
> is loaded but the image is not show, in the shell of the server i get:
>
> [28/Apr/2010 17:49:54] "GET /media_sito/images/sf300.jpg HTTP/1.1" 404
> 2032
>
> Any sugg.
>
> Thanks
> Luca
>
> On 28 Apr, 17:07, Bill Freeman <ke1g...@gmail.com> wrote:
>> url() must be given a url, not a file path.  You need to put the image
>> somewhere that is being served by apache, or by the development
>> server (usually a subdirectory of 'media/' or similar) and then use
>> the corresponding url.  For example, when running the devolopment
>> server in /home/me/djprojects/proj1 where I have my MEDIA_ROOT
>> set to '/home/me/djprojects/proj1/site_media/' and my MEDIA_URL
>> set to '/site_media/', and the image has be moved or copied to be
>> /home/me/djprojects/proj1/site_media/images/foo.jpg then the right
>> thing to put in the css is url(/site_media/images/foo.jpg) - note that
>> no quotes are used either.
>>
>>
>>
>> On Wed, Apr 28, 2010 at 10:51 AM, luca72 <lucabe...@libero.it> wrote:
>> > Hello i have a problem when i render with django a background image
>> > with css:
>> > simple css:
>>
>> > div#main {position: absolute; top: 20%; left: 20%; bottom: 0; right:
>> > 0; overflow:scroll; background-color: black; color:red; font-
>> > size:medium; font-family: TimesNR, serif; font-weight: bold;background-
>> > image: url('/home/lucak904/Scrivania/Luca/Webframework/Jacopo/
>> > genova_3.JPG');}
>>
>> > this css is in html file all the other instruction are executed, but
>> > not the backgound-image can you geve me the correct way to do it.
>>
>> > Thanks
>>
>> > Luca
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Django users" group.
>> > To post to this group, send email to django-us...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://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 django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group 
>> athttp://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 django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> 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 django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to