def get_context_data(self, **kwargs): sqlite = settings.DATABASES['default']['ENGINE'].endswith('sqlite3') debug = settings.DEBUG regular_sentry = hasattr(settings, 'RAVEN_CONFIG') heroku_sentry = os.environ.get('SENTRY_DSN') sentry = regular_sentry or heroku_sentry auth_level = settings.AUTH_LEVEL auth_level_ok = settings.AUTH_LEVEL in {'DEMO', 'STUDY'} heroku = self.app_is_on_heroku() runserver = ('runserver' in sys.argv) or ('devserver' in sys.argv) db_synced = not missing_db_tables() pypi_results = check_pypi_for_updates() worker_is_running = self.worker_is_running() return { 'sqlite': sqlite, 'debug': debug, 'sentry': sentry, 'auth_level': auth_level, 'auth_level_ok': auth_level_ok, 'heroku': heroku, 'runserver': runserver, 'db_synced': db_synced, 'pypi_results': pypi_results, 'worker_is_running': worker_is_running, }
def get_context_data(self, **kwargs): return super().get_context_data( sqlite=settings.DATABASES['default']['ENGINE'].endswith('sqlite3'), debug=settings.DEBUG, auth_level=settings.AUTH_LEVEL, auth_level_ok=settings.AUTH_LEVEL in {'DEMO', 'STUDY'}, heroku='heroku' in self.request.get_host(), runserver=('runserver' in sys.argv) or ('devserver' in sys.argv), db_synced=not missing_db_tables(), pypi_results=check_pypi_for_updates(), worker_is_running=self.worker_is_running(), **kwargs)
def get(self, request, *args, **kwargs): if OtreeCoreUpdateCheck.results is None: OtreeCoreUpdateCheck.results = check_pypi_for_updates() return JsonResponse(OtreeCoreUpdateCheck.results, safe=True)