django mongodb配置
#settings.py import os from mongoengine import * BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) DEBUG = False ALLOWED_HOSTS = ['*'] # Database # https://docs.djangoproject.com/en/1.8/ref/settings/#databases database_name = 'torstatus' MONGO_DATABASE_OPTIONS = { 'host': 'localhost', 'port': 27017, 'username': 'tor_tester', 'password': '123456', } register_connection('default', database_name, **MONGO_DATABASE_OPTIONS) DATABASES = { 'default':{ 'ENGINE': '', 'NAME': '', } }