Request for data entry form

I am interested in what I met when I registered on the wakari website. I entered my username, which was something like abc.def.ghi and all other information, and submitted the form (or at least tried to submit!). This generated an error saying that "username must be a valid python variable", so they obviously did something in their back-end with usernames as python variables. Someone explain to me if this is some kind of design scheme that they use in which they store user information like python variables or something like that. Again, I apologize because this is not a very specific programming issue, but it eats me up and I need to know why this happened.

The following is the url:

https://www.wakari.io/usermgmt/loginorregister

+4
source share
2 answers

This is a pure hypothesis. One thing I could see is doing wakiri, using usernames as the module name for your code. It might be interesting. So, save the user code as wakiri.<username> . Then the application can import wakiri.<username> with interesting material in __init__.py , which runs everything it finds.

Maybe this. Or maybe they store user code in files on disk. Maybe the user code is written to a file containing many dictionaries containing the code and named after the username?

Perhaps they don’t even use it and just think it’s nice to limit people to actual Python variables.

+1
source

I am a Wakari developer, and we just understood this question. The short option is that you are safe enough with a valid UNIX username, and the text "error" should say something using a more efficient "plain English" for this.

The reason we say that the username must be a valid Python module name is because we imagine the day that users can have something like ~/public_python as a place to host direct access code, and then others users can access this through something like from wakari.users import steve . We will leave this for you to find out if trusting the steve user is steve to import his code directly.

0
source

Source: https://habr.com/ru/post/1445177/


All Articles