Skip to content

Commit

Permalink
last
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuedappatt committed Jun 26, 2022
1 parent 03615c9 commit 04bb745
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ EMAIL_HOST_PASSWORD=qnknvpbtzfhxcacb
EMAIL_USE_TLS=True

RAZORPAY_ID=rzp_test_EsWN1MNLnJr3lq
RAZORPAY_KEY=3mB15mFeOmloSZAV5j6UPjtm
RAZORPAY_KEY=3mB15mFeOmloSZAV5j6UPjtm
AWS_ACCESS_KEY_ID =AKIAUFH6LOGOSX6MUF57
AWS_SECRET_ACCESS_KEY =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
AWS_STORAGE_BUCKET_NAME =sportsbasket
Binary file added requrirment.txt
Binary file not shown.
Binary file not shown.
Binary file modified sportsbasket/__pycache__/settings.cpython-310.pyc
Binary file not shown.
6 changes: 6 additions & 0 deletions sportsbasket/media_storages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from storages.backends.s3boto3 import S3Boto3Storage

class MediaStorage(S3Boto3Storage):

location = 'media'
file_overwrite = False
35 changes: 27 additions & 8 deletions sportsbasket/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
SECRET_KEY = config('SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG =config('DEBUG' ,default=True, cast=bool)
DEBUG =config('DEBUG' , cast=bool)

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['*']


# Application definition
Expand All @@ -45,6 +45,7 @@
'products',
'orders',
'adminz',
'storages',



Expand Down Expand Up @@ -142,11 +143,29 @@
# https://docs.djangoproject.com/en/4.0/howto/static-files/


STATIC_URL = '/static/'
STATIC_ROOT = 'staticfiles'
STATICFILES_DIRS = [
os.path.join( BASE_DIR / "static")
]
# STATIC_URL = '/static/'
# STATIC_ROOT = '/staticfiles'
# STATICFILES_DIRS = [
# os.path.join( BASE_DIR / "static")
# ]

AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('AWS_SECRET_ACCESS_KEY')
AWS_STORAGE_BUCKET_NAME = config('AWS_STORAGE_BUCKET_NAME')
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl':'max-age=86400',
}
AWS_S3_FILE_OVERWRITE = True
AWS_DEFAULT_ACL = 'public-read'
AWS_LOCATION = 'static'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATICFILES_DIRS=[
'static',
]
STATIC_URL = 'http://%s/%s/' % (AWS_S3_CUSTOM_DOMAIN, AWS_LOCATION)
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
DEFAULT_FILE_STORAGE = 'sportsbasket.media_storages.MediaStorage'

#media file confirmation email
EMAIL_BACKEND = config('EMAIL_BACKEND')
Expand All @@ -157,7 +176,7 @@
# EMAIL_HOST_USER ='vishnuedappatt@gmail.com'
# EMAIL_HOST_PASSWORD='Epunhsiv'

EMAIL_USE_TLS = config('EMAIL_USE_TLS')
EMAIL_USE_TLS = config('EMAIL_USE_TLS',cast=bool,)



Expand Down

0 comments on commit 04bb745

Please sign in to comment.