- Python dependencies: see `requirements.txt` or `setup.py`
- Python dependencies: see `requirements.txt` or `setup.py`
- Add the app into `INSTALLED_APPS`
- Add the app into `INSTALLED_APPS`
- Include the app's `urls.py` into the project `urls.py``urlpatterns`, preferably without a prefix
- Include the app's `urls.py` into the project `urls.py``urlpatterns`, preferably without a prefix
- If you want to use `ssoauth` to log into `django.contrib.admin` or some other app with its own login page, in `urls.py` add into the top of `urlpatterns`: `re_path("^(admin/)?login/?$", AuthenticateRedirectView.as_view())`
LOGIN_URL=urls.reverse_lazy("sso-dev")# it's "sso-login" for prod
LOGIN_URL=urls.reverse_lazy("sso-dev")# it's "sso-login" for prod
```
```
#### Overriding Log In in Other Apps
#### Overriding Log In Pages of Other Apps
There are some apps like `django.contrib.admin` or `wagtail` that will simply ignore `LOGIN_URL` and use their own log in page. If this behavior is undesirable and you would prefer using `ssoauth` instead:
There are some apps like `django.contrib.admin` or `wagtail` that will simply ignore `LOGIN_URL` and use their own log in page. If this behavior is undesirable and you would prefer using `ssoauth` instead, add the following into your `urls.py` (_before_ including URLs of that other app):
- find out the login page of that app (let's assume it's `admin/login`)
- in `urls.py`, before including URLs for that app, include this view:
Optional argument `already_authenticated_403=True` is used to avoid redirect loops caused by `django.contrib.admin`.
- Adjust the path if required
Instead of it you can also use `already_authenticated_redirect="url-name"`.
- Optional argument `already_authenticated_403=True` is used to avoid redirect loops (e.g. caused by `django.contrib.admin`). You can also use `already_authenticated_redirect="url-name"`.