I'm attempting to use http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html for serving both static files and uploaded media, but I'm not certain it's possible. Is there a documented way that I'm missing? Also, I would assume (hope) that you could configure a separate bucket for each, but I can't find any info on that.
How can I use django-storages for both media and static files?
2.5k Views Asked by Johnny 5 At
1
There are 1 best solutions below
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in DJANGO
- Display images on Django Template Site
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Django invalid literal for int() with base 10:
- Removing URL features from tokens in NLTK
- Django Noob URL to from Root Page to sub Page
- Django Admin tables not displaying correctly
- Django with chartkick
- Django urls.py not rendering correct template
- django form errors before submit
- django admin: custom app_index with context
- Display multiple models in one view in Django
- Unexpected NoReverseMatch error when using include() in urls patterns
- Search for a key in django.core.cache
- Django webapp (on an Apache2 server) hangs indefintely when importing nltk in views.py
- Django flush won't load fixtures
Related Questions in AMAZON-S3
- Convert JSON.gz to JSON in node js
- Downloading objects from S3 with presigned URL
- "Access Denied" - User's Permissions to S3 Bucket
- jQuery file upload to S3 (and rails) with CORS headers
- copying file from local machine to Ubuntu 12.04 returning permission denied
- AWS Flow Framework: Can we run activity worker and activity task on different EC2 instances
- Unable to access files from public s3 bucket with boto
- s3cmd not working as cron-task when echos/dates are added
- AWS S3 object listing
- React-native upload image to amazons s3
- S3 restrictions on quantity of object downloads
- How to upload a photo in Meteor to S3 and have it sync to database item?
- Limit upload size to S3 with presigned URL
- dragonfly-s3 with S3 IAM user causing a forbidden 403 response from Amazon
- Split S3 files into multiple output files
Related Questions in DJANGO-STORAGE
- S3BotoStorage and Unit Testing
- Django won't serve static files from Amazon S3 with custom domain
- Connection reset by peer when using s3, boto, django-storage for static files
- Django-compressor on s3 does not recognize and copy updated files
- Django local version using remote static files despite local settings
- How can I use django-storages for both media and static files?
- AWS is out of sync with Israeli time - causing security errors
- Django using FTP for large files
- Django copy pdf to s3bucket
- Attribute Error when running collectstatic for Django app
- Django CSS Background Image using STATIC_URL
- Git deleting things mysteriously (edit: actually django-storages)
- Where should I store user uploaded pics and files
- How can I upload images to amazon S3 with django-storages? Uploading in admin works but in the website form does not
- changing django-storages backend from from s3 to cloudfiles and dealing with old files
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Yes this is possible by configuring both
DEFAULT_FILE_STORAGEandSTATICFILES_STORAGEto use the S3 storage. However if you setthen these will both use the default settings for the S3 storage, meaning they will both use the
AWS_STORAGE_BUCKET_NAMEbucket. The way to work around this is to create a small subclass ofS3BotoStoragein your project which uses a different setting for the bucket name.You would then define the
AWS_STATIC_BUCKET_NAMEsetting to be whatever you want for your static bucket and changeAWS_STATIC_BUCKET_NAMEto the path for this custom storage class.If you wanted to change other settings such as
AWS_QUERYSTRING_AUTH,AWS_S3_CUSTOM_DOMAIN,AWS_PRELOAD_METADATA, etc then you would change them in this subclass as well.