You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Navigate to the Admin Portal example app within the cloned repo.
23
+
2. Navigate to the Admin Portal example app within the cloned repo.
29
24
```bash
30
25
$ cd python-django-example-applications/python-django-sso-example
31
26
````
32
27
33
28
34
-
4. Create and source a Python virtual environment. You should then see `(env)` at the beginning of your command-line prompt.
29
+
3. Create and source a Python virtual environment. You should then see `(env)` at the beginning of your command-line prompt.
35
30
```bash
36
31
$ python3 -m venv env
37
32
$ source env/bin/activate
38
33
(env) $
39
34
```
40
35
41
-
5. Install the cloned app's dependencies. If the `pip` command doesn't work, try `pip3` instead.
36
+
4. Install the cloned app's dependencies. If the `pip` command doesn't work, try `pip3` instead.
42
37
```bash
43
38
(env) $ pip install -r requirements.txt
44
39
```
45
40
46
-
6. Obtain and make note of the following values. In the next step, these will be set as environment variables.
41
+
5. Obtain and make note of the following values. In the next step, these will be set as environment variables.
47
42
- Your [WorkOS API key](https://dashboard.workos.com/api-keys)
48
43
- Your [SSO-specific, WorkOS Client ID](https://dashboard.workos.com/sso/configuration)
49
44
- The redirect URI. For this example, we'll use http://localhost:8000/auth/callback
50
45
51
-
7. Ensure you're in the root directory forthe example app, `python-django-sso-example/`. Create a `.env` file to securely store the environment variables. Open this file with the Nano text editor. (This file is listedin this repo's `.gitignore` file, so your sensitive information will not be checked into version control.)
46
+
6. Ensure you're in the root directory forthe example app, `python-django-sso-example/`. Create a `.env` file to securely store the environment variables. Open this file with the Nano text editor. (This file is listedin this repo's `.gitignore` file, so your sensitive information will not be checked into version control.)
52
47
```bash
53
48
(env) $ touch .env
54
49
(env) $ nano .env
55
50
```
56
51
57
-
8. Once the Nano text editor opens, you can directly edit the `.env` file by listing the environment variables:
52
+
7. Once the Nano text editor opens, you can directly edit the `.env` file by listing the environment variables:
58
53
```bash
59
54
export WORKOS_API_KEY=<value found in step 6>
60
55
export WORKOS_CLIENT_ID=<value found in step 6>
@@ -63,7 +58,7 @@ An example Django application demonstrating how to use the [WorkOS Python SDK](h
63
58
64
59
To exit the Nano text editor, type `CTRL + x`. When prompted to "Save modified buffer", type `Y`, then press the `Enter` or `Return` key.
65
60
66
-
9. Source the environment variables so they are accessible to the operating system.
61
+
8. Source the environment variables so they are accessible to the operating system.
67
62
```bash
68
63
(env) $ source .env
69
64
```
@@ -75,7 +70,7 @@ An example Django application demonstrating how to use the [WorkOS Python SDK](h
75
70
(env) $ echo $REDIRECT_URI
76
71
```
77
72
78
-
10. Run the Django migrations. Again, ensure you're in the `python-django-sso-example/` directory where the `manange.py` file is.
73
+
9. Run the Django migrations. Again, ensure you're in the `python-django-sso-example/` directory where the `manange.py` file is.
79
74
```bash
80
75
(env) $ python3 manage.py migrate
81
76
```
@@ -90,9 +85,9 @@ An example Django application demonstrating how to use the [WorkOS Python SDK](h
90
85
...
91
86
```
92
87
93
-
11. In `python-django-sso-example/sso/views.py` change the `CONNECTION_ID` string value to the connection ID that you are targeting. This can be found in the WorkOS Dashboard under the Connection Settings.
88
+
10. In `python-django-sso-example/sso/views.py` change the `CONNECTION_ID` string value to the connection ID that you are targeting. This can be found in the WorkOS Dashboard under the Connection Settings.
94
89
95
-
12. The final setup step is to start the server.
90
+
11. The final setup step is to start the server.
96
91
```bash
97
92
(env) $ python3 manage.py runserver --insecure
98
93
```
@@ -125,7 +120,7 @@ If you get stuck, please reach out to us at [email protected] so we can help.
125
120
126
121
## Testing the Integration
127
122
128
-
13. Naviagte to the `python-django-sso-example` directory, which contains the `manage.py` file. Source the virtual environment we created earlier, if it isn't still activated from the steps above. Start the Django server locally.
123
+
12. Naviagte to the `python-django-sso-example` directory, which contains the `manage.py` file. Source the virtual environment we created earlier, if it isn't still activated from the steps above. Start the Django server locally.
0 commit comments