Guest User

Untitled

a guest
Oct 5th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.96 KB | None | 0 0
  1. # Django settings for product_python project.
  2.  
  3. import os, sys, datetime
  4. PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
  5.  
  6. DEBUG = True
  7. TEMPLATE_DEBUG = DEBUG
  8.  
  9. ADMINS = (
  10.     ('adminname', '[email protected]')
  11. )
  12.  
  13. MANAGERS = ADMINS
  14.  
  15. DATABASES = {
  16.     'default': {
  17.         'ENGINE': 'django.db.backends.mysql',
  18.         'NAME': 'product',
  19.         'USER': 'root',
  20.         'PASSWORD': 'root',
  21.         'HOST': '127.0.0.1',
  22.         'PORT': '',
  23.     }
  24. }
  25.  
  26. TIME_ZONE = 'America/New_York'
  27.  
  28. LANGUAGE_CODE = 'en-us'
  29.  
  30. SITE_ID = 1
  31.  
  32. # If you set this to False, Django will make some optimizations so as not
  33. # to load the internationalization machinery.
  34. USE_I18N = True
  35.  
  36. # If you set this to False, Django will not format dates, numbers and
  37. # calendars according to the current locale.
  38. USE_L10N = True
  39.  
  40. # If you set this to False, Django will not use timezone-aware datetimes.
  41. USE_TZ = True
  42.  
  43. # Absolute filesystem path to the directory that will hold user-uploaded files.
  44. # Example: "/home/media/media.lawrence.com/media/"
  45. MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')+'/'
  46.  
  47. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  48. # trailing slash.
  49. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  50. MEDIA_URL = ''
  51.  
  52.  
  53. LOGIN_URL = '/login'
  54.  
  55. LOGIN_REDIRECT_URL = '/'
  56.  
  57. # Absolute path to the directory static files should be collected to.
  58. # Don't put anything in this directory yourself; store your static files
  59. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  60. # Example: "/home/media/media.lawrence.com/static/"
  61. STATIC_ROOT = os.path.join(PROJECT_PATH, os.path.join('public','static'))+'/'
  62.  
  63. # URL prefix for static files.
  64. # Example: "http://media.lawrence.com/static/"
  65. STATIC_URL = '/static/'
  66.  
  67. # Additional locations of static files
  68. STATICFILES_DIRS = (
  69.     # Put strings here, like "/home/html/static" or "C:/www/django/static".
  70.     # Always use forward slashes, even on Windows.
  71.     # Don't forget to use absolute paths, not relative paths.
  72. )
  73.  
  74. # List of finder classes that know how to find static files in
  75. # various locations.
  76. STATICFILES_FINDERS = (
  77.     'django.contrib.staticfiles.finders.FileSystemFinder',
  78.     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  79. #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
  80. )
  81.  
  82. # List of callables that know how to import templates from various sources.
  83. TEMPLATE_LOADERS = (
  84.     'django_mobile.loader.Loader',
  85.     'django.template.loaders.filesystem.Loader',
  86.     'django.template.loaders.app_directories.Loader',
  87. #     'django.template.loaders.eggs.Loader',
  88. )
  89.  
  90. TEMPLATE_CONTEXT_PROCESSORS = (
  91.     'django.core.context_processors.debug',
  92.     'django.core.context_processors.i18n',
  93.     'django.core.context_processors.media',
  94.     'django.core.context_processors.static',
  95.     'django.contrib.auth.context_processors.auth',
  96.     'django.contrib.messages.context_processors.messages',
  97.     'django.core.context_processors.request',
  98.     'django_mobile.context_processors.flavour',
  99.     'sekizai.context_processors.sekizai',
  100. )
  101.  
  102. MIDDLEWARE_CLASSES = (
  103.     'django.middleware.common.CommonMiddleware',
  104.     'django.contrib.sessions.middleware.SessionMiddleware',
  105.     'django.middleware.csrf.CsrfViewMiddleware',
  106.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  107.     'django.contrib.messages.middleware.MessageMiddleware',
  108.     # Uncomment the next line for simple clickjacking protection:
  109.     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  110.     'django_mobile.middleware.MobileDetectionMiddleware',
  111.     'django_mobile.middleware.SetFlavourMiddleware',
  112. )
  113.  
  114. ROOT_URLCONF = 'app.urls'
  115.  
  116. # Python dotted path to the WSGI application used by Django's runserver.
  117. WSGI_APPLICATION = 'app.wsgi.application'
  118.  
  119. TEMPLATE_DIRS = (
  120.     os.path.join(PROJECT_PATH, 'templates'),
  121. )
  122.  
  123. INSTALLED_APPS = (
  124.     'django.contrib.auth',
  125.     'django.contrib.contenttypes',
  126.     'django.contrib.sessions',
  127.     'django.contrib.sites',
  128.     'django.contrib.messages',
  129.     'django.contrib.staticfiles',
  130.     'grappelli',
  131.     'django.contrib.admin',
  132.     'product',
  133.     'product_simulator',
  134.     'alerts',
  135.     'lib',
  136.     'django_crontab',
  137.     'dbsettings',
  138.     'notifications',
  139.     'django_mobile',
  140.     'sekizai',
  141.     'googl',
  142.     'tastypie',
  143.     'api',
  144.     'stats',
  145. )
  146.  
  147.  
  148. # A sample logging configuration. The only tangible logging
  149. # performed by this configuration is to send an email to
  150. # the site admins on every HTTP 500 error when DEBUG=False.
  151. # See http://docs.djangoproject.com/en/dev/topics/logging for
  152. # more details on how to customize your logging configuration.
  153. LOGGING = {
  154.     'version': 1,
  155.     'disable_existing_loggers': False,
  156.     'filters': {
  157.         'require_debug_false': {
  158.             '()': 'django.utils.log.RequireDebugFalse'
  159.         }
  160.     },
  161.     'handlers': {
  162.         'mail_admins': {
  163.             'level': 'ERROR',
  164.             'filters': ['require_debug_false'],
  165.             'class': 'django.utils.log.AdminEmailHandler',
  166.             'include_html': True,
  167.         }
  168.     },
  169.     'loggers': {
  170.         'django.request': {
  171.             'handlers': ['mail_admins'],
  172.             'level': 'ERROR',
  173.             'propagate': True,
  174.         },
  175.         'django_crontab.management.commands.crontab': {
  176.             'handlers': ['mail_admins'],
  177.             'level': 'ERROR',
  178.             'propagate': True,
  179.         },
  180.     }
  181. }
  182.  
  183.  
  184. # EXTRA #
  185. sys.path.append(os.path.join(PROJECT_PATH, 'lib'))
  186.  
  187.  
  188. # Close session
  189. SESSION_EXPIRE_AT_BROWSER_CLOSE = True
  190.  
  191. # User profile
  192. AUTH_PROFILE_MODULE = 'product.UserProfile'
  193.  
  194. #AUTH_USER_MODEL = 'myapp.MyUser'
  195.  
  196.  
  197.  
  198.  
  199. # Django-Mobile flavours
  200. FLAVOURS = ('full','mobile','mobile_desktop')
  201.  
  202.  
  203. ### URL SHORTENING
  204. # URL Shortener Services list
  205. URL_SHORTENERS = [
  206.     'goo.gl',
  207.     #'bit.ly',
  208. ]
  209.  
  210. # URL Shortener service to use (must be in the 'URL_SHORTENERS' list)
  211. URL_SHORTENER_TO_USE = 'goo.gl'
  212.  
  213.  
  214. # Tastypie settings (API)
  215. #TATYPIE
  216.  
  217. TASTYPIE_DEFAULT_FORMATS = ['json', 'xml']
Advertisement
Add Comment
Please, Sign In to add comment