Re: serving a static file via nginx requiring authentication from django

2009-06-29 Thread John Hensley
On 6/28/09 10:20 PM, Annie wrote: > I'm trying to this to work: users can download their files from their > account page from a url like this: > http://example.com/account/download/a1234565789asedga-2/ > for which django processes the authentication and then passes along > the info to nginx to

Re: Sending attachments with django-contact-form

2009-03-16 Thread John Hensley
On Mar 16, 2009, at 3:46 PM, Dana wrote: > I am wondering what the simplest way to send an attachment with > django- > contact-form (http://code.google.com/p/django-contact-form/) is. [...] > Im interested in just a simple example of sending a file along with > the other email information. I

Re: Static file serve with prior authentication?

2009-02-25 Thread John Hensley
On Feb 23, 2009, at 5:20 PM, Graham Dumpleton wrote: > The approach for mod_python documented in that link, and equivalent > for mod_wsgi, are only good for HTTP Basic authentication, it is no > good if you want the page to be authenticated using HTML form/cookie > based authentication as Django

Re: sending large downloads

2008-06-25 Thread John Hensley
If it doesn't require authorization (seems unlikely here), would a simple redirect to the tar file work? If it does, look into X-Sendfile if you're using Apache (you need mod_xsendfile) or lighty, or X-Accel-Redirect under nginx. You do only what you need to in the Django view and hand off

Re: Sorl Thumbnails Directory Permissions

2008-05-28 Thread John Hensley
Try 770 with the directory's group set to the effective group of the Apache process. If you need to get even finer, look into mod_wsgi's daemon mode, or FastCGI, under either of which your Django app could run as its own user. Then you could ratchet the directory permissions down to 700

Re: Ordering extra fields in ModelForm

2008-05-21 Thread John Hensley
http://code.djangoproject.com/wiki/CookBookNewFormsFieldOrdering On May 21, 2008, at 8:15 AM, omat wrote: [...] > My form class is like that: > > class NoteForm(forms.ModelForm): >is_location = forms.BooleanField(required=False) > >class Meta: >model = Note > > I wish this

Re: Secure file access with contrib.auth

2008-05-19 Thread John Hensley
On May 19, 2008, at 4:18 AM, Julien wrote: > I installed mod_xsendfile and I tried your code, but the file that's > downloaded from the view is empty. > This might be because I've tested it using the development server on > port 8080. So I guess Apache is out of the loop :/ Yes, this approach

Re: Secure file access with contrib.auth

2008-05-17 Thread John Hensley
You can do this with Apache. You need to add mod_xsendfile (http://tn123.ath.cx/mod_xsendfile/ ) to your Apache config, then control access to the files with a Django view. A quick search of this group turns up references to mod_xsendfile, but no example view, so here's what it might look

Re: How best to place multiple orders from same screen?

2008-05-17 Thread John Hensley
Malcolm has a good how-to for this: http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/ On May 17, 2008, at 12:16 PM, Kenneth McDonald wrote: > I'm designing an order system wherein each order will be an object. > However, most customers will typically want to order more than

Re: Patch #2070, progress bar and form view. Can't make it work.

2008-05-03 Thread John Hensley
The handling of the POST request is typical. I don't know what your model class looks like, but the could look something like this: form = UploadForm(request.POST, request.FILES) if form.is_valid(): instance = ModelClassWithFileField() instance.uploaded_by = request.user

Re: Javascript GUI Editor that works with Django templates

2008-04-22 Thread John Hensley
On Apr 21, 2008, at 10:44 PM, blis102 wrote: > p.s. FCKeditor's connector feature, which allows you to browse your > server to insert images, files, and flash, is highly useful, although > I have not gotten to get it to work with django yet. There is a google > code project called fckconnector