Giter Club home page Giter Club logo

bottle-beaker's People

Contributors

avelino avatar defnull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bottle-beaker's Issues

How am I supposed to use this module?

The example doesn't work:

    import bottle
    from bottle.ext import beaker
    
    session_opts = {
        'session.type': 'file',
        'session.cookie_expires': 300,
        'session.data_dir': './data',
        'session.auto': True
    }
    
    app = beaker.middleware.SessionMiddleware(bottle.app(), session_opts)
    
    @bottle.route('/test')
    def test():
        s = bottle.request.environ.get('beaker.session')
        s['test'] = s.get('test',0) + 1
        s.save()
        return 'Test counter: %d' % s['test']
    
    bottle.run(app=app)

s is always None and I don't understand why...

Write test

Contemplate the tests:

  • Validate the two keywords
  • Validate if the middleware of beaker was imported
  • Use of the beaker in view

Error message

When using your example application there's the following error:

prompt> python sample.py
Traceback (most recent call last):
File "sample.py", line 3, in
from bottle.ext.beaker.middleware import SessionMiddleware
ImportError: No module named middleware

bottle-beaker 0.1.2 in pypi

pip install "bottle-beaker==0.1.2"
fails because it can't find requirements.txt

pip install "bottle-beaker==0.1.2"
Collecting bottle-beaker==0.1.2
Using cached bottle-beaker-0.1.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-6k3c9pjn/bottle-beaker/setup.py", line 7, in
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.