Giter Site home page Giter Site logo

raygun4py-test-app's Introduction

Flask issue on GitHub

Behaviour experiencing

User is running a Python Flask application and has implemented Raygun4Py. When the user tries to set the Raygun config, they get the following error:

TypeError: Provider.__init__() got an unexpected keyword argument 'config'

Expected behaviour

When this works, we are expecting the programme to run without error, and the config items set to take effect.

Steps to reproduce

You can pull down this repo that includes a Python test app set up with Flask and Raygun.

This test app has been set up with the 'filtered_keys' config item being passed through the config object to the provider, but you could use any config item. This is what triggers the error.

You can follow the steps below to set up and run the test app.

Findings

  • Tried different syntax for passing the config: flask.Provider(app, api_key, {'filtered_keys': ['RAYGUN_API_KEY']}).attach(), flask.Provider(app, api_key, {}).attach(). Neither of these worked. Instead I got the error: TypeError: Provider.__init__() takes 3 positional arguments but 4 were given.

Python test app

Project set up

  1. Pull down this repo.

  2. Open a terminal in the route directory, install Flask by running python -m pip install flask.

  3. (Optional) Install python-dotenv by running py -m pip install python-dotenv.

  4. (Optional) Add .env file that contains your Raygun application API key.

  5. Pull down the Raygun4Py repo to your computer. Checkout the branch that has the bugfix ob/worm-51/update-python-middlewear.

  6. From the Raygun4Py route directory, run the command python setup.py sdist to build the Raygun4Py package.

  7. Also from this route directory, you can run python setup.py install. This will install the local Raygun4Py package so that you can use it in your test app.

  8. To check that the package has installed correctly, and is available to your project, got to the terminal in the route directory of your project, and run python -m pip show raygun4py.

  9. To run your project, run python app.py from the route directory.

You can keep making local changes in the Raygun4Py repo and running the build/install steps to implement and test your changes. I'd recommend changing the version number each time just so you can keep track of which changes you're running. Can always switch back to the correct version before pushing up.

raygun4py-test-app's People

Contributors

izzi-salmon avatar

Watchers

James Cloos avatar  avatar

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.