Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Django settings for mysite project.
- Generated by 'django-admin startproject' using Django 1.10.6.
- For more information on this file, see
- https://docs.djangoproject.com/en/1.10/topics/settings/
- For the full list of settings and their values, see
- https://docs.djangoproject.com/en/1.10/ref/settings/
- """
- import os
- from mongoengine import *
- import pymongo
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- # Quick-start development settings - unsuitable for production
- # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
- # SECURITY WARNING: keep the secret key used in production secret!
- SECRET_KEY = '85!^dm*y!!wrinm@ihd_342#^3m%yab)pj3(fo99j&1iv6^my!'
- # SECURITY WARNING: don't run with debug turned on in production!
- DEBUG = True
- ALLOWED_HOSTS = []
- # Application definition
- INSTALLED_APPS = [
- 'polls.apps.PollsConfig',
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- ]
- # Attempt to connecto to MongoDB
- MONGOADMIN_OVERRIDE_ADMIN = True
- MIDDLEWARE = [
- 'django.middleware.security.SecurityMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- ]
- ROOT_URLCONF = 'mysite.urls'
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- ],
- },
- },
- ]
- WSGI_APPLICATION = 'mysite.wsgi.application'
- # Database
- # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
- }
- }
- # Attempts to connect to MongoDB
- # If it doesn't work all the lines containing the tag should be
- # deleted.
- AUTHENTICATION_BACKENDS = (
- 'mongoengine.django.auth.MongoEngineBackend',
- )
- AUTH_USER_MODEL = 'mongo_auth.MongoUser'
- MONGOENGINE_USER_DOCUMENT = 'mongoengine.django.auth.User'
- _MONGODB_USER = 'root'
- _MONGODB_PASSWD = '12345'
- _MONGODB_HOST = '127.0.0.1'
- _MONGODB_NAME = 'testDB'
- _MONGODB_DATABASE_HOST = \
- 'mongodb://%s:%s@%s/%s' \
- % (_MONGODB_USER, _MONGODB_PASSWD, _MONGODB_HOST, _MONGODB_NAME)
- # Attempting to connect to MongoDB database 'testDB'
- connect(_MONGODB_NAME, host=_MONGODB_DATABASE_HOST)
- # SESSION_ENGINE = 'mongoengine.django.sessions'
- # SESSION_SERIALIZER = 'mongoengine.django.sessions.BSONSerializer'
- # Password validation
- # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
- AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
- ]
- # Internationalization
- # https://docs.djangoproject.com/en/1.10/topics/i18n/
- LANGUAGE_CODE = 'en-us'
- TIME_ZONE = 'America/Bogota'
- USE_I18N = True
- USE_L10N = True
- USE_TZ = True
- # Static files (CSS, JavaScript, Images)
- # https://docs.djangoproject.com/en/1.10/howto/static-files/
- STATIC_URL = '/static/'
Advertisement
Add Comment
Please, Sign In to add comment