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

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

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

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

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.

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':

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

Re: Newbie Question: Static Media With Development Server - Not The Same Old Question

2007-07-20 Thread Nathan Ostgard
Interesting! Didn't know document_root would figure out relative paths. Glad you got it working. Re. media -- yeah, sorry about that, I've taken to renaming the admin's to media_admin. On Jul 20, 12:26 pm, cjl <[EMAIL PROTECTED]> wrote: > Nathan: > > Thank you for your reply. > > Your solution

Re: Newbie Question: Static Media With Development Server - Not The Same Old Question

2007-07-20 Thread cjl
Nathan: Thank you for your reply. Your solution seems practical, but I found another solution. In 'settings.py' I have: MEDIA_ROOT = './static/' MEDIA_URL = 'static/' and in 'urls.py' I have: (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': 'static'}), Then in the

Re: Newbie Question: Static Media With Development Server - Not The Same Old Question

2007-07-20 Thread Nathan Ostgard
at 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 developmen

Newbie Question: Static Media With Development Server - Not The Same Old Question

2007-07-20 Thread cjl
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

Re: static media using development server?

2005-11-26 Thread Igor Goryachev
On Sat, Nov 26, 2005 at 04:34:46PM -0800, hugo wrote: > >Is it possible to serve static media using internal development > >webserver and options like that: > Look into django.views.static for the "serve" view function. That one > allows you to serve files with the dev server. The following

Re: static media using development server?

2005-11-26 Thread hugo
Hi, >Is it possible to serve static media using internal development >webserver and options like that: Look into django.views.static for the "serve" view function. That one allows you to serve files with the dev server. bye, Georg

static media using development server?

2005-11-26 Thread Igor Goryachev
Hello everybody. Is it possible to serve static media using internal development webserver and options like that: MEDIA_ROOT = '/home/igor/kultprosvet.ru/media' MEDIA_URL = 'http://localhost:8080/site_media/' Any ideas? -- Igor Goryachev E-Mail/Jabber: [EMAIL PROTECTED]