Help talk:Toolforge/My first Django OAuth tool

From Wikitech
Jump to navigation Jump to search

Venv activate

@BryanDavis: Do you know how to correctly export the environment variables in venv/bin/activate? Locally I am using this service:

Description=uWSGI instance to serve myapp

ExecStartPre=-/usr/bin/bash -c 'mkdir -p /run/uwsgi; chown tobias:nginx /run/uwsgi'
ExecStart=/usr/bin/bash -c 'cd /home/tobias/git/my-first-django-oauth-app/src; source /home/tobias/git/venv-my-first-django-oauth-app/bin/activate; uwsgi --ini app.ini'


But on ToolLabs I am not sure how to go through the venv activate step that exports the variables. Currently I just have the keys in the, but that is not as nice for source control. --Tobias47n9e (talk) 15:44, 12 March 2017 (UTC)

The webservice script will automatically activate a virtual environment by using the --venv argument to uwsgi when the $HOME/www/python/venv directory exists. When you are doing something outside of the webservice script, the easiest way to handle this is with a small shell script that sets up the environment and then uses exec to run the main python script. --BryanDavis (talk) 22:24, 12 March 2017 (UTC)


What is the use of Django OAuth tool? Avnerk (talk) 07:28, 27 April 2017 (UTC)

@Avnerk: I think that is better explained at - This page is just about one of many technical implementations for a tool that authenticates with Wikipedia (or for any Mediawiki with OAuth extension for that matter). Let me know if that answer was helpful! --Tobias47n9e (talk) 06:50, 15 August 2017 (UTC)


Under Adding OAuth, should MIDDLEWARE_CLASSES be changed to MIDDLEWARE? The later is what's used in modern django versions. RoySmith (talk) 01:36, 21 September 2019 (UTC)