GithubHelp home page GithubHelp logo

odooxp2021-fastapi's Introduction

FastAPI with Odoo backend demo

This repository accompanies Stéphane Bidoul's Odoo Experience 2021 Talk.

The first ~10 commits follow the talk structure and build the demo from the ground up.

To install, first create a python virtual environment, and install the dependencies in it (including Odoo 15):

$ python3 -m venv .venv
$ .venv/bin/python3 -m pip install requirements.txt

Note: this command will be slow as it will do a git clone of Odoo into .venv/src/odoo. If you already have a local copy of the Odoo 15.0 source code, feel free to update the odoo line in requirements.txt to make it point to your local copy instead of the GitHub URL.

Then create an odoo.cfg configuration file with db_name set in the [options] section:

[options]
db_name=odoo_fastapi_demo_15

Initialize a regular Odoo database with the contacts app installed:

$ env ODOO_RC=odoo.cfg .venv/bin/odoo -o contacts --stop-after-init

You can then run the demo application server using:

$ env ODOO_RC=odoo.cfg .venv/bin/python3 -m uvicorn odoo_fastapi_demo:app

And finally, you can browse the OpenAPI documentation at http://127.0.0.1:8000/docs, and test the API endpoints using the Try it out buttons.

To run the tests, use:

$ env ODOO_RC=odoo.cfg python -m pytest tests/ -v

odooxp2021-fastapi's People

Contributors

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