6👍
You have to log the client in:
c = Client()
c.login(username='your_username', password='your_password')
response = c.post(change_url, data)
The most correct way to define change_url
is using reverse()
. You can browse the docs to find the correct way to do this. For example:
change_url = reverse('admin:docrepo_document_add')
Source:stackexchange.com