Wierd FileField behavior
Hi, I have a simple profile model which includes the option to upload a File (FileField) and a photograph (ImageField). These two fields show somewhat undesirable behavior: (1) Let's say I create a profile and upload a photo through the admin. (2) My member view page shows my photo and other profile details. (3) Then let's say I go back to change something in my address field. The filefield correctly shows the "current file" which I uploaded in (1). I make no other changes and hit Save (4) I reload my member view page. Now the link to my photograph is broken.. (photo doesn't exist) (5) I go back into admin and find there's no photograph associated with my profile. Why does it do this? Is there no way to fix this? Am I doing something wrong? Do I need to upload a file to the database and have it only store a FilePathField? Is there a workaround? Thanks --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: media-serving hell!
Quick update: I can see the directory listing under http://mydomain.com/media/ On Jan 30, 10:22 am, DrKayBee <bhalera...@gmail.com> wrote: > I'm having a ridiculously tough time trying to figure out how to serve > static media. Here's the state of the website: > Templates being found properly (although without css / static media) > Admin template being found properly (again without css / etc) > > Here's my directory structure for the project: > > /home/path/to/my/project/ > ---> application/ > ---> Media/ (Static files directory) > default.css > *.img etc > ---> admin/ > ---> media/ ---symlink--> /usr/lib/..contrib/ > admin/media/ > |> css/ js/ img/ (through symlinks) > > templates/ > manage / settings / urls.py files > > Here's my httpd.conf > > SetHandler python-program > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE project.settings > SetEnv PYTHON_EGG_CACHE "/var/cache/www/pythoneggs" > PythonDebug On > PythonOption django.root /project > PythonPath "['/home/path/to/project/'] + sys.path" (sanitized link) > > > > SetHandler None > > > > SetHandler None > > ___ > > and here's my settings.py symbols > MEDIA_ROOT = '/home/path/to/project/Media/' (sanitized) > MEDIA_URL = '/media/' (# does this need to be an absolute url?) > ADMIN_MEDIA_PREFIX = '/admin/media/' > > So where am I messing up? > Your response is much appreciated. Thanks! --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
media-serving hell!
I'm having a ridiculously tough time trying to figure out how to serve static media. Here's the state of the website: Templates being found properly (although without css / static media) Admin template being found properly (again without css / etc) Here's my directory structure for the project: /home/path/to/my/project/ ---> application/ ---> Media/ (Static files directory) default.css *.img etc ---> admin/ ---> media/ ---symlink--> /usr/lib/..contrib/ admin/media/ |> css/ js/ img/ (through symlinks) templates/ manage / settings / urls.py files Here's my httpd.conf SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE project.settings SetEnv PYTHON_EGG_CACHE "/var/cache/www/pythoneggs" PythonDebug On PythonOption django.root /project PythonPath "['/home/path/to/project/'] + sys.path" (sanitized link) SetHandler None SetHandler None ___ and here's my settings.py symbols MEDIA_ROOT = '/home/path/to/project/Media/' (sanitized) MEDIA_URL = '/media/' (# does this need to be an absolute url?) ADMIN_MEDIA_PREFIX = '/admin/media/' So where am I messing up? Your response is much appreciated. Thanks! --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Embed HTML snippets through django
Thanks! Thanks helps. On Jan 26, 10:15 pm, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Mon, 2009-01-26 at 19:27 -0800, DrKayBee wrote: > > Hi, > > I am creating a small website, where I would like to provide users > > with a database field (through admin) where they can enter a link to > > their public google calendar (This is an tag). > > > Obviously, if I just write it to a django template like so: > > {{ user.CalendarLink }} - it just puts the verbatim text - i.e. not > > the markup language. Is there a way to inject raw html into a django > > template? I realize it is a bit unsafe - but this is not going to be a > > public website. > > Templates render whatever you pass to them. Read up on autoescaping > first, though, which might be what you're talking about if you think > this is, in some way, not possible. Unless you tell the template that > the variable it's rendering is "safe" for direct rendering, it will > apply autoescaping. > > Read about the "autoescape" template tag and, more importantly, the > "safe" filter in the Django template documentation. > > Regards, > Malcolm --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Embed HTML snippets through django
Hi, I am creating a small website, where I would like to provide users with a database field (through admin) where they can enter a link to their public google calendar (This is an tag). Obviously, if I just write it to a django template like so: {{ user.CalendarLink }} - it just puts the verbatim text - i.e. not the markup language. Is there a way to inject raw html into a django template? I realize it is a bit unsafe - but this is not going to be a public website. Thanks! --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
a different kind of file path field
Hi, I'm creating a task journal using django for personal use. I'm creating an application wherein I require a CharField to store a file location on a local drive. This is different from the FileField, since I do not want to 'upload' the file to any different location on my local drive, just to record a file url. What field must I use for this? The FilePathField doesn't work for me because I want the absolute location of the file to be user selectable, not restricted to a pre-determined location. Ideally I would like a file chooser dialog. Do I need to create my own field or is there something I'm missing? Thanks! --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---