@@ -32,7 +32,7 @@ and a list of valid mime types that will be allowed. The list of all mime types
32
32
here: http://www.iana.org/assignments/media-types/index.html::
33
33
34
34
from django.db import models
35
- from validatedfile import ValidatedFileField
35
+ from validatedfile.fields import ValidatedFileField
36
36
37
37
class TestModel(models.Model):
38
38
the_file = ValidatedFileField(
@@ -55,7 +55,7 @@ This example also checks the total size of all files uploaded by one user::
55
55
56
56
from django.contrib.auth.models import User
57
57
from django.db import models
58
- from validatedfile import ValidatedFileField
58
+ from validatedfile.fields import ValidatedFileField
59
59
60
60
class TestModel(models.Model):
61
61
user = models.ForeignKey(
@@ -73,7 +73,7 @@ This example also checks the total size of all files uploaded by one user::
73
73
(in forms.py)
74
74
75
75
from django import forms
76
- from validatedfile import QuotaValidator
76
+ from validatedfile.fields import QuotaValidator
77
77
from models.py import TestModel
78
78
79
79
class TestModelForm(models.ModelForm):
@@ -117,5 +117,5 @@ it depends on the software you are using. For example, if you use apache, you sh
117
117
This is a complementary measure, because you'll usually want normal users that exceed the size by a
118
118
reasonable amount to get a friendly form validation message, while attacking users will see how their
119
119
connection is abruptly cut before the file finishes uploading. So the recommended setting is to give
120
- max_upload_size a small value (e.g. 5Mb) and LimitRequestBody a higher one (e.g. 100Mb).
120
+ ` max_upload_size ` a small value (e.g. 5Mb) and ` LimitRequestBody ` a higher one (e.g. 100Mb).
121
121
0 commit comments