Skip to content
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

Custom root folder under S3 bucket #22

Open
jace opened this issue Mar 31, 2014 · 1 comment
Open

Custom root folder under S3 bucket #22

jace opened this issue Mar 31, 2014 · 1 comment

Comments

@jace
Copy link

jace commented Mar 31, 2014

I have a situation where having the static tree replicated directly under the S3 bucket root folder is problematic. I have a few apps that share most of their static assets via a single Blueprint (named Baseframe). To use Flask-S3 with them, I'd need to do something like this:

App1:
+- app1-static (bucket)
   +- baseframe/
   +- static/

App2:
+- app2-static (bucket)
   +- baseframe/
   +- static/

... and so on, which is less than ideal since Baseframe's (non-trivial collection of) assets are (a) being duplicated and (b) being delivered from different URLs at each site. It'll be nice if I could instead use a single bucket for all apps and have the assets stored like this (using app.name for the app static path):

App1, App2, ...:
+- all-app-static (bucket)
   +- baseframe/
   +- app1/
   +- app2/

While I could achieve this right now by having the app static path named "app1", "app2" etc, and have Flask-S3 simply replicate this, using anything other than "static" will interfere with the app's URLs when not using Flask-S3. It'll be nice if Flask-S3 can instead accept a configuration parameter for the app static path and write to that folder name.

@eriktaubeneck
Copy link
Collaborator

I think I understand what you are trying to accomplish. One solution would be to make app1 and app2 into Blueprints and setting their static folders manually. Otherwise, you can change the app's static_folder attribute and both Flask locally and Flask-S3 should follow suit. (I haven't actually tested this, so if this is not the case, then we should update it.)

Let me know if you've tried these (particularly the last option) and if that doesn't work, I think we can figure out a solution using Flask's own machinery, rather than adding another config setting to Flask-S3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants