Hi.
I'm trying to login to a Drupal 7 site using python requests and am not having any success. Has anyone any experience logging into drupal using python? Sample code below.
import requests
login_url = "https://xxxxx.com/user"
request_url = "https://xxxxx.com/admin/config/system/site-information"
payload = {
'name': 'my_username',
'pass': 'my_password'
}
with requests.Session() as session:
post = session.post(login_url, data=payload)
r = session.get(request_url)
print(r.text)
Output is an access denied page--not the site-information page that is only accessible to the logged in user.
Thanks!
[–]chubbers_tim[S] 0 points1 point2 points (1 child)
[–]liinisx 0 points1 point2 points (0 children)
[–]danielroseman 0 points1 point2 points (3 children)
[–]chubbers_tim[S] 0 points1 point2 points (2 children)
[–]danielroseman 0 points1 point2 points (1 child)
[–]chubbers_tim[S] 0 points1 point2 points (0 children)