django-session-switcher allows you to quickly switch between dummy users. Handy tool to create dummy content for your side projects from multiple users.
- Install the package
pip install django-session-switcher
- Add
django_session_switcher
to yourINSTALLED_APPS
settings.
INSTALLED_APPS = [
...,
"django_session_switcher",
]
- Add the middleware to your project
MIDDLEWARE = [
...,
"django_session_switcher.middleware.SessionSwitcherMiddleware",
]
- Include the django_session_switchers URLconf in your project urls.py like this
path("__dss__/", include("django_session_switcher.urls")),
-
Run
python manage.py migrate
to create the models. -
You need to add the dummy users to the django_session_switcher's
Session User
model. You can do this through django admin. -
Once you have added some users to
Session User
you will be able to switch between added users with a single click.