Re: Static media in development server

2010-04-28 Thread Jonathan Hayward
I found the problem; I was trying to serve static (non-admin) media from a 'media/', and that was apparently being overridden by admin media use of the same URL. On Tue, Apr 27, 2010 at 7:53 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > Thank you; right now I am using the d

Re: Static media in development server

2010-04-27 Thread Jonathan Hayward
Thank you; right now I am using the development server (i.e. not deployed to Apache for real use). I added the FILE_UPLOAD_PERMISSIONS assignment to settings.py and can't observe a difference in behavior. On Tue, Apr 27, 2010 at 7:37 PM, Nadae Ivar Badio wrote: > Hi, > > Use this FILE_UPLOAD_PER

Re: Static media in development server

2010-04-27 Thread Nadae Ivar Badio
Hi, Use this FILE_UPLOAD_PERMISSIONS = 0600 and you have to give permissions to apache to read the file upload directory. Jonathan Hayward wrote: The file permissions are right AFAIK; the directory is mode 755 and the file 644, owned by the user running the server, so accessing and readin

Re: Static media in development server

2010-04-27 Thread Jonathan Hayward
The file permissions are right AFAIK; the directory is mode 755 and the file 644, owned by the user running the server, so accessing and reading shouldn't be a problem. Are you using Django installed through the package manager or the latest release from djangoproject.com? On Tue, Apr 27, 2010 at

Re: Static media in development server

2010-04-27 Thread Xavier Ordoquy
It is pretty much what I also have and works both on ubuntu 9.10 32 bits and osx. Did you checked that your media directory exists and lives in the same directory as the settings.py ? Also check that you have the right permissions for accessing it with the user that runs the dev server. Regard

Re: Static media in development server

2010-04-27 Thread Jonathan Hayward
Thank you! Right now, I have, in settings.py: MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media') MEDIA_URL = '/media/' And at the end of urls.py: if settings.DEBUG: urlpatterns += patterns('django.views.static', (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],),

Re: Static media in development server

2010-04-27 Thread Xavier Ordoquy
Hi, Here's something better for your dev server: from django.conf import settings if settings.DEBUG: urlpatterns += patterns('django.views.static', (r'^%s(?P.*)$' % (settings.MEDIA_URL[1:],), 'serve', { 'document_root': settings.MEDIA_ROO

Static media in development server

2010-04-27 Thread Jonathan Hayward
I'm trying to serve up media from a document_root of /media via, in urls.py: urlpatterns = patterns('', ... (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': os.path.join(os.path.dirname(__file__), 'media')}), ... It gives a "file not found" error, either this way or if