File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
examples/flask_mongoengine Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change
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!
You can’t perform that action at this time.
0 commit comments