Skip to content

Instantly share code, notes, and snippets.

@mitchtabian
Last active February 22, 2024 01:58
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mitchtabian/17d97370d92d1dfdeaca40fa94c1e227 to your computer and use it in GitHub Desktop.
Save mitchtabian/17d97370d92d1dfdeaca40fa94c1e227 to your computer and use it in GitHub Desktop.
INSTALLED_APPS = [
# My apps
'personal',
'account',
'blog',
# django apps
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'storages'
]
AUTH_USER_MODEL = 'account.Account'
AWS_ACCESS_KEY_ID = 'M5YCPZP3QT36OWMMZS23'
AWS_SECRET_ACCESS_KEY = '5Npq/S/7tX2IqBl51p3QEAMJuuGvHuFH4680Cl59M3s'
AWS_STORAGE_BUCKET_NAME = 'open-api-space'
AWS_S3_ENDPOINT_URL = 'https://nyc3.digitaloceanspaces.com'
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_LOCATION = 'open-api-static'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
STATIC_URL = 'https://%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_LOCATION)
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
@Emmanuel-Aggrey
Copy link

nice snippet

@WorldAdon
Copy link

WorldAdon commented Jun 27, 2021

when i hoste my website after hosting my static files on digitalocean spaces. images that i have used in my css file not get loaded. everything is working fine but the images that i have user in my css file as a background images not get load.
i have followed your tutorial how to host a django website with digitalocean. and everything is working perfectly insted of this one.
brilliant

can you please help me.

@WorldAdon
Copy link

i am using .scss files and to generate .css codes

@mobapps123
Copy link

how to manage media file in s3

@mobapps123
Copy link

plz write here to manage media files Sir

@mobapps123
Copy link

nice snippet

Sir How to Manage Media files Sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment