GitHub - Azure-Samples/ms-identity-python-webapp-django: This sample is functional. Please subscribe/watch this repo to receive release notification. · GitHub
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
Clone from
its repo
or download its zip package, and then start using it or build on top of it.
cd project_name
Run pip install -r requirements.txt to install dependencies
Run python manage.py migrate to initialize your Django project
Run python manage.py runserver localhost:5000 and then browse to http://localhost:5000
You may need to change to a different port to match your redirect_uri setup.
Copy this Azure AD B2C template
as .env and then modify .env with your app's settings.
Do not reverse the order of the configuration steps above.
If you put your app credentials into the template and then copy it into .env,
you risk accidentally committing your templates with credentials into Version Control System.
Web App Sign In & Sign Out
With the basic configuration above,
you can now browse to the index page of this sample to try the sign-in/sign-out experience.
Web App Calls a web API
Add the web API's endpoint into your .env file.
Also add the scopes it needs, separated by space.
The following example is the settings needed to call the Microsoft Graph API.
You may need to replace the their values with your own API endpoint and its scope..
You can refer to the
source code of this full sample here
to pick up other minor details, such as how to modify urls.py accordingly,
and how to add templates for this new view (and for the existing index() view).
Contributing
If you find a bug in the sample, please raise the issue on GitHub Issues.
If you'd like to contribute to this sample, see CONTRIBUTING.MD.