-
Notifications
You must be signed in to change notification settings - Fork 3
Tech Meeting ·· What's new in C2C WSGI Utils 5.0
No more use the Docker image as base image in your project but use the pypi package with standard extra c2cwsgiutils[standard]
this is to:
- Be able to choose the base image that's you need, (e.g. osgeo/gdal :-) ).
- To lock the python dependency only at one place.
Have less magic in the project, to be easier to understand and to integrate in a new project.
Be nearer on what the projects provide around the paste application.
Better support of tools like proute
, pview
, ...
You need to update your project configuration files, you will provide the form scratch.
We provide an example application (that's tested in the CI)
C2cwsgiutils will be a Pyramid extension that we use it with the include me.
We decide to use Gunicorn and Paste (for the dev) as it's thinking by the project, for Paste there is no big changes, the main changes got Gunicorn:
- The application will be provided as a Paste application, no more as a WSGI application.
- The logging configuration will be managed by Gunicorn.
The than then concerned configuration files are:
- development.ini (for Paste)
- production.ini (for Gunicorn)
- gunicorn.conf.py (for Gunicorn)
- Dockerfile
Notable parts:
Almost the same as before, we just add the filter configuration
The logging configuration is moved to gunicorn.conf.py
, me also add the filter configuration
- The standard log level to be able to easily introspect an application
- The global config (variables in production.ini)
- The gen version
Support of login with GitHub (OAuth, Should be deeper tested)
We can use a global object models.DBSession
as it's done before or having it on the request request.dbsession
as it's done in the cookie cutter scaffold.
Some function for the command lines https://github.com/camptocamp/c2cwsgiutils/blob/master/c2cwsgiutils/setup_process.py https://github.com/camptocamp/c2cwsgiutils#custom-scripts
# Add arguments
c2cwsgiutils.setup_process.fill_arguments(parser)
# Bootstrap the application
env = c2cwsgiutils.setup_process.bootstrap_application_from_options(args)
settings = env["registry"].settings
# Just initializing the logging
loader = pyramid.scripts.common.get_config_loader(args.config_uri)
loader.setup_logging(parse_vars(args.config_vars) if args.config_vars else None)
settings = loader.get_settings()
If you have an issue, especially if you didn't have any logs, ask me :-)