gc2gh / django-newsroom

Automatically exported from code.google.com/p/django-newsroom
Other
0 stars 0 forks source link

Create an uploads directory under media #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Description:

1. we should have an uploads directory under media
2. as part of the install, we should document the creation of this
directory with the appropriate permissions
3. Photologue, for instance, knows where to look for this directory

Original issue reported on code.google.com by jgty...@gmail.com on 7 Apr 2009 at 2:24

GoogleCodeExporter commented 8 years ago
All files created by the app should go in uploads/, including photologue.  So 
photologue is not doing the right 
thing when it creates media/photologue/.

Original comment by mand...@gmail.com on 7 Apr 2009 at 2:44

GoogleCodeExporter commented 8 years ago
We should probably define a setting to for this, like 

UPLOADS_PREFIX = '/some/absolute/path/dir'

Then in every model do something like this at the top:

if settings.UPLOADS_PREFIX:
   UPLOADS_PREFIX = settings.UPLOADS_PREFIX
else:
   UPLOADS_PREFIX = 'uploads' 

and reference that in the model:

class Video(Model):
      title = CharField()
      file = FileField(upload_to=UPLOAD_PREFIX+'videos/%Y/%m/%d/')
      ...

Or we might centralize this somewhere better and call a function at the to like 
UPLOAD_PREFIX = 
get_upload_prefix().  We do something like this in my_profiles/models.py, but I 
think we still want to keep 
the apps portable, so maybe Brain can weigh in on this.

Original comment by mand...@gmail.com on 7 Apr 2009 at 8:21

GoogleCodeExporter commented 8 years ago

Original comment by jgty...@gmail.com on 13 Apr 2009 at 11:11

GoogleCodeExporter commented 8 years ago
It looks like this request has been incorporated into video.

I added creating a media directory to the install docs.

The issue with photologue still needs to be looked into further.

Original comment by jgty...@gmail.com on 25 Apr 2009 at 6:20

GoogleCodeExporter commented 8 years ago

Original comment by mand...@gmail.com on 22 May 2009 at 6:54