GithubHelp home page GithubHelp logo

gae-discourse-client's Introduction

Google App Engine Discourse API Client

This is a client for interacting with the Discourse API from within a Google App Engine application. It provides methods for interacting with users, categories, and groups.

Setup

To setup the API client, you must first have a running instance of Discourse. To see how to do this, please visit this page. Once this is set up, you must have an API key. To create one, visit http://discourse.example.com/admin/api, replacing 'discourse.example.com' with the URL of your Discourse site.

Once this is done, place the following lines of code in your GAE application:

from gae_discourse_client import discourse_client
discourse_client.initClient(discourse_url, api_key, api_username)

where discourse_url is the URL of your Discourse site, api_key is the key from above, and api_username is a username associated with the key.

Usage

Once the client has been setup, it's ready to use. To call the getUserByEmail method from the users module, for example, use:

user = yield discourse_client.users.getUserByEmail('[email protected]')

Testing

This package has two sets of tests: local unit tests, and functional tests which test the client against a test instance of Discourse. Before running tests, requirements.txt must be installed (pip install -r requirements.txt). To run the unit tests, run:

python setup.py test

If you see import errors related to Google App Engine, you may need to add the Google App Engine SDK to your Python path:

export PYTHONPATH="${PYTHONPATH}:/usr/local/google_appengine"

To run the functional tests, you must first have a running instance of Discourse. The easiest way to do this is to set it up locally using this guide. Once that's done, you'll need an API key (which you can create or retrieve the same way as above). Then run:

python setup.py test_functional --url 'http://localhost:4000/' --apikey 'abc123'

replacing the URL and API key with the appropriate values for your test instance. Note: these tests will have side effects, so make sure not to run them against a production instance of Discourse.

Contributing

Contributions to this project are more than welcome. Please follow the Google style guide. We look forward to seeing your pull requests!

Author

Thomas Davids ([email protected])

License

Available under the MIT License.

Archival Note

This repository is deprecated; therefore, we are going to archive it. However, learners will be able to fork it to their personal Github account but cannot submit PRs to this repository. If you have any issues or suggestions to make, feel free to:

gae-discourse-client's People

Contributors

inorvig avatar sudkul avatar tfdavids avatar tfdavids-zz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.