# Path: descant/settings.py
# BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SITE_ID = 1
# INSTALLED_APPS = (
#     'django.contrib.admin',
#     'django.contrib.auth',
#     'django.contrib.contenttypes',
#     'django.contrib.sessions',
#     'django.contrib.messages',
#     'django.contrib.staticfiles',
#     'rest_framework',
#     'rest_framework.authtoken',
#     'djoser',
#     'corsheaders',
#     'permission',
#     'forums',
# )
# MIDDLEWARE_CLASSES = (
#     'django.contrib.sessions.middleware.SessionMiddleware',
#     'corsheaders.middleware.CorsMiddleware',
#     'django.middleware.common.CommonMiddleware',
#     'django.middleware.csrf.CsrfViewMiddleware',
#     'django.contrib.auth.middleware.AuthenticationMiddleware',
#     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
#     'django.contrib.messages.middleware.MessageMiddleware',
#     'django.middleware.clickjacking.XFrameOptionsMiddleware',
#     'django.middleware.security.SecurityMiddleware',
# )
# AUTHENTICATION_BACKENDS = (
#     'django.contrib.auth.backends.ModelBackend',  # default
#     'permission.backends.PermissionBackend',
# )
# ANONYMOUS_USER_ID = -1
# CORS_ORIGIN_ALLOW_ALL = True
# CORS_URLS_REGEX = r'^/api/.*$'
# ROOT_URLCONF = 'descant.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 = 'descant.wsgi.application'
# REST_FRAMEWORK = {
#     'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
#     'DEFAULT_AUTHENTICATION_CLASSES': (
#         'rest_framework.authentication.TokenAuthentication',
#     ),
# }
# LANGUAGE_CODE = 'en-us'
# TIME_ZONE = 'UTC'
# USE_I18N = True
# USE_L10N = True
# USE_TZ = True
# STATIC_URL = '/static/'
# STATIC_ROOT = './static/'
# ALLOWED_TAGS = [
#     'a',
#     'abbr',
#     'acronym',
#     'b',
#     'blockquote',
#     'code',
#     'em',
#     'i',
#     'li',
#     'ol',
#     'strong',
#     'ul',
#     'h1',
#     'h2',
#     'h3',
#     'h4',
#     'h5',
#     'h6',
#     'hr',
#     'p',
#     'pre',
#     'br',
#     'img',
# ]
# ALLOWED_ATTRIBUTES = {
#     'a': ['href', 'title'],
#     'abbr': ['title'],
#     'acronym': ['title'],
#     'img': ['src', 'alt']
# }
# SECRET_KEY = '1g72n-3b=b^!x-_p7tcz58f!p)sg#^r!!vm2v^$i8q874&k9qu'
# DEBUG = True
# ALLOWED_HOSTS = []
#     EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
#     EMAIL_FILE_PATH = '/tmp/descant-emails'
#     EMAIL_HOST = 'localhost'
#     EMAIL_PORT = 587
#     EMAIL_USE_TLS = True
#     EMAIL_HOST_USER = 'misconfigured'
#     EMAIL_HOST_PASSWORD = 'misconfigured'
# DATABASES = {
#     'default': {
#         'ENGINE': 'django.db.backends.sqlite3',
#         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#     }
# }
# DJOSER = {
#     # Set this to your domain (it'll be put on emails, etc)
#     'DOMAIN': 'localhost',
#     # Include your site's name here
#     'SITE_NAME': 'Descant Forum',
#     # Currently not available in the front-end UI, so users will have to interact
#     # with the API directly
#     'PASSWORD_RESET_CONFIRM_URL': 'api/auth/password/reset/confirm/{uid}/{token}',
#     # Change this to <frontend_url>/#/activate?uid={uid}&token={token}
#     # Make sure to replace <frontend_url> with the actual front-end URL,
#     # relative to 'DOMAIN', like this: forums/#/activate?uid={uid}&token={token}
#     'ACTIVATION_URL': 'api/auth/activate/{uid}/{token}',
#     # Don't touch these.
#     'LOGIN_AFTER_ACTIVATION': True,
#     'SEND_ACTIVATION_EMAIL': True,
# }


from django.db import models
from django.utils import timezone
from markdown2 import markdown
from descant import settings
import bleach



class Tag(models.Model):
    name = models.CharField(max_length=40)
    # Hex colours will be converted to an integer here for convenience
    colour = models.IntegerField()

    def __str__(self):

# Path: descant/settings.py
# BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SITE_ID = 1
# INSTALLED_APPS = (
#     'django.contrib.admin',
#     'django.contrib.auth',
#     'django.contrib.contenttypes',
#     'django.contrib.sessions',
#     'django.contrib.messages',
#     'django.contrib.staticfiles',
#     'rest_framework',
#     'rest_framework.authtoken',
#     'djoser',
#     'corsheaders',
#     'permission',
#     'forums',
# )
# MIDDLEWARE_CLASSES = (
#     'django.contrib.sessions.middleware.SessionMiddleware',
#     'corsheaders.middleware.CorsMiddleware',
#     'django.middleware.common.CommonMiddleware',
#     'django.middleware.csrf.CsrfViewMiddleware',
#     'django.contrib.auth.middleware.AuthenticationMiddleware',
#     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
#     'django.contrib.messages.middleware.MessageMiddleware',
#     'django.middleware.clickjacking.XFrameOptionsMiddleware',
#     'django.middleware.security.SecurityMiddleware',
# )
# AUTHENTICATION_BACKENDS = (
#     'django.contrib.auth.backends.ModelBackend',  # default
#     'permission.backends.PermissionBackend',
# )
# ANONYMOUS_USER_ID = -1
# CORS_ORIGIN_ALLOW_ALL = True
# CORS_URLS_REGEX = r'^/api/.*$'
# ROOT_URLCONF = 'descant.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 = 'descant.wsgi.application'
# REST_FRAMEWORK = {
#     'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
#     'DEFAULT_AUTHENTICATION_CLASSES': (
#         'rest_framework.authentication.TokenAuthentication',
#     ),
# }
# LANGUAGE_CODE = 'en-us'
# TIME_ZONE = 'UTC'
# USE_I18N = True
# USE_L10N = True
# USE_TZ = True
# STATIC_URL = '/static/'
# STATIC_ROOT = './static/'
# ALLOWED_TAGS = [
#     'a',
#     'abbr',
#     'acronym',
#     'b',
#     'blockquote',
#     'code',
#     'em',
#     'i',
#     'li',
#     'ol',
#     'strong',
#     'ul',
#     'h1',
#     'h2',
#     'h3',
#     'h4',
#     'h5',
#     'h6',
#     'hr',
#     'p',
#     'pre',
#     'br',
#     'img',
# ]
# ALLOWED_ATTRIBUTES = {
#     'a': ['href', 'title'],
#     'abbr': ['title'],
#     'acronym': ['title'],
#     'img': ['src', 'alt']
# }
# SECRET_KEY = '1g72n-3b=b^!x-_p7tcz58f!p)sg#^r!!vm2v^$i8q874&k9qu'
# DEBUG = True
# ALLOWED_HOSTS = []
#     EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
#     EMAIL_FILE_PATH = '/tmp/descant-emails'
#     EMAIL_HOST = 'localhost'
#     EMAIL_PORT = 587
#     EMAIL_USE_TLS = True
#     EMAIL_HOST_USER = 'misconfigured'
#     EMAIL_HOST_PASSWORD = 'misconfigured'
# DATABASES = {
#     'default': {
#         'ENGINE': 'django.db.backends.sqlite3',
#         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#     }
# }
# DJOSER = {
#     # Set this to your domain (it'll be put on emails, etc)
#     'DOMAIN': 'localhost',
#     # Include your site's name here
#     'SITE_NAME': 'Descant Forum',
#     # Currently not available in the front-end UI, so users will have to interact
#     # with the API directly
#     'PASSWORD_RESET_CONFIRM_URL': 'api/auth/password/reset/confirm/{uid}/{token}',
#     # Change this to <frontend_url>/#/activate?uid={uid}&token={token}
#     # Make sure to replace <frontend_url> with the actual front-end URL,
#     # relative to 'DOMAIN', like this: forums/#/activate?uid={uid}&token={token}
#     'ACTIVATION_URL': 'api/auth/activate/{uid}/{token}',
#     # Don't touch these.
#     'LOGIN_AFTER_ACTIVATION': True,
#     'SEND_ACTIVATION_EMAIL': True,
# }


# Path: forums/models.py
from django.db import models
from django.utils import timezone
from markdown2 import markdown
from descant import settings
import bleach




class Tag(models.Model):
    name = models.CharField(max_length=40)
    # Hex colours will be converted to an integer here for convenience
    colour = models.IntegerField()

    def __str__(self):

        return self.name