docs: Flask integration tutorial#2126
Conversation
adding statements that were not in the django doc
…edit Integrate Python Flask language edit
Update flask integration
mooreds
left a comment
There was a problem hiding this comment.
Really close.
- need to add a flask row to docs/quickstarts/index.html (webapps section). I can take care of the logo, but please add the row.
- update example app to point to the new repo.
| Now, cut and paste the following requirements into `requirements.txt`: | ||
|
|
||
| ```text | ||
| {% remote_include https://raw.githubusercontent.com/ritza-co/fusionauth-flask-integration/main/requirements.txt %} |
There was a problem hiding this comment.
Can we use the latest version of fusionauth_client here, please?
| Then, copy and paste the following code into the `setup.py` file. | ||
|
|
||
| ```python | ||
| {% remote_include https://raw.githubusercontent.com/ritza-co/fusionauth-flask-integration/main/setup.py %} |
There was a problem hiding this comment.
So I've been collecting these here: https://github.com/FusionAuth/fusionauth-example-client-libraries and you should be able to reuse setup.py from that directory.
| {% remote_include https://raw.githubusercontent.com/ritza-co/fusionauth-flask-integration/main/setup.py %} | ||
| ``` | ||
|
|
||
| Then, you can run the setup script. Please note that this setup script is designed to run on a newly installed FusionAuth instance with only one user and no tenants other than "Default". To follow this guide on a FusionAuth instance that does not meet these criteria, you may need to modify the above script. Refer to the [Python client library](/docs/v1/tech/client-libraries/python) documentation for more information. |
There was a problem hiding this comment.
That's a good caveat, but maybe should be called out as a note. Since we are having folks install FusionAuth using docker, they won't be doing this on an existing system.
If you write it as a note, let's make it abstract enough we can push it through to the other tutorials.
| fusionauth_api_key=<your API key> python setup.py | ||
| ``` | ||
|
|
||
| If you are using PowerShell, you will need to set the environment variable in a separate command before executing the script. |
There was a problem hiding this comment.
Thanks for this. We should push this across the other tutorials. You can leave that as a task for me.
|
|
||
| Now, create a new `requirements.txt` file to include {{page.technology}}. Add the `flask`, `python-dotenv`, and `authlib` plugins so that your requirements file looks like this: | ||
|
|
||
| ```text |
There was a problem hiding this comment.
Moved this over to https://github.com/fusionauth/fusionauth-example-python-flask-guide
| You can now start writing the code for your Flask application. Create a new file called `server.py` and add the following import statements into it: | ||
|
|
||
| ```python | ||
| import json |
There was a problem hiding this comment.
For these, we tend to put the whole file in at once, not breaking it down addition by addition.
This means you can use remote_include to pull in the entire file and you don't need to breakdown what is happening.
Co-authored-by: Dan Moore <github@mooreds.com>
# Conflicts: # site/_layouts/doc.liquid # site/docs/v1/tech/tutorials/index.adoc
No description provided.