Advertisement
Guest User

Untitled

a guest
Aug 4th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.98 KB | None | 0 0
  1. You have requested to collect static files at the destination
  2. location as specified in your settings.
  3.  
  4. This will overwrite existing files!
  5. Are you sure you want to do this?
  6.  
  7. Type 'yes' to continue, or 'no' to cancel: yes
  8. Traceback (most recent call last):
  9. File "manage.py", line 10, in <module>
  10. execute_from_command_line(sys.argv)
  11. File "/home/damian/proj1/local/lib/python2.7/site- packages/django/core/management/__init__.py", line 353, in execute_from_command_line
  12. utility.execute()
  13. File "/home/damian/proj1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
  14. self.fetch_command(subcommand).run_from_argv(self.argv)
  15. File "/home/damian/proj1/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
  16. self.execute(*args, **cmd_options)
  17. File "/home/damian/proj1/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
  18. output = self.handle(*args, **options)
  19. File "/home/damian/proj1/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 176, in handle
  20. collected = self.collect()
  21. File "/home/damian/proj1/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 107, in collect
  22. handler(path, prefixed_path, storage)
  23. File "/home/damian/proj1/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 325, in copy_file
  24. if not self.delete_file(path, prefixed_path, source_storage):
  25. File "/home/damian/proj1/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 238, in delete_file
  26. if self.storage.exists(prefixed_path):
  27. File "/home/damian/proj1/local/lib/python2.7/site-packages/storages/backends/s3boto.py", line 446, in exists
  28. return k.exists()
  29. File "/home/damian/proj1/local/lib/python2.7/site-packages/boto/s3/key.py", line 539, in exists
  30. return bool(self.bucket.lookup(self.name, headers=headers))
  31. File "/home/damian/proj1/local/lib/python2.7/site-packages/boto/s3/bucket.py", line 143, in lookup
  32. return self.get_key(key_name, headers=headers)
  33. File "/home/damian/proj1/local/lib/python2.7/site-packages/boto/s3/bucket.py", line 193, in get_key
  34. key, resp = self._get_key_internal(key_name, headers, query_args_l)
  35. File "/home/damian/proj1/local/lib/python2.7/site-packages/boto/s3/bucket.py", line 231, in _get_key_internal
  36. response.status, response.reason, '')
  37. boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
  38.  
  39. DEBUG = True
  40.  
  41. ALLOWED_HOSTS = []
  42.  
  43. EMAIL_HOST = 'smtp.gmail.com'
  44. EMAIL_HOST_USER = ''
  45. EMAIL_HOST_PASSWORD = ''
  46. EMAIL_PORT = 587
  47. EMAIL_USE_TLS = True
  48.  
  49. # Application definition
  50.  
  51. INSTALLED_APPS = [
  52. 'django.contrib.admin',
  53. 'django.contrib.auth',
  54. 'django.contrib.contenttypes',
  55. 'django.contrib.sessions',
  56. 'django.contrib.messages',
  57. 'django.contrib.staticfiles',
  58. 'blogapp',
  59. 'crispy_forms',
  60. 'storages',
  61. ]
  62.  
  63. MIDDLEWARE_CLASSES = [
  64. 'django.middleware.security.SecurityMiddleware',
  65. 'django.contrib.sessions.middleware.SessionMiddleware',
  66. 'django.middleware.common.CommonMiddleware',
  67. 'django.middleware.csrf.CsrfViewMiddleware',
  68. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  69. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  70. 'django.contrib.messages.middleware.MessageMiddleware',
  71. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  72. ]
  73.  
  74. ROOT_URLCONF = 'blog.urls'
  75.  
  76. TEMPLATES = [
  77. {
  78. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  79. 'DIRS': [],
  80. 'APP_DIRS': True,
  81. 'OPTIONS': {
  82. 'context_processors': [
  83. 'django.template.context_processors.debug',
  84. 'django.template.context_processors.request',
  85. 'django.contrib.auth.context_processors.auth',
  86. 'django.contrib.messages.context_processors.messages',
  87. ],
  88. },
  89. },
  90. ]
  91.  
  92. WSGI_APPLICATION = 'blog.wsgi.application'
  93.  
  94.  
  95. # Database
  96. # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  97.  
  98. DATABASES = {
  99. 'default': {
  100. 'ENGINE': 'django.db.backends.sqlite3',
  101. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  102. }
  103. }
  104.  
  105.  
  106. # Internationalization
  107. # https://docs.djangoproject.com/en/1.9/topics/i18n/
  108.  
  109. LANGUAGE_CODE = 'en-us'
  110. DEFAULT_CHARSET = 'utf-8'
  111.  
  112. TIME_ZONE = 'Europe/Berlin'
  113.  
  114. USE_I18N = True
  115.  
  116. USE_L10N = True
  117.  
  118. USE_TZ = True
  119.  
  120.  
  121. # Static files (CSS, JavaScript, Images)
  122. # https://docs.djangoproject.com/en/1.9/howto/static-files/
  123.  
  124. STATIC_URL = '/static/'
  125.  
  126. STATIC_ROOT = os.path.join(BASE_DIR, "static_in_env", "static_root")
  127.  
  128. STATICFILES_DIRS = (
  129. os.path.join(BASE_DIR, "static_in_pro", "our_static"),
  130. #'/var/www/static/',
  131. )
  132.  
  133. MEDIA_URL = '/media/'
  134.  
  135. MEDIA_ROOT = os.path.join(BASE_DIR, "static_in_env", "media_root")
  136.  
  137. CRISPY_TEMPLATE_PACK = 'bootstrap3'
  138.  
  139. MEDIAFILES_DIRS = (MEDIA_ROOT)
  140.  
  141.  
  142.  
  143.  
  144.  
  145. #AWS S3 STATICK FILES
  146.  
  147. AWS_HEADERS = { # see http://developer.yahoo.com/performance/rules.html#expires
  148. 'Expires': 'Thu, 31 Dec 2099 20:00:00 GMT',
  149. 'Cache-Control': 'max-age=94608000',
  150. }
  151.  
  152. AWS_STORAGE_BUCKET_NAME = '***'
  153. AWS_ACCESS_KEY_ID = '***'
  154. AWS_SECRET_ACCESS_KEY = '***'
  155.  
  156. # Tell django-storages that when coming up with the URL for an item in S3 storage, keep
  157. # it simple - just use this domain plus the path. (If this isn't set, things get complicated).
  158. # This controls how the `static` template tag from `staticfiles` gets expanded, if you're using it.
  159. # We also use it in the next setting.
  160. AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
  161.  
  162. # This is used by the `static` template tag from `static`, if you're using that. Or if anything else
  163. # refers directly to STATIC_URL. So it's safest to always set it.
  164. STATIC_URL = "https://%s/" % AWS_S3_CUSTOM_DOMAIN
  165.  
  166. # Tell the staticfiles app to use S3Boto storage when writing the collected static files (when
  167. # you run `collectstatic`).
  168. STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
  169.  
  170.  
  171.  
  172.  
  173.  
  174. #For Heroku
  175.  
  176. import dj_database_url
  177. DATABASES['default'] = dj_database_url.config()
  178.  
  179. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  180.  
  181. ALLOWED_HOSTS = ['*']
  182.  
  183. DEBUG = False
  184.  
  185. try:
  186. from .local_settings import *
  187. except ImportError:
  188. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement