changeset 307 | c6bca38c1cbf |
306:5ff1fc726848 | 307:c6bca38c1cbf |
---|---|
1 import tempfile |
|
2 import os |
|
3 from django.db import models |
|
4 from django.core.files.storage import FileSystemStorage |
|
5 |
|
6 temp_storage = FileSystemStorage(tempfile.mkdtemp()) |
|
7 UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload') |
|
8 |
|
9 class FileModel(models.Model): |
|
10 testfile = models.FileField(storage=temp_storage, upload_to='test_upload') |