GithubHelp home page GithubHelp logo

tg123 / bottle-mysql Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 16.0 23 KB

MySQL integration for Bottle.

Home Page: https://pypi.python.org/pypi/bottle-mysql/

License: MIT License

Python 100.00%
bottle database mysql

bottle-mysql's Issues

Installing via pip install does not bring in all requriements

Installing this via pip install bottle-mysql does not bring in all necessary requirements, mainly MySQLdb. In turn, trying to run any code that uses a DB, will yield this error:

Traceback (most recent call last):
  File "application.py", line 2, in <module>
    import bottle_mysql
  File "/Users/michou/git/mock/lib/python2.7/site-packages/bottle_mysql.py", line 40, in <module>
    import MySQLdb
ImportError: No module named MySQLdb

Cannot use unix socket to connect db

Currently it is impossible to connect to db via unix socket.
MySQLdb suports such feature but bottle-mysql does not pass necessary parameters into connect method.

Fix: pull request #2

With nested decorators and plugins gives errors during requests

If I leave something like

    @app.route(APPROOT + '/new', method=['GET', 'POST'])
    @valid_user()
    def new(db):

I get this
TypeError: new() takes exactly 1 argument (0 given)

If I do db=None


    @app.route(APPROOT + '/new', method=['GET', 'POST'])
    @valid_user()
    def new(db=None):

I get

AttributeError: 'NoneType' object has no attribute 'execute'

Seems like the bottlesession decorator is in the way. And it's not just bottlesession

You can check with basic auth decorators as well, I had to functionally rewrite basic auth because plugin retrospection gives Nonetype object bug as well. For example this one https://gist.github.com/thinkxl/8296214
or this one
https://stackoverflow.com/questions/13272528/bottle-py-http-auth

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.