Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ALLOWED_HOSTS = []
- # Application definition
- INSTALLED_APPS = (
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'Newsletter',
- )
- MIDDLEWARE_CLASSES = (
- 'django.contrib.sessions.middleware.SessionMiddleware',
- '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',
- )
- ROOT_URLCONF = 'django_project.urls'
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR, "Templates")],
- '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 = 'django_project.wsgi.application'
- # Database
- # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'django',
- # Or path to database file if using sqlite3.
- # The following settings are not used with sqlite3:
- 'USER': 'django',
- 'PASSWORD': '7d7bjsksos',
- 'HOST': '127.0.0.1', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
- 'PORT': '', # Set to empty string for default.
- }
- }
- # Internationalization
- # https://docs.djangoproject.com/en/1.8/topics/i18n/
- LANGUAGE_CODE = 'en-us'
- TIME_ZONE = 'Africa/Nairobi'
- USE_I18N = True
- USE_L10N = True
- USE_TZ = False
- # Static files (CSS, JavaScript, Images)
- # https://docs.djangoproject.com/en/1.8/howto/static-files/
- STATIC_URL = '/static/'
- STATIC_ROOT = os.path.join(BASE_DIR, 'static')
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- # Allow Django from all hosts. This snippet is installed from
- # /var/lib/digitalocean/allow_hosts.py
- import os
- import netifaces
- # Find out what the IP addresses are at run time
- # This is necessary because otherwise Gunicorn will reject the connections
- def ip_addresses():
- ip_list = []
- for interface in netifaces.interfaces():
- addrs = netifaces.ifaddresses(interface)
- for x in (netifaces.AF_INET, netifaces.AF_INET6):
- if x in addrs:
- ip_list.append(addrs[x][0]['addr'])
- return ip_list
- # Discover our IP address
- ALLOWED_HOSTS = ip_addresses()
- from django.db import models
- class Betting(models.Model):
- website = models.CharField(max_length=120, blank=True, null=True)
- match = models.CharField(max_length=120, blank=True, null=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement