Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. ALLOWED_HOSTS = []
  2.  
  3.  
  4. # Application definition
  5.  
  6. INSTALLED_APPS = (
  7. 'django.contrib.admin',
  8. 'django.contrib.auth',
  9. 'django.contrib.contenttypes',
  10. 'django.contrib.sessions',
  11. 'django.contrib.messages',
  12. 'django.contrib.staticfiles',
  13. 'Newsletter',
  14. )
  15.  
  16. MIDDLEWARE_CLASSES = (
  17. 'django.contrib.sessions.middleware.SessionMiddleware',
  18. 'django.middleware.common.CommonMiddleware',
  19. 'django.middleware.csrf.CsrfViewMiddleware',
  20. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  21. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  22. 'django.contrib.messages.middleware.MessageMiddleware',
  23. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  24. 'django.middleware.security.SecurityMiddleware',
  25. )
  26.  
  27. ROOT_URLCONF = 'django_project.urls'
  28.  
  29. TEMPLATES = [
  30. {
  31. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  32. 'DIRS': [os.path.join(BASE_DIR, "Templates")],
  33. 'APP_DIRS': True,
  34. 'OPTIONS': {
  35. 'context_processors': [
  36. 'django.template.context_processors.debug',
  37. 'django.template.context_processors.request',
  38. 'django.contrib.auth.context_processors.auth',
  39. 'django.contrib.messages.context_processors.messages',
  40. ],
  41. },
  42. },
  43. ]
  44.  
  45. WSGI_APPLICATION = 'django_project.wsgi.application'
  46.  
  47.  
  48. # Database
  49. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  50.  
  51. DATABASES = {
  52. 'default': {
  53. 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  54. 'NAME': 'django',
  55. # Or path to database file if using sqlite3.
  56. # The following settings are not used with sqlite3:
  57. 'USER': 'django',
  58. 'PASSWORD': '7d7bjsksos',
  59. 'HOST': '127.0.0.1', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
  60. 'PORT': '', # Set to empty string for default.
  61. }
  62. }
  63.  
  64. # Internationalization
  65. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  66.  
  67. LANGUAGE_CODE = 'en-us'
  68.  
  69. TIME_ZONE = 'Africa/Nairobi'
  70.  
  71. USE_I18N = True
  72.  
  73. USE_L10N = True
  74.  
  75. USE_TZ = False
  76.  
  77.  
  78. # Static files (CSS, JavaScript, Images)
  79. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  80.  
  81. STATIC_URL = '/static/'
  82. STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  83.  
  84. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  85. # Allow Django from all hosts. This snippet is installed from
  86. # /var/lib/digitalocean/allow_hosts.py
  87.  
  88. import os
  89. import netifaces
  90.  
  91. # Find out what the IP addresses are at run time
  92. # This is necessary because otherwise Gunicorn will reject the connections
  93. def ip_addresses():
  94. ip_list = []
  95. for interface in netifaces.interfaces():
  96. addrs = netifaces.ifaddresses(interface)
  97. for x in (netifaces.AF_INET, netifaces.AF_INET6):
  98. if x in addrs:
  99. ip_list.append(addrs[x][0]['addr'])
  100. return ip_list
  101.  
  102. # Discover our IP address
  103. ALLOWED_HOSTS = ip_addresses()
  104.  
  105. from django.db import models
  106.  
  107. class Betting(models.Model):
  108. website = models.CharField(max_length=120, blank=True, null=True)
  109. match = models.CharField(max_length=120, blank=True, null=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement