Foxray: a light error tracker for the Sentry SDKs. Runs inside Django (the admin is the UI) or on its own; SQLite or Postgres, nothing else. Not affiliated with Sentry.
danq9
0.1.2: the first PyPI release (v0.1.1 is already tagged at 05cc354, before the PyPI metadata)
58507e3
4 weeks ago
History
django_settings.py · 2.1 KB · 45 lines
| 1 | import os |
| 2 | import tempfile |
| 3 | from urllib.parse import urlsplit |
| 4 | |
| 5 | SECRET_KEY = "foxray-tests" |
| 6 | DEBUG = False |
| 7 | ALLOWED_HOSTS = ["*"] |
| 8 | USE_TZ = True |
| 9 | TIME_ZONE = "UTC" |
| 10 | INSTALLED_APPS = [ |
| 11 | "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", |
| 12 | "django.contrib.messages", "foxray.django", |
| 13 | ] |
| 14 | MIDDLEWARE = [ |
| 15 | "django.middleware.security.SecurityMiddleware", |
| 16 | "django.contrib.sessions.middleware.SessionMiddleware", |
| 17 | "django.middleware.common.CommonMiddleware", |
| 18 | "django.middleware.csrf.CsrfViewMiddleware", |
| 19 | "django.contrib.auth.middleware.AuthenticationMiddleware", |
| 20 | "django.contrib.messages.middleware.MessageMiddleware", |
| 21 | ] |
| 22 | ROOT_URLCONF = "tests.django_urls" |
| 23 | TEMPLATES = [{ |
| 24 | "BACKEND": "django.template.backends.django.DjangoTemplates", "APP_DIRS": True, |
| 25 | "OPTIONS": {"context_processors": ["django.template.context_processors.request", |
| 26 | "django.contrib.auth.context_processors.auth", |
| 27 | "django.contrib.messages.context_processors.messages"]}, |
| 28 | }] |
| 29 | _pg = os.environ.get("FOXRAY_TEST_DJANGO_PG", "") |
| 30 | if _pg: |
| 31 | _u = urlsplit(_pg) |
| 32 | DATABASES = {"default": {"ENGINE": "django.db.backends.postgresql", "NAME": "foxray_django", |
| 33 | "USER": _u.username or "", "PASSWORD": _u.password or "", "HOST": _u.hostname or "", |
| 34 | "PORT": str(_u.port or "")}} |
| 35 | else: |
| 36 | # A file, not memory: the live-server and threaded tests share it across connections. |
| 37 | DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:", |
| 38 | "OPTIONS": {"timeout": 30}, |
| 39 | "TEST": {"NAME": os.path.join(tempfile.gettempdir(), f"foxray-django-{os.getpid()}.sqlite3")}}} |
| 40 | STATIC_URL = "/static/" |
| 41 | DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
| 42 | EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend" |
| 43 | ADMINS = [("Ops", "ops@example.com")] |
| 44 | SERVER_EMAIL = "foxray@example.com" |
| 45 | FOXRAY = {"AUTO_INIT": False, "SYNC_AFTER": True, "BASE_URL": "http://testserver"} |