I hereby claim:
- I am beniwohli on github.
- I am piquadrat (https://keybase.io/piquadrat) on keybase.
- I have a public key ASAAy1hyA09WpNUHd9eW89Ox1Blx6qb1km6J1yz8Jc-bUgo
To claim this, I am signing this object:
<?xml version="1.0" ?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
from optparse import make_option | |
from django.core.management.base import BaseCommand, CommandError | |
from django.contrib.sites.models import Site | |
from django.db import transaction | |
from cms.models import Page | |
class Command(BaseCommand): |
# -*- coding: utf-8 -*- | |
import re | |
_linkify_re = re.compile( | |
r"""(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))""") | |
_hashtag_re = re.compile(r'(?: |^)#(\w{2,})', re.UNICODE) | |
def _link_replace(match): | |
href = match.groups(1)[0] |
import django | |
from django.conf import settings | |
import celery | |
class Celery(celery.Celery): | |
def on_configure(self): | |
django.setup() | |
from opbeat.contrib.django.models import client, logger, register_handlers | |
from opbeat.contrib.celery import register_signal |
import logging | |
from django.conf import settings as django_settings | |
from opbeat.contrib.django.models import client | |
def _is_ignorable_404(uri): | |
""" | |
Returns True if the given request *shouldn't* notify the site managers. |
with override_settings( | |
TEMPLATES=[ | |
{ | |
'BACKEND': settings.TEMPLATES[0]['BACKEND'], | |
'DIRS': settings.TEMPLATES[0]['DIRS'], | |
'OPTIONS': { | |
'context_processors': settings.TEMPLATES[0]['OPTIONS']['context_processors'], | |
'loaders': settings.TEMPLATES[0]['OPTIONS']['loaders'], | |
'debug': True, | |
}, |
I hereby claim:
To claim this, I am signing this object:
import time | |
import functools | |
class timer(object): | |
""" | |
Usage | |
As decorator: |
Elastic APM by default uses the name of the Django view as the identifier of a transaction, combined with the request method. While this works well in general, it leads to confusing results with view sets from Django Rest Framework. It cobbles list and detail views together, as well as any custom actions you might have defined in your viewset.
You can work around this by adding the action of the viewset to the transaction name. Simply add the provided mixin to any view set:
class BooksViewSet(ViewSetTransactionNameMixin, viewsets.ModelViewSet):