[EMAIL PROTECTED] wrote:
> I uses django.views.static to serve my static files. I wrote some
> static html files and want them to be accessed from site's root, for
> example, http://127.0.0.1/file1.html http://127.0.0.1/file2.html, so I
> edit urls.py to:
> (r'^.*$', 'django.views.static.serve',
> {'document_root':'c:/htmls'}),
>
> But when I access thess files, django reports a error:
> serve() takes at least 2 non-keyword arguments (1 given)
>
> What's wrong with me? TIA.
Here's a working example from my stuff:
(r'^css/(?P<path>.*)$', 'django.views.static.serve', {'document_root':
'/home/mir/src/dj_kunde/css'}),
You need to define a parameter group for <path> in the regexp.
Michael
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---