zoukankan      html  css  js  c++  java
  • 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': '',
        }
    }
    

      

  • 相关阅读:
    bzoj1098 1301
    bzoj3237
    bzoj3170
    bzoj4008
    一些题解
    bzoj4028
    bzoj3196
    redis学习
    quartz学习
    电商618 压测、优化、降级预案
  • 原文地址:https://www.cnblogs.com/zhengze/p/10702293.html
Copyright © 2011-2022 走看看