-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work with S3 #171
Comments
I'm having a similar problem, for some reason I don't think collectstatic is copying the CSS files to the S3 bucket. I'm experiencing it with Google cloud storage, but the same behavior. |
I am using Digital Ocean Space -- Not working also. Any ideas anyone? |
Just so you know, I was having a problem with deploying via the @anefta I skimmed your config, it looked ok to me. What do the "inspector" or developer tools in your browser tell you is happening ? |
@KWTechKevin did you ever resolve this issue? I've been using this library with S3 as my static file storage and it has been working really well. The only thing that I've had to do is ensure that I both build and collect static on my prod instance which updates the S3 locations. |
Nope, never did manage to resolve it. Ended up decoupling the application. |
Tailwind fails to load when static files are handled through S3. All html are rendered without css.
Relevant settings are as follows
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
#css stuff
TAILWIND_APP_NAME = 'theme'
#node
NPM_BIN_PATH = '/usr/local/bin/npm'
#S3 stuff
import os
AWS_ACCESS_KEY_ID = 'XXXX'
AWS_SECRET_ACCESS_KEY = 'XXXX'
AWS_STORAGE_BUCKET_NAME = 'XXX-static'
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
AWS_DEFAULT_ACL = 'public-read'
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_QUERYSTRING_AUTH = False
AWS_HEADERS = {
'Access-Control-Allow-Origin': '*',
}
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
AWS_LOCATION = 'static'
AWS_MEDIA = 'media'
STATIC_URL = 'https://%s/%s/' % (AWS_S3_CUSTOM_DOMAIN, AWS_LOCATION)
MEDIA_URL = 'https://%s/%s/' % (AWS_S3_CUSTOM_DOMAIN, AWS_MEDIA)
#STATIC_URL = 'theme/static/'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' #media
#end S3 stuff
My pip is as follows:
pip freeze
arrow==1.2.3
asgiref==3.7.2
binaryornot==0.4.4
boto3==1.26.150
botocore==1.29.150
certifi==2023.5.7
chardet==5.1.0
charset-normalizer==3.1.0
click==8.1.3
cookiecutter==2.1.1
Django==4.2.1
django-appconf==1.0.5
django-browser-reload==1.9.0
django-storages==1.13.2
django-tailwind==3.5.0
gunicorn==20.1.0
idna==3.4
Jinja2==3.1.2
jinja2-time==0.2.0
jmespath==1.0.1
mariadb==1.1.6
MarkupSafe==2.1.3
mysqlclient==2.1.1
packaging==23.1
Pillow==9.5.0
python-dateutil==2.8.2
python-slugify==8.0.1
PyYAML==6.0
rcssmin==1.1.1
requests==2.31.0
rjsmin==1.2.1
s3transfer==0.6.1
six==1.16.0
sqlparse==0.4.4
text-unidecode==1.3
typing_extensions==4.6.3
urllib3==1.26.16
uWSGI==2.0.21
The text was updated successfully, but these errors were encountered: