I am using Locust (python) to load test on a Django web app. I keep getting a 403 error when I run my script.
Here is the code:
from locust import HttpLocust, TaskSet
def index(l):
l.client.get("/")
def login(l):
l.client.post("/login/", {"username":"[email protected]", "password":"education")
def upload(l):
l.client.get("/upload-image/")
def home(l):
l.client.get("/home/")
def settings(l):
l.client.get("/settings/")
def logout(l):
l.client.get("/logout/")
class UserBehavior(TaskSet):
tasks = {index:1, upload:1, home:1, settings:1, logout:1}
def on_start(self):
login(self)
class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait=5000
max_wait=9000