def get_request_repr(self, request): if request is None: return repr(None) result = super(WeblateExceptionReporterFilter, self).get_request_repr( request ) if (hasattr(request, 'session') and 'django_language' in request.session): lang = request.session['django_language'] else: lang = None if (hasattr(request, 'user') and request.user.is_authenticated()): user = repr(request.user.username) else: user = None return '%s\n\nLanguage: %s\nUser: %s\n\nVersions:\n%s' % ( result, lang, user, get_versions_string() )
def handle(self, *args, **options): ''' Prints versions of dependencies. ''' self.stdout.write(get_versions_string()) self.stdout.write(' * Database backends: ' + ', '.join( [conn['ENGINE'] for conn in db.connections.databases.values()]))
def handle(self, *args, **options): """Print versions of dependencies.""" self.stdout.write(get_versions_string()) self.stdout.write(' * Database backends: ' + ', '.join( [conn['ENGINE'] for conn in db.connections.databases.values()])) self.stdout.write(' * Cache backends: ' + ', '.join( '{}:{}'.format(key, value['BACKEND'].split('.')[-1]) for key, value in settings.CACHES.items()))
def handle(self, *args, **options): """Print versions of dependencies.""" self.stdout.write(get_versions_string()) self.stdout.write( ' * Database backends: ' + ', '.join( [conn['ENGINE'] for conn in db.connections.databases.values()] ) )
def handle(self, *args, **options): ''' Prints versions of dependencies. ''' self.stdout.write(get_versions_string())
def handle(self, *args, **options): ''' Prints versions of dependencies. ''' print get_versions_string()