""" Django settings for closedverse project. Generated by 'django-admin startproject' using Django 1.10.7. 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/ """ # Django Settings import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False PROD = False # 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! (If you want a website that can generate key https://miniwebtool.com/django-secret-key-generator/ goto here.) SECRET_KEY = '' # Change the ALLOWED_HOSTS to your liking. ALLOWED_HOSTS = [ 'domain.com' ] DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' # Application definition INSTALLED_APPS = [ 'admin_interface', 'colorfield', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'markdown_deux', 'closedverse_main', 'ban', 'maintenance', ] X_FRAME_OPTIONS='SAMEORIGIN' 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', 'ban.middleware.BanManagement', 'closedverse_main.middleware.ClosedMiddleware', 'maintenance.middleware.MaintenanceManagement', 'whitenoise.middleware.WhiteNoiseMiddleware' ] ROOT_URLCONF = 'closedverse.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 = 'closedverse.wsgi.application' # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR + '/sql.sqlite3', } } # 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/ TIME_ZONE = 'PST8PDT' LANGUAGE_CODE = 'en-us' USE_I18N = True USE_L10N = True USE_TZ = True # You can use Mailtrap to get the email system working. Mailtrap is free and will work well for what you'll be doing with this. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'send.smtp.mailtrap.io' EMAIL_HOST_USER = 'api' EMAIL_HOST_PASSWORD = '' EMAIL_PORT = '' EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = 'noreply@domain' AUTH_USER_MODEL = 'closedverse_main.User' CSRF_FAILURE_VIEW = 'closedverse_main.views.csrf_fail' LOGIN_URL = '/login/' LOGIN_REDIRECT_URL = '/login/' # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static/') ] STATIC_URL = '/s/' STATIC_ROOT = os.path.join(BASE_DIR, 's/') STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage' # Media root # This MUST end with a trailing slash and there must be an 'rm' folder in it MEDIA_ROOT = os.path.join(BASE_DIR, 'media/') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" MEDIA_URL = '/i/' # Cedar Three settings # reCAPTCHA v2 keys, None for no reCAPTCHA recaptcha_pub = '' recaptcha_priv = '' # NNID forbidden list. None for no passing. nnid_forbiddens = BASE_DIR + '/forbidden.json' # Memo title and message on communities list # I got rid of this setting because it was annoying i guess, edit the HTML to change it. -seedur # Client key to use for iphub.email, because we're using that # None for no IP checking (recommended since this is so slow) iphub_key = "" # If IP can be checked, then use this to disallow any proxies disallow_proxy = False # MD MARKDOWN_DEUX_STYLES = { "default": { "extras": { "code-friendly": None, }, "safe_mode": "escape", }, } # allow sign ups. allow_signups = True # Minimum level required to view IP addresses and user agents. (default: 10) # Mods under this level will still be able to manage users, however will not be able to view any sensitive data. min_lvl_metadata_perms = 10 # file size limits in megabytes! only applies when using the community tools. max_icon_size = .5 max_banner_size = 1 # The minimum length required for a user's password. This is to save the users from themselves in the event of a data breach. The longer and more complex the password is, the harder it is to be cracked. (default: 7) # This will definitely miss a few people off who just want to sign up without worrying about long passwords. minimum_password_length = 7 # The hard limit for uploading, Will cause an error if this is exceeded. This is set to 15MB by default (15728640) DATA_UPLOAD_MAX_MEMORY_SIZE = 15728640 # Set the default theme here! Set this to None to use the normal Closedverse theme. # TODO, make this work for users who aren't logged in. site_wide_theme_hex = "#ff00cd" # The location to redirect to if a user's status is set to 2 (Redirect) (rickroll) inactive_redirect = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" # Option to delete image if it's local # 0 - keep, 1 - move to 'rm' folder, 2 - DELETE image_delete_opt = 0 # age (minimal 13 due to C.O.P.P.A) age_allowed = "16"