Package: terraso-allauth
Terraso django-allauth providerPluggableDjangoapp to addTerrasoas a provider todjango-allauth.InstallationInstall the latest version of theterraso-allauthpackage running:pipinstallterraso-allauthAdd theterraso_allauthapp to the Django'sINSTALLED_APPSalong with properdjango-allauthapps.INSTALLED_APPS=[# ..."allauth","allauth.account","allauth.socialaccount","terraso_allauth",# ...]Add Terraso configuration to theSOCIALACCOUNT_PROVIDERSon settings:SOCIALACCOUNT_PROVIDERS={...'terraso':{'SCOPE':['email','openid','profile',],},...}Optionally, you can set aTERRASO_BASE_API_URLto integrate with a Terraso instance differently from the default one. On yoursettings.py:TERRSO_BASE_API_URL="https://your.terraso.org"UsageThe Terraso's URL for authorization, token exchange and profile information is automatically loaded bydjango-allauthfollowing its default standards. If the installation processed described above was done correctly, you should now be able to start the OAuth authorization flow, accessing the proper Terraso authorization URL. For example:<form action="{%url"terraso_login"%}" method="post">{%csrf_token%}<button type="submit">Login with Terraso</button></form>DevelopmentInstalling development dependenciesWe highly recommend creating a localvirtualenvfor local development.To haveterraso-allauthset up locally for development, it's only a matter of installing a few development libraries. The following helper make action can help:makeinstall-devUpdating dependenciesAll project dependencies are set in the requirements files located under therequirements/directory. The project is expected to run (and be tested) against different Django versions. That's the reason for similar requirement files.If a dependency need to be added (or updated)do not change any requirement*.txt file. Instead, update the properrequirement*.infile.Allrequirement*.txtfile are generated bypip-tools. To generate them, you can run the helper make actions below:makelock
makelock-devRunning the testsBefore running tests, make sure you have the localdjango-allauthlibrary installed in yourvirtualenv. It's recommended to installed it in edit mode:pipinstall-e.The tests can be run callingpyteston library directory (the same directory of this README file):pytestImportant: make sure you have the development dependencies installed.make install-devcan make the job.Running the tests across different environmentsThe project usestoxto run the tests on all supported environments (different Python and Django versions). The current setup relies onpyenvto load different Python versions. So, make sure you have your environment ready for it.To runtox, we recommend running it in parallel:tox-pBuilding and releasingBefore building a new version to release, make sure a new git tag was created for the version. Then, run the following command to create a new build:python-mbuildRunning the above command on the project directory, a new Python wheel will be created and properly versioned and named based on the git tags.After a new wheel was created, make sure you have thetwinePython lib installed:pip install twine. Then, run the following command to upload the recent created wheel to PyPI:python-mtwineupload--verbosedist/*It will be necessary to inform the PyPI username and password to successfully upload the packages.More information about packaging and distributing Python packages can be
found onofficial documentation.