Skip to content

Commit 79b25a1

Browse files
committed
Update README.md
1 parent 1792589 commit 79b25a1

File tree

1 file changed

+47
-31
lines changed

1 file changed

+47
-31
lines changed

README.md

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,71 @@
11
Django Rest Framework Mongoengine
2-
===============================
2+
=================================
33

4-
***Mongoengine*** support for ***Django Rest Framework***.
5-
6-
# DRF 3
7-
Starting from `version 2.0`, this package will be developed using `DRF 3.0` and higher.
8-
9-
# DRF 2
10-
If you want to use `DRFME` with `DRF 2`, you should `version 1.*`. Development will be continued on `drf_2_support` branch.
4+
The package provides [mongoengine](mongoengine.org) support for [django-rest-framework](https://github.com/tomchristie/django-rest-framework)
115

126
## Documentation
13-
See full documentation [here](https://pythonhosted.org/django-rest-framework-mongoengine/)
14-
### DocumentSerializer
15-
`DocumentSerializer` works just like as `DRF Model Serializer`. Your model fields are converted to relevant serializer fields automatically. If you want custom behavior, you can use `nested serializers`.
16-
```Python
17-
from rest_framework_mongoengine.serializers import DocumentSerializer
187

19-
class BlogSerializer(DocumentSerializer):
20-
class Meta:
21-
model = Blog
22-
fields = ('id', 'author', 'name', 'date_created')
23-
```
24-
### DynamicDocumentSerializer
25-
A `DocumentSerializer` for dynamic documents.
26-
### EmbeddedDocumentSerializer
27-
`EmbeddedDocumentSerializer` is used to customize `EmbeddedDocument` behavior, and make `validations` accurately. It is mentioned extensively on the [documentation](https://pythonhosted.org/django-rest-framework-mongoengine/serializers/#embeddeddocumentserializer)
28-
### Generic Views
29-
`Generic Views` are named exactly the same as `DRF Generic Views`.
8+
For full documentation, usage and examples refer to [DRF manuals](http://www.django-rest-framework.org/).
9+
10+
The features and differences of this package are described in [API documentation](http://umutbozkurt.github.io/django-rest-framework-mongoengine/)
3011

31-
Just make sure you are using `DRFME Generics`.
12+
## Requirements
3213

33-
`from rest_framework_mongoengine import generics`
14+
* Django == 1.*
15+
* djangorestframework == 3.*
16+
* mongoengine == 0.10.* | 0.9.*
17+
* blinker == 1.* (for mongoengine referencefields to work)
18+
* With mongoengine 0.10: pymongo == 3.*
19+
* With mongoengine 0.9: pymongo == 2.*
3420

3521
## Installation
22+
23+
### from pypi
24+
3625
`pip install django-rest-framework-mongoengine`
3726

38-
**Note:** You might consider using a specific version.
27+
### from github
28+
29+
* download [some release from github](https://github.com/umutbozkurt/django-rest-framework-mongoengine/releases), unpack somewhere.
30+
* copy subdir `unpacked_path/rest_framework_mongoengine` into your django project or inside python path
31+
* or, install using `pip unpacked_path`
32+
33+
### do not use git clone!
34+
35+
It may contain non-working code.
3936

40-
***For clarity:***
41-
- DRF2 support: `pip install "django-rest-framework-mongoengine<2.0"`
42-
- DRF3 support: `pip install "django-rest-framework-mongoengine>=2.0"`
37+
## Usage
4338

39+
### Include the packages in Django settings.
4440

45-
Don't forget to add the package to installed apps.
4641
```Python
4742
INSTALLED_APPS = (
4843
...
44+
'rest_framework'
4945
'rest_framework_mongoengine',
46+
...
5047
)
5148
```
5249

50+
### Import modules
51+
52+
Use corresponding classes from this package in place of original DRF stuff. Refer to API documentation.
53+
54+
## Releases
55+
56+
### Current release
57+
58+
Intended to match DRF API. The major and minor version number matches supported version of DRF.
59+
60+
### Old releases
61+
62+
Releases 2.x were not well compatible with DRF and mongoengine. Current code is mostly refactored and reimplemented.
63+
64+
### Ancient releases
65+
66+
Releases 1.x were developed to work with `DRF 2`. This branch is no longer supported.
67+
Documentation available [here](https://github.com/umutbozkurt/django-rest-framework-mongoengine/blob/drf_2_support/README.md)
68+
5369
## Maintainers
5470

5571
@qwiglydee

0 commit comments

Comments
 (0)