Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(32)  |  Call(32)  |  Derive(0)  |  Import(0)
Add URL rule to Flask application or blueprint.

``mixed`` could be a real callable function, or a string Python path
to callable view function. If ``mixed`` is a string, it would be
wrapped with ``LazyView`` class.

src/l/e/learnpython.in.ua-HEAD/learnpython/app.py   learnpython.in.ua(Download)
# Register all possible urls
views = LazyViews(app, '.views')
views.add('/', 'page', defaults={'name': 'index'}, endpoint='index')
views.add('/contacts', 'contacts', methods=('GET', 'POST'))
views.add('/flows', 'flows', endpoint='flows')
views.add('/flows/archive/<int:archive>', 'flows', endpoint='flows_archive')
views.add('/status', 'status')

src/f/l/Flask-LazyViews-HEAD/testapp/tests.py   Flask-LazyViews(Download)
    def test_custom_config_app(self):
        views = LazyViews(self.app, import_prefix='testapp.views')
        views.add('/default-page',
                  'page',
                  defaults={'page_id': 1},
 
        views = LazyViews(blueprint, import_prefix=blueprint.import_name)
        views.add('/more-advanced',
                  'views.advanced',
                  endpoint='more_advanced',
    def test_error_config_app(self):
        views = LazyViews(self.app, import_prefix='weird.path')
        views.add('/default-page',
                  'views.page',
                  defaults={'page_id': 1},
 
        views = LazyViews(self.app, import_prefix='testapp.views')
        views.add('/another-default-page',
                  'does_not_exist',
                  endpoint='another_default_page')
 
        views = LazyViews(blueprint, import_prefix='weird.path')
        views.add('/more-advanced',
                  'views.advanced',
                  endpoint='more_advanced')

src/f/l/Flask-Dropbox-HEAD/testapp/app.py   Flask-Dropbox(Download)
# Add test project views
views = LazyViews(app, 'testapp.views')
views.add('/', 'home')
views.add('/delete/<path:filename>', 'delete')
views.add('/download/<path:filename>', 'download', endpoint='download')
views.add('/files', 'files')
views.add('/media/<path:filename>',

src/f/l/Flask-LazyViews-HEAD/testapp/app.py   Flask-LazyViews(Download)
    # Add url rules to application
    views = LazyViews(app)
    views.add('/', 'views.home')
    views.add('/db', 'views.database_page')
    views.add('/error', 'views.server_error')
    views.add('/page/<int:page_id>', 'views.page', endpoint='flatpage')
    views.add('/page/<int:page_id>/cls',

src/f/l/Flask-LazyViews-HEAD/testapp/test/blueprint.py   Flask-LazyViews(Download)
 
    views = LazyViews(blueprint, import_prefix='.views')
    views.add('/', 'test')
    views.add('/advanced', 'advanced', methods=('GET', 'POST'))