-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add support for than app.py #21
Comments
I'm looking forward to this feature. |
Awesome feature. Basically you can handle other files by using boto3 with S3 buckets (for the configuration files, for example), but it would be awesome if chalice could handle it (deploy other files in buckets) by itself (despite it would conflict with the intention of being a micro framework). |
Please, please make this work! |
What about allowing multiple files to be split up into multiple Lambda functions - There is requirements for multiple functions for one API project that this would fulfill |
I really liked the idea of chalice, but wanted to use it with a more complex package than I was comfortable wedging all into
a To get new code into the lambda deploy is a little tricker since it tries to use the 'replace app.py in the zip file' strategy. So a little
So when changes are made in |
I like the idea of Chalice. Keep on the good work. Chalice should follow as closely Flask as possible to enable running the same project in local (Flask mode) for convienient development and debugging. Please keep this in mind and run your projects as Flask apps and see how easy/difficult that is . Alternatively provide a local mode with standard Python debugging in mind. pdb.set_trace() is a good starting point. When the single app.py limitation will be fixed? |
Sorry for the delay on this, I've been bouncing some ideas from #56 and trying out a few prototypes of this feature. I've also been chatting with the rest of the python sdk team on this to get more feedback. While the
Now, both of those problems can be solved with an explicit include/exclude list, but I would have to generate those in my common case (where I have tests/, and misc scripts/ files). The idea that seems to be working out the best is to have a dedicated directory, something like I have a proof of concept for this, but I'm interested to hear what others think. |
PR: #146 |
#146 is merged. I'll get a release out soon. Please try it out and share any feedback you have. |
I'm still having issues getting multiple files to work and I'm using the latest chalice which should have this change. Here's my file structure:
In
However, I'm still getting the dreaded |
@d3ming Did you put in chalicelib/init.py the following content : And why do you have a init.py file in the root directory ? |
@jamesls Any progress on allowing routes to be in more than just app.py? It'd be super useful for larger projects. |
I am facing similar problem. It would be very helpful if it gets fixed soon. |
I'm still having issues getting multiple files to work and I'm using the latest chalice which should have this change. Here's my file structure:
In app.py I try to import response_template.py by adding this line: from models import response_template However, I'm still getting the dreaded Unable to import module 'app' error when I try out the app. I tested this out without using chalice and was able to import/call the module's functions as expected. |
The initial version of this framework only has support for an
app.py
file. I always envisioned being able to support more than this, while still trying to keep things small. What I had in mind:app.py
or, create anapp/
directory.app/
directory must be a python package (__init__.py
).app
object defined in__init__.py
.app/
will be included in the zip file distribution, including non python files.This will allow you to split your app into multiple python modules as well as include data/config files with your app.
Keep in mind, the source code analyzer will likely need to be updated as well to handle more than just an
app.py
file.The text was updated successfully, but these errors were encountered: