File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 156156USE_TZ = True
157157
158158
159- # Static files (CSS, JavaScript, Images)
160- # https://docs.djangoproject.com/en/3.0/howto/static-files/
161-
162- STATIC_ROOT = os .path .join (BASE_DIR , "staticfiles" )
163- STATIC_URL = "/static/"
164- STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
165-
166159REST_FRAMEWORK = {
167160 "EXCEPTION_HANDLER" : "styleguide_example.api.exception_handlers.drf_default_with_modifications_exception_handler" ,
168161 # 'EXCEPTION_HANDLER': 'styleguide_example.api.exception_handlers.hacksoft_proposed_exception_handler',
Original file line number Diff line number Diff line change 33from config .env import BASE_DIR , env , env_to_enum
44from styleguide_example .files .enums import FileUploadStorage , FileUploadStrategy
55
6+
7+ # Static files (CSS, JavaScript, Images)
8+ # https://docs.djangoproject.com/en/3.0/howto/static-files/
9+ STATIC_ROOT = os .path .join (BASE_DIR , "staticfiles" )
10+ STATIC_URL = "/static/"
11+ STORAGES = {
12+ "default" : {
13+ "BACKEND" : "django.core.files.storage.FileSystemStorage" ,
14+ },
15+ "staticfiles" : {"BACKEND" : "whitenoise.storage.CompressedManifestStaticFilesStorage" },
16+ }
17+
18+
619FILE_UPLOAD_STRATEGY = env_to_enum (FileUploadStrategy , env ("FILE_UPLOAD_STRATEGY" , default = "standard" ))
720FILE_UPLOAD_STORAGE = env_to_enum (FileUploadStorage , env ("FILE_UPLOAD_STORAGE" , default = "local" ))
821
1629if FILE_UPLOAD_STORAGE == FileUploadStorage .S3 :
1730 # Using django-storages
1831 # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html
19- DEFAULT_FILE_STORAGE = " storages.backends.s3boto3.S3Boto3Storage"
32+ STORAGES [ "default" ] = { "BACKEND" : " storages.backends.s3boto3.S3Boto3Storage"}
2033
2134 AWS_S3_ACCESS_KEY_ID = env ("AWS_S3_ACCESS_KEY_ID" )
2235 AWS_S3_SECRET_ACCESS_KEY = env ("AWS_S3_SECRET_ACCESS_KEY" )
Original file line number Diff line number Diff line change 11from django .db import models
2- from django .db .models . query import F , Q
2+ from django .db .models import F , Q
33from django .utils import timezone
44
55
Original file line number Diff line number Diff line change 11from uuid import uuid4
22
33from django .db import models
4- from django .db .models . query import F , Q
4+ from django .db .models import F , Q
55
66
77class School (models .Model ):
Original file line number Diff line number Diff line change 22from typing import Optional
33
44from django .core .exceptions import ValidationError
5- from django .db .models . query import Q , QuerySet
5+ from django .db .models import Q , QuerySet
66
77from styleguide_example .testing_examples .models import School , SchoolCourse
88
You can’t perform that action at this time.
0 commit comments