settings.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import os.path
  2. import tempfile
  3. BASE_DIR = os.path.dirname(os.path.abspath(__file__))
  4. DEBUG = True
  5. ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
  6. DATABASES = {
  7. "default": {
  8. "ENGINE": "django.db.backends.sqlite3",
  9. "NAME": ":memory:",
  10. }
  11. }
  12. INSTALLED_APPS = (
  13. "django.contrib.auth",
  14. "django.contrib.contenttypes",
  15. "django.contrib.sessions",
  16. "django.contrib.staticfiles",
  17. "storages",
  18. "s3file",
  19. "tests.testapp",
  20. )
  21. MIDDLEWARE = MIDDLEWARE_CLASSES = (
  22. "django.contrib.sessions.middleware.SessionMiddleware",
  23. "django.contrib.auth.middleware.AuthenticationMiddleware",
  24. "django.contrib.messages.middleware.MessageMiddleware",
  25. "s3file.middleware.S3FileMiddleware",
  26. )
  27. SECRET_KEY = "SuperSecretKey"
  28. STATIC_URL = "/static/"
  29. MEDIA_ROOT = tempfile.mkdtemp()
  30. ROOT_URLCONF = "tests.testapp.urls"
  31. MEDIA_URL = "/s3/"
  32. SITE_ID = 1
  33. TEMPLATES = [
  34. {
  35. "BACKEND": "django.template.backends.django.DjangoTemplates",
  36. "APP_DIRS": True,
  37. },
  38. ]
  39. USE_TZ = True
  40. AWS_ACCESS_KEY_ID = "testaccessid"
  41. AWS_SECRET_ACCESS_KEY = "supersecretkey"
  42. AWS_STORAGE_BUCKET_NAME = "test-bucket"
  43. AWS_S3_REGION_NAME = "eu-central-1"
  44. AWS_S3_SIGNATURE_VERSION = "s3v4"
  45. AWS_DEFAULT_ACL = None
  46. AWS_LOCATION = "custom/location/"