settings.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from os import path
  2. ENVIRON = 'development'
  3. PROJECT_ROOT = path.dirname(__file__)
  4. DEBUG = ENVIRON == 'development'
  5. TESTING = DEBUG
  6. SECRET_KEY = '\xce\xa0\xd92x\xf9S!\x0f\x85J\xd4\xda\xd1\xdbQ\x9dH\x0f"\x94%\x15Z'
  7. SITE_NAME = 'Flask S3 Save Example'
  8. SQLALCHEMY_DATABASE_URI = 'sqlite:///%s' % path.join(PROJECT_ROOT, '../dev.db')
  9. UPLOADS_RELATIVE_PATH = 'uploads/'
  10. UPLOADS_FOLDER = path.abspath(path.join(PROJECT_ROOT, '../static/%s' % UPLOADS_RELATIVE_PATH))
  11. MEDIA_FOLDER = path.abspath(path.join(PROJECT_ROOT, '../static/%s' % UPLOADS_RELATIVE_PATH.replace('/', '')))
  12. MEDIA_URL = '/static/%s' % UPLOADS_RELATIVE_PATH
  13. MEDIA_THUMBNAIL_FOLDER = path.abspath(path.join(PROJECT_ROOT, '../static/cache/thumbnails'))
  14. MEDIA_THUMBNAIL_URL = 'cache/thumbnails/'
  15. USE_S3 = True
  16. S3_BUCKET_NAME = 's3-test-foobar-whizbang'
  17. AWS_ACCESS_KEY_ID = '#'
  18. AWS_SECRET_ACCESS_KEY = '#'
  19. S3_USE_HTTPS = False
  20. SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
  21. SECURITY_PASSWORD_SALT = 'f80ec7f4-6f71-4417-bba8-e85d30b1c716'
  22. SECURITY_LOGIN_URL = '/login/'
  23. SECURITY_LOGOUT_URL = '/logout/'
  24. THINGY_IMAGE_RELATIVE_PATH = 'thingy_image/'
  25. THUMBNAIL_S3_STORAGE_TYPE = USE_S3 and 's3' or None
  26. THUMBNAIL_S3_BUCKET_NAME = S3_BUCKET_NAME
  27. THUMBNAIL_S3_ACCESS_KEY_ID = AWS_ACCESS_KEY_ID
  28. THUMBNAIL_S3_ACCESS_KEY_SECRET = AWS_SECRET_ACCESS_KEY
  29. THUMBNAIL_S3_USE_HTTPS = S3_USE_HTTPS
  30. THUMBNAIL_S3_STATIC_ROOT_PARENT = path.abspath(path.join(PROJECT_ROOT, '..'))