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
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,
>
>
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
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
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.
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:],),
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':
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
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
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
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
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
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
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
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]
15 matches
Mail list logo