Skip to main content

No project description provided

Project description

pyweb

Action Status

This project is the backbone for the web applications of Lobnek Wealth Management.

Technology

We take advantage of various technologies here

  • We host static files with Whitenoise.

    # add whitenoise
    server.wsgi_app = WhiteNoise(server.wsgi_app, root='/static', prefix='assets/')
    
  • We use the Waitress server.

    #!/usr/bin/env python3
    from waitress import serve
    from pyweb.app import create_app
    
    
    if __name__ == '__main__':
        serve(app=create_app(), port=8000)
    
  • The flask application is relying on the popular blueprint concept. We expose a REST server for performance calculations. Applications built on this package can reuse the very same blueprints and remain slim and elegant.

    def create_app():
        server = create_server(extensions=[engine, cache], static_folder="/static")
    
        server.register_blueprint(blue_whoosh, url_prefix="/whoosh")
        server.register_blueprint(blue_post, url_prefix="/engine")
        server.register_blueprint(blue_admin, url_prefix="/admin")
    
        # add whitenoise
        server.wsgi_app = WhiteNoise(server.wsgi_app, root='/static', prefix='assets/')
    
        return server
    
  • We use Flask extensions and a central settings.cfg file to initialize the extensions only once. Within the Dockerfile we set

    ENV APPLICATION_SETTINGS="/server/config/settings.cfg"
    
  • We extensively test the app and achieve a full coverage score. We test against a client created as a pytest fixture.

    @pytest.fixture(scope="module")
    def client():
        app = create_app()
    
        with app.app_context():
            __init_session()
    
        yield app.test_client()
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lob-pyweb, version 0.6.0
Filename, size File type Python version Upload date Hashes
Filename, size lob_pyweb-0.6.0-py3-none-any.whl (17.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size lob-pyweb-0.6.0.tar.gz (10.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page