Re: images in a template

2011-03-27 Thread Vladimir
I have found a solution but it's very strange! Remind I use Django 1.2.5, development web server, Windows 7. Project level (named galiontours) urls.py: import os from django.conf.urls.defaults import * from galiontours.galion import views from galion.views import index from galiontours import setti

Re: images in a template

2011-03-19 Thread Sultan Imanhodjaev
The piece of code below from my own development stack ( r'^static/(?P.*)$', serve, {'document_root': '%s/../static' % (APPLICATION,)} ) On Sat, Mar 19, 2011 at 10:42 PM, Vladimir wrote: > Thank You, Sultan! > Search "django.views.static.serve" for Django 1.2 in > http://docs.djan

Re: images in a template

2011-03-19 Thread Vladimir
Thank You, Sultan! Search "django.views.static.serve" for Django 1.2 in http://docs.djangoproject.com/ gives nothing. I failed to get any from Your answer, because I'm a beginner, You see. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: images in a template

2011-03-19 Thread Sultan Imanhodjaev
Hello, Sometimes for unknown reason I've to use a small workaround while developing from django.views.static import serve and then just use serve itself url((r'^site_media/(?P.*)$', serve, {'document_root': settings.STATIC_DOC_ROOT}), 2011/3/19 Vladimir > Большое спасибо, Артем, за до

Re: images in a template

2011-03-19 Thread Vladimir
Большое спасибо, Артем, за добрый совет, сразу моя ошибка прояснилась! У меня есть Подробное руководство А.Головатого и Д.Каплан-Мосса (2010), и книга Дж.Форсье, П.Биссекса и У.Чана (2010). Руководство на сайте Django я тоже стараюсь читать вдумчиво. Не ожидаю, что за меня все сделают. Пока осваива

Re: images in a template

2011-03-19 Thread Vladimir
Thank You very much, Daniel ! I try to follow every advice of You and Mike. > So you put the image in the media directory. In a project directory 'galiontour' I created a subdirectory 'media' and placed 'galion.gif' into it. Index.html was placed into application level directory 'galion'. > Then

Re: images in a template

2011-03-19 Thread Vladimir
> unmatched parentheses `url((` should be `url(` Thank You very much, Mike! -- 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 django

Re: images in a template

2011-03-19 Thread Artem
Почемуб тебе сначала не разобратся как и что работает, и не задавать глупых вопросов, за тебя всеравно все не сделают. Почитай (вдумчиво) книжки и туторы по джанге, например мне сам больше помогла разобратся "Beginning Django E-Commerce [Jim McGaw] (2009)" -- You received this message because you

Re: images in a template

2011-03-19 Thread Mike Ramirez
On Saturday, March 19, 2011 05:37:04 am Vladimir wrote: > url((r'^site_media/(?P.*)$', 'django.views.static.serve', > {'document_root': settings.STATIC_DOC_ROOT}), unmatched parentheses `url((` should be `url(` Mike -- Program load too heavy for processor to lift. -- You receive

Re: images in a template

2011-03-19 Thread Daniel Roseman
On Saturday, March 19, 2011 12:54:22 PM UTC, Vladimir wrote: > > Daniel, I understand that's a wrong idea to mix files of different > nature in one directory. I only showed that one and the same simple > (?) configuration: index.html plus image file does works when I call > index.html directly a

Re: images in a template

2011-03-19 Thread Vladimir
Daniel, I understand that's a wrong idea to mix files of different nature in one directory. I only showed that one and the same simple (?) configuration: index.html plus image file does works when I call index.html directly and doesn't work when I call it in Django style. Of cource, this is a resul

Re: images in a template

2011-03-19 Thread Vladimir
1. I have read this article before. I think this instruction teaches us how we can access files in this directory. My problem differs: I can't include this files into index.html. 2. I don't understand why shall I create STATIC_DOC_ROOT, MEDIA_ROOT is already exists. 3. I failed following this artic

Re: images in a template

2011-03-19 Thread Daniel Roseman
On Saturday, March 19, 2011 9:44:41 AM UTC, Vladimir wrote: > > It does not work. If I call index.html which contains > #title h1{ background-image: url(galion.gif); background-position: > left top; background-repeat: no-repeat; } > directly in web browser then image is displayed. > If I ca

Re: images in a template

2011-03-19 Thread Mike Ramirez
On Saturday, March 19, 2011 02:44:41 am Vladimir wrote: > It does not work. If I call index.html which contains > #title h1{ background-image: url(galion.gif); background-position: > left top; background-repeat: no-repeat; } > directly in web browser then image is displayed. > If I call it: > h

Re: images in a template

2011-03-19 Thread Vladimir
It does not work. If I call index.html which contains #title h1{ background-image: url(galion.gif); background-position: left top; background-repeat: no-repeat; } directly in web browser then image is displayed. If I call it: http://localhost:8000/index/ then image is not displayed. Note, for s

Re: images in a template

2011-03-18 Thread Mike Ramirez
On Friday, March 18, 2011 11:12:52 pm Vladimir wrote: > Thank You very much! > I found one more mistake, I need to replace in views.py: > from django.template import loader, Context > with > from django.template import RequestContext > > Now there is no syntax mistake but there is no image. How ma

Re: images in a template

2011-03-18 Thread Vladimir
Thank You very much! I found one more mistake, I need to replace in views.py: from django.template import loader, Context with from django.template import RequestContext Now there is no syntax mistake but there is no image. How many other mistakes I have done? -- You received this message becaus

Re: images in a template

2011-03-18 Thread Mike Ramirez
On Friday, March 18, 2011 10:39:18 pm Vladimir wrote: > return > render_to_response('index.html',,context_instance=RequestContext(request)) > > Such version lead to an error message: SyntaxError at/index/ , invalid > syntax (views.py, line 5) > What are my mistakes please? xtra comma in rend

images in a template

2011-03-18 Thread Vladimir
I have read several answeres to similar questions but didn't understand enough. Like others I need to use CSS external file, images and background images. At the beginning I try to use images. 0) I use Django 1.2.5 and development web server. 1) I inserted to setting.py (there was not this paramete