On Fri, Aug 21, 2015, at 14:28, Hugo Kitano wrote: > Hi, I'm a beginner with Django, and I'm trying to figure out how to > work with FieldFiles. > > One of my models has a FileField in which the user must submit a .bed > file. I use another library in python to analyze the .bed file. The > .bed file is saved to a specific directory on disk, and I want > > file_on_disk = Bed('/Users/.../media/statistics.bed') > > where statistics.bed is the name of the file, and media is the > directory all files are saved to. How would I construct this line > of code? > > Thanks! You're probably after the upload_to argument of FileField, which let you define where files are saved: https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.FileField.upload_to (I assume you're already looked into MEDIA_ROOT): https://docs.djangoproject.com/en/1.8/ref/settings/#media-root -- Hugo Osvaldo Barrera -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1440280469.1511833.363271809.356DAA81%40webmail.messagingengine.com. For more options, visit https://groups.google.com/d/optout.
Re: Working with FileFields/FieldFiles
'Hugo Osvaldo Barrera' via Django users Sat, 22 Aug 2015 14:54:46 -0700
- Working with FileFields/FieldFiles Hugo Kitano
- Re: Working with FileFields/F... 'Hugo Osvaldo Barrera' via Django users
- Re: Working with FileFiel... Hugo Kitano
- Re: Working with File... 'Hugo Osvaldo Barrera' via Django users