Last active
August 29, 2015 14:07
-
-
Save rkorkosz/e8aebcc52992e802f05f to your computer and use it in GitHub Desktop.
Django mongoengine restframework settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSTALLED_APPS = ( | |
| ... | |
| 'django.contrib.auth', | |
| 'django.contrib.contenttypes', | |
| 'mongoengine.django.mongo_auth', # tylko jeżeli potrzebujemy autoryzacji | |
| 'django.contrib.sessions', | |
| ... | |
| 'rest_framework', | |
| 'api', | |
| ) | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.dummy' | |
| } | |
| } | |
| MONGO_DATABASE_NAME = 'todo' | |
| mongoengine.connect(MONGO_DATABASE_NAME) | |
| AUTHENTICATION_BACKENDS = ( | |
| 'mongoengine.django.auth.MongoEngineBackend', # tylko jeżeli potrzebujemy autoryzacji | |
| ) | |
| SESSION_ENGINE = 'mongoengine.django.sessions' # tylko jeżeli potrzebujemy sesji | |
| SESSION_SERIALIZER = 'mongoengine.django.sessions.BSONSerializer' # tylko jeżeli potrzebujemy sesji | |
| AUTH_USER_MODEL = 'mongo_auth.MongoUser' # tylko jeżeli potrzebujemy autoryzacji |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment