M
M
mr.bob2018-12-19 12:01:34
Python
mr.bob, 2018-12-19 12:01:34

How to save an authorized session in a uwsgi + flask + nginx application?

Set up a flask application with uWSGI and nginx on Ubuntu 16.04 (as described here https://www.digitalocean.com/community/tutorials/h...
implemented a simple API method with selenium webdriver in the application:

  1. open the site, check whether it is authorized or not.
  2. if not authorized, I execute an external js file for authorization on the site and for injecting some of my additional functions.
  3. after authorization and working out the function, I take a screenshot and save it on the server.

After completing all the steps and if you do not restart the uWSGI service via
systemctl restart testapp
make a call to another API method, where he simply opens the site and takes a screenshot, then the authorization on the site is saved. But if you restart the service, then authorization disappears and when you try to call the api method through the current profile in the webdriver chrome profile_path, it gives an error.
The error log is here: pasted.co/d7e3db2a
and I don't know how to solve these problems:
  1. how to save an authorized session or even the session itself when the service is restarted.
  2. how to solve the error when executing an external js script when restarting the service.
  3. If you change the webdriver chrome profile_path i.e. use a different profile in the browser then, no error.

I have little experience with this stack and have been looking for answers but haven't found a solution or maybe I'm looking in the wrong place. Can you please suggest or indicate how to solve these problems?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question