Get token:
curl -X POST -H "Content-Type: application/json" -d '{"username": "john", "password": "password"}' http://localhost:8080/api-token-auth/
Request:
curl -X GET -H "Authorization: Token <token>" http://localhost:8080/users/33456/ | json_pp
from django.db.models import F, Func, Value | |
from myapp.models import MyModel | |
# Annotation | |
MyModel.objects.filter(description__icontains='\r\n').annotate( | |
fixed_description=Func( | |
F('description'), | |
Value('\r\n'), Value('\n'), | |
function='replace', | |
) |
12:26:39.633548 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.224.1 tell 10.71.225.223, length 46 | |
12:26:39.648976 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.224.1 tell 10.71.225.223, length 46 | |
12:26:43.730693 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.224.1 tell 10.71.225.223, length 46 | |
12:26:43.740123 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.224.1 tell 10.71.225.223, length 46 | |
12:26:43.740213 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.224.1 tell 10.71.225.223, length 46 | |
12:26:43.762777 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.224.1 tell 10.71.225.223, length 46 | |
12:26:44.761346 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.224.1 tell 10.71.225.223 |
12:15:13.226201 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.224.1 tell 10.71.225.223, length 46 | |
12:16:07.152997 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.225.223 tell 10.71.225.223, length 46 | |
12:17:08.151867 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.225.223 tell 10.71.225.223, length 46 | |
12:18:09.150929 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.225.223 tell 10.71.225.223, length 46 | |
12:19:10.150006 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.225.223 tell 10.71.225.223, length 46 | |
12:20:11.149077 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.225.223 tell 10.71.225.223, length 46 | |
12:21:12.148137 18:a6:f7:71:70:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Request who-has 10.71.225.223 tell 1 |
Get token:
curl -X POST -H "Content-Type: application/json" -d '{"username": "john", "password": "password"}' http://localhost:8080/api-token-auth/
Request:
curl -X GET -H "Authorization: Token <token>" http://localhost:8080/users/33456/ | json_pp