Sunday, July 31, 2011

Re: jquery

Thank You! Now I see I don't understand how can I use static files
using the development server. I saw several answers to this question
of other people but they are too breaf for me.
Books on Django I have don't explain this problem. Be so kind to
explain me.
My local computer has Windows. The project folder is c:/djangomysites/
testjquery, it contains subfolders static and templates, static
contains subfolders images and js.
Today I changed Django 1.2.3 to Django 1.3. May I consider images for
simplicity. For the same reason I don't use os function here. contains:
STATIC_URL='/static/' contains:
urlpatterns = patterns('',
(r'^', 'testjquery.views.first'),
if settings.DEBUG:
urlpatterns += patterns('',
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{ 'document_root': 'c:/djangomysites/testjquery/static' }) contains:
def first(request):
return render_to_response('index.html',

index.html contains:
<img src="{{ STATIC_URL }}images/picture.png">
As a result, I get <img src="/static/images/picture.png"> in the
produced html-file. But the image file can't be loaded.
Thank You very much!

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment