Did I find the right examples for you? yes no

All Samples(494)  |  Call(399)  |  Derive(0)  |  Import(95)
Aborts execution and causes a 303 or 302 redirect, depending on
the HTTP protocol version. 

        def redirect(url, code=None):
    """ Aborts execution and causes a 303 or 302 redirect, depending on
        the HTTP protocol version. """
    if code is None:
        code = 303 if request.get('SERVER_PROTOCOL') == "HTTP/1.1" else 302
    location = urljoin(request.url, url)
    res = HTTPResponse("", status=code, Location=location)
    if response._cookies:
        res._cookies = response._cookies
    raise res
        


src/g/l/gluino-HEAD/bottle_example.py   gluino(Download)
from bottle import run, route, request, get, post, static_file, redirect
from gluino import wrapper, DAL, Field, SQLFORM, cache, IS_NOT_EMPTY
import time
 
# configure the gluino wrapper
wrapper.debug = True
wrapper.redirect = lambda status,url: redirect(url)

src/t/a/TastyAuth-HEAD/example/server.py   TastyAuth(Download)
import settings
 
import bottle
from bottle import route, redirect, request, response, debug, run
from pprint import pformat
def facebook_login():
    url = facebook.redirect(request.environ)
    redirect(url)
 
 
@route('/twitter/login')
def twitter_login():
    # twitter is the only one that needs cookies to authenticate the user
    url = twitter.redirect(request.environ, CookieMonster())
    redirect(url)
def google_login():
    url = google.redirect(request.environ)
    redirect(url)
 
 

src/h/e/healthgraph-api-0.3.0/samples/bottle/runkeeper_demo.py   healthgraph-api(Download)
def index():
    sess = bottle.request.environ['beaker.session']
    if sess.has_key('rk_access_token'):
        bottle.redirect('/welcome')
    else:
        sess['rk_access_token'] = access_token
        sess.save()
        bottle.redirect('/welcome')
 
@bottle.route('/welcome')
                               records=records.get_totals())
    else:
        bottle.redirect('/')
 
@bottle.route('/logout')
def logout():
    sess = bottle.request.environ['beaker.session']
    sess.delete()
    bottle.redirect('/')
                                             else None))
    else:
        bottle.redirect('/')
 
 

src/h/e/healthgraph-api-HEAD/samples/bottle/runkeeper_demo.py   healthgraph-api(Download)
def index():
    sess = bottle.request.environ['beaker.session']
    if sess.has_key('rk_access_token'):
        bottle.redirect('/welcome')
    else:
        sess['rk_access_token'] = access_token
        sess.save()
        bottle.redirect('/welcome')
 
@bottle.route('/welcome')
                               records=records.get_totals())
    else:
        bottle.redirect('/')
 
@bottle.route('/logout')
def logout():
    sess = bottle.request.environ['beaker.session']
    sess.delete()
    bottle.redirect('/')
                                             else None))
    else:
        bottle.redirect('/')
 
 

src/p/o/pony-HEAD/pony/orm/examples/bottle_example.py   pony(Download)
from bottle import default_app, install, route, request, redirect, run, template
 
# Import eStore model http://editor.ponyorm.com/user/pony/eStore
from pony.orm.examples.estore import *
from pony.orm.integration.bottle_plugin import PonyPlugin
    # We might put the commit() command here, but it is not necessary
    # because PonyPlugin will take care of this.
    redirect("/products/%d/" % p.id)
    # The Bottle's redirect function raises the HTTPResponse exception.
    # Normally PonyPlugin closes the session with rollback

src/p/o/pony-0.5-beta/pony/orm/examples/bottle_example.py   pony(Download)
from bottle import default_app, install, route, request, redirect, run, template
 
# Import eStore model http://editor.ponyorm.com/user/pony/eStore
from pony.orm.examples.estore import *
from pony.orm.integration.bottle_plugin import PonyPlugin
    # We might put the commit() command here, but it is not necessary
    # because PonyPlugin will take care of this.
    redirect("/products/%d/" % p.id)
    # The Bottle's redirect function raises the HTTPResponse exception.
    # Normally PonyPlugin closes the session with rollback

src/c/o/cony-0.2.0/examples/search.py   cony(Download)
from bottle import redirect
 
 
def cmd_fl(term):
    """Search among Flickr photos under Creative Commons license."""
    redirect('http://www.flickr.com/search/?q=%s&l=cc&ss=0&ct=0&mt=all&w=all&adv=1' % term)
 
 
def cmd_pep(term):
    redirect('http://www.python.org/dev/peps/pep-%0.4d/' % int(term))
def cmd_dj(term):
    """Django documentation search."""
    redirect(
        'http://docs.djangoproject.com/en/dev/search/?cx=009763561546736975936:e88ek0eurf4&'
        'cof=FORID:11&q=%s&siteurl=docs.djangoproject.com/en/dev/topics/db/models/' % term

src/c/o/cony-0.2.0/examples/lang.py   cony(Download)
import urllib
 
from bottle import redirect
 
def cmd_tr(term):
    else:
        direction = 'en|ru'
    redirect('http://translate.google.com/#%s|%s' % (direction, term))
 
def cmd_save_word(term):

src/t/h/thermos-0.1.5/examples/thermos-example-bottle-repozewhat.py   thermos(Download)
 
from bottle import route, run, app, get, post, abort, request, debug
from bottle import template, redirect
 
from repoze.what.plugins.quickstart import setup_sql_auth

src/p/y/python-instagram-HEAD/sample_app.py   python-instagram(Download)
import bottle_session
import bottle
from bottle import route, redirect, post, run, request
from instagram import client, subscriptions
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next