Re: Css and Images are missing

2008-11-15 Thread Luis Goncalves

Thanks so much ;)

Its working :)

--
Luis


On Nov 15, 8:10 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Sat, Nov 15, 2008 at 10:49 AM, Luis Goncalves
> <[EMAIL PROTECTED]>wrote:
>
>
>
>
>
> > Hello guys I need your help in here.
>
> > Sorry I am new in Django and I am having a problem, my css and jpgs
> > are missing.
>
> > I will write everything what i have and then maybe someone could give
> > me a hint :)
>
> > My settings.py:
> > MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/'
> > MEDIA_URL = 'http://127.0.0.1:8000/media/'
> > ADMIN_MEDIA_PREFIX = '/media/'
>
> > My urls.py:
> > (r'^media/(?P.*)', 'django.views.static.serve',{'document_root':
> > 'settings.MEDIA_ROOT'}),
>
> > And an example of base.html:
> > http://127.0.0.1:8000/media/
> > mm_health_nutr.css" type="text/css" />
> > http://127.0.0.1:8000/media/picture.jpg; alt="Header image"
> > width="382" height="101" border="0" />
>
> You've essentially got the same value for MEDIA_URL and ADMIN_MEDIA_PREFIX,
> which doesn't work 
> (see:http://docs.djangoproject.com/en/dev/ref/settings/#admin-media-prefix).  
> The
> development server has a built-in media server for admin which picks off
> anything starting with ADMIN_MEDIA_PREFIX and serves up the admin media
> files.  You've set things up so your own media files have that same prefix
> (thehttp://127.0.0.1:8000just serves to route it to a server, once at that
> server all that matters is what follows, in your case '/media/', which is
> the same as your ADMIN_MEDIA_PREFIX), so the request for your CSS, etc. are
> going to the built-in admin media server (which can't find them since it's
> looking among the admin media), not the static server.
>
> Karen
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Css and Images are missing

2008-11-15 Thread Luis Goncalves

Well i saw this:

"With that said, Django does support static files during development.
You can use the django.views.static.serve() view to serve media files.
The big, fat disclaimer¶

Using this method is inefficient and insecure. Do not use this in a
production setting. Use this only for development.

For information on serving static files in an Apache production
environment, see the Django mod_python documentation.
How to do it

Here’s the formal definition of the serve() view:

def serve(request, path, document_root, show_indexes=False):

To use it, just put this in your URLconf:

(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': '/path/to/media'}),
"
So there is support on development... And i have that on my urls.py...

So i still dont understand why doesnt work,

Thanks,

On Nov 15, 6:36 pm, Luke Seelenbinder <[EMAIL PROTECTED]> wrote:
> Django doesn't serve the media files, look 
> athttp://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs
>
> Luke
>
> On Nov 15, 10:49 am, Luis Goncalves <[EMAIL PROTECTED]> wrote:
>
> > Hello guys I need your help in here.
>
> > Sorry I am new in Django and I am having a problem, my css and jpgs
> > are missing.
>
> > I will write everything what i have and then maybe someone could give
> > me a hint :)
>
> > My settings.py:
> > MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/'
> > MEDIA_URL = 'http://127.0.0.1:8000/media/'
> > ADMIN_MEDIA_PREFIX = '/media/'
>
> > My urls.py:
> > (r'^media/(?P.*)', 'django.views.static.serve',{'document_root':
> > 'settings.MEDIA_ROOT'}),
>
> > And an example of base.html:
> > http://127.0.0.1:8000/media/
> > mm_health_nutr.css" type="text/css" />
> > http://127.0.0.1:8000/media/picture.jpg; alt="Header image"
> > width="382" height="101" border="0" />
>
> > Thanks so much for your help.
>
> > Best Regards,
>
> > Luis
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Css and Images are missing

2008-11-15 Thread Luis Goncalves

Hello guys I need your help in here.

Sorry I am new in Django and I am having a problem, my css and jpgs
are missing.

I will write everything what i have and then maybe someone could give
me a hint :)


My settings.py:
MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/'
MEDIA_URL = 'http://127.0.0.1:8000/media/'
ADMIN_MEDIA_PREFIX = '/media/'


My urls.py:
(r'^media/(?P.*)', 'django.views.static.serve',{'document_root':
'settings.MEDIA_ROOT'}),


And an example of base.html:
http://127.0.0.1:8000/media/
mm_health_nutr.css" type="text/css" />
http://127.0.0.1:8000/media/picture.jpg; alt="Header image"
width="382" height="101" border="0" />


Thanks so much for your help.

Best Regards,

Luis

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