Assuming cwd is the projects folder:

settings.py:

import os.path
MEDIA_ROOT = os.abspath('./media')

urls.py:

from django.conf import settings
urlpatterns = patterns('',
  (r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)


On Jul 20, 6:13 am, cjl <[EMAIL PROTECTED]> wrote:
> Djangoholics:
>
> I am working on a portable Django development environment for windows,
> and I'm trying to write a tutorial for newbies to go along with it.
>
> My initial -- poorly executed and incomplete -- website is 
> athttp://www.instantdjango.com
>
> One problem I am trying to overcome is how to make paths relative, as
> I want this environment to work from USB thumb drives.  Right now it
> does this by executing a stupid and simple batch file, which actually
> seems to work, for the most part.
>
> It appears that using the Django development server I can use a
> relative path for the template dir in 'settings.py', which is working
> fine.
>
> However, I am stuck on how to use relative paths for serving static
> media from the development server.
>
> Any ideas on how I might tackle this?
>
> -cjlesh


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

Reply via email to