# Execute pydrgraph query using flask environment

**URL:** <https://discuss.dgraph.io/t/execute-pydrgraph-query-using-flask-environment/7608>\
**Category:** Users\
**Created:** [July 9, 2020, 7:29am UTC](https://discuss.dgraph.io/t/execute-pydrgraph-query-using-flask-environment/7608 "2020-07-09T07:29:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![longShot](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@longShot](https://discuss.dgraph.io/u/longShot)\
**Post date:** [July 9, 2020, 7:29am UTC](https://discuss.dgraph.io/t/execute-pydrgraph-query-using-flask-environment/7608/1 "2020-07-09T07:29:51Z")

</div>

Hey everyone, does anyone know how to execute pydrgraph query using flask environment?

---

<div class="post-metadata">

**Author:** ![Rahul](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/rahul/32/3645_2.png) [@Rahul](https://discuss.dgraph.io/u/Rahul)\
**Post date:** [July 9, 2020, 7:51am UTC](https://discuss.dgraph.io/t/execute-pydrgraph-query-using-flask-environment/7608/2 "2020-07-09T07:51:40Z")

</div>

Hi @longShot,

You should be able to use pydgraph client from your flask application. Create a dgraph instance on your machine, add a dependency of pydgraph to your project (may be add it to requirements.txt etc.) and then you can follow the usage code snippets here : [GitHub - dgraph-io/pydgraph: Official Dgraph Python client](https://github.com/dgraph-io/pydgraph#using-a-client)

Please do ask you are facing any problems or have specific questions regarding usage. Please mark this as resolved if it answers your question.

---

<div class="post-metadata">

**Author:** ![chihpoc](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chihpoc/32/9218_2.png) [@chihpoc](https://discuss.dgraph.io/u/chihpoc)\
**Post date:** [December 6, 2021, 7:23pm UTC](https://discuss.dgraph.io/t/execute-pydrgraph-query-using-flask-environment/7608/3 "2021-12-06T19:23:53Z")

</div>

_FastAPI_ is another option
