Forums

Sublime Text and PythonAnywhereEditor

Hey everyone, habits are hard to break and this is what I've been using for a long while so I thought I'd ask here because it does look like something broke in it! https://github.com/kutu/PythonAnywhereEditor

Before I start messing things up in the plugin itself like I did when the CSRF token was added I'd like to ask if there were any changes in the way Pythonanywhere handles their login.

I did read the blog and it didn't really point me in any specific direction so if there could be any help in merit that'd be great. As far as the specifics of the plugin go, what it does to login is simply send a POST request to the /login/ page with csrftoken/username/password and the referer using urrlib2, but looks like that's not enough anymore, rather, some fix is needed in the request as a "HTTP Error 400: Bad Request" is returned.

Any help is greatly appreciated, thank you.

Hi there,

Do you know approximately what time it broke? (or when it was last successful? eg: a week ago? a day ago? a month ago?) we did change the login page a little bit for two factor auth awhile ago.

I'm thinking most likely you'd need to post the request with csrf token, auth-username, auth-password, login_view-current_step (== auth) as the post parameters (we might have changed the param names?)

Conrad

I can almost assuredly say that the plugin and the request itself in the code was working at the end of August. Unfortunately I would not be able to pinpoint a more specific timeframe.

I'm going to double check the POST parameters' names and see if I can manage to understand where to grab login_view-current_step. Thanks a lot for the reply for the time being.

Any update on this? I've been looking into using SSH on Sublime, but this looks easier, assuming I can get it to work.

I'm trying the sublime editor but you cannot see the files that you have in the server (like with filezila).

I was able to open a file successful (or so it says in the console), but the file doesn't show any code, it opens as a blank file:

[2018-11-08 18:14:52.706000] open file /home/pedromoisescamacho/pricing_report_v15.py ... success

I don't think this Sublime editor extension has worked for a long time (all the other posts here are from 2017) I think the original author abandoned it.

I found a solution.

if you have Pycharm, you can integrate PA with pycharm over SSH.

you can browse your files and open a console from PA in Pycharm... it's pretty neat.

here is a link to it

https://confluence.jetbrains.com/display/PYH/Using+the+PyCharm+built-in+SSH+terminal+and+remote+SSH+external+tools

[edit by admin: made link clickable]

Excellent! Thanks for posting that :-)