Jump to content

Help talk:Toolforge/My first Flask OAuth tool/Archives/2018

From Wikitech
Warning! Please do not post any new comments on this page. This is a discussion archive See current discussion or the archives index.

Making the tool HTTPS only

Using toolforge helper library:

from flask import Flask
import toolforge

app = Flask(__name__)
app.before_request(toolforge.redirect_to_https)

Is this beginner enough to mention in the tutorial? Or should it just be a footnote? legoktm (talk) 07:54, 26 August 2017 (UTC)Reply

I think either would be fine, but it might be easiest to add in as a "what next" step. That could be as easy as linking to User:Legoktm/toolforge library. --BryanDavis (talk) 17:51, 26 August 2017 (UTC)Reply
Yes Done I added Bryan’s suggestion for now. --Lucas Werkmeister (WMDE) (talk) 09:29, 19 June 2018 (UTC)Reply

virtualenv not present in kubernetes container

@APerson:, I feel that edit that you made about using virtualenv is misleading. There is no virtualenv script installed inside the Kubernetes python container. I think that it is possible that the command you provided will work from a Toolforge bastion, but even then the generated venv may be subtlety incompatible with the version of Python that is used in the Kubernetes containers.

$ webservice --backend=kubernetes python shell
$ virtualenv $HOME/www/python/venv -p /usr/bin/python3
bash: virtualenv: command not found

I did not want to revert without some discussion here however in case there are other issues that I have missed. Maybe the instruction to perform the commands from within a Kubernetes managed container are not prominent enough? --BryanDavis (talk) 21:47, 7 October 2018 (UTC)Reply

BryanDavis, oh, I see. Yes, I evidently missed the first command. I was going off this discussion on the WMF Phabricator where the command I used was recommended (I found it by searching for the error message I got when trying the normal command). I have amended the section to indicate that you should only get the error message I got if you forgot to run the first command. I'm also fine with removing the paragraph all together if it might confuse users. Thanks for pointing this out! APerson (talk!) 05:31, 8 October 2018 (UTC)Reply