Skip to content

Commit 0509b12

Browse files
committed
docs: Add README of flask example.
1 parent b67e11b commit 0509b12

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

examples/flask_mongoengine/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
Example Flask+MongoEngine Project
3+
================================
4+
5+
This example project demos integration between Graphene, Flask and MongoEngine.
6+
The project contains two models, one named `Department` and another
7+
named `Employee`.
8+
9+
Getting started
10+
---------------
11+
12+
First you'll need to get the source of the project. Do this by cloning the
13+
whole Graphene repository:
14+
15+
```bash
16+
# Get the example project code
17+
git clone [email protected]:abawchen/graphene-mongo.git
18+
cd graphene-mongo/examples/flask_mongoengine
19+
```
20+
21+
It is good idea (but not required) to create a virtual environment
22+
for this project. We'll do this using
23+
[virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/)
24+
to keep things simple,
25+
but you may also find something like
26+
[virtualenvwrapper](https://virtualenvwrapper.readthedocs.org/en/latest/)
27+
to be useful:
28+
29+
```bash
30+
# Create a virtualenv in which we can install the dependencies
31+
virtualenv env
32+
source env/bin/activate
33+
```
34+
35+
Now we can install our dependencies:
36+
37+
```bash
38+
pip install -r requirements.txt
39+
```
40+
41+
Now the following command will setup the database, and start the server:
42+
43+
```bash
44+
./app.py
45+
46+
```
47+
48+
49+
Now head on over to
50+
[http://127.0.0.1:5000/graphql](http://127.0.0.1:5000/graphql)
51+
and run some queries!

0 commit comments

Comments
 (0)