Forums

Create session for user login

Hi there I tried to create a user session through my flask app. I've already created my virtualenv, but I got an error message (something went wrong) when I used"

SECRET_KEY_MYSITE=os.environ['SECRET_KEY_MYSITE'] "

in this file: /var/www/mylash_pythonanywhere_com_wsgi.py

Any help would be really appreciated.

Look in your error log to see what the error was.

Hi again I went through the mylash.pythonanywhere.com.error.log but couldn't find related info.

I also followed the following link but no luck

https://www.pythonanywhere.com/forums/topic/3387/

What about your server log?

.

2018-02-19 13:24:18 *** Starting uWSGI 2.0.14 (64bit) on [Mon Feb 19 13:24:15 2018] ***
2018-02-19 13:24:18 compiled with version: 5.4.0 20160609 on 22 November 2017 21:24:09
2018-02-19 13:24:18 os: Linux-4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018
2018-02-19 13:24:18 nodename: giles-liveweb11
2018-02-19 13:24:18 machine: x86_64
2018-02-19 13:24:18 clock source: unix
2018-02-19 13:24:18 pcre jit disabled
2018-02-19 13:24:18 detected number of CPU cores: 2
2018-02-19 13:24:18 current working directory: (unreachable)/etc/uwsgi/vassals
2018-02-19 13:24:18 detected binary path: /usr/local/bin/uwsgi
2018-02-19 13:24:18 *** dumping internal routing table ***
2018-02-19 13:24:18 [rule: 0] subject: path_info regexp: \.svgz$ action: addheader:Content-Encoding:gzip
2018-02-19 13:24:18 *** end of the internal routing table ***

As you can see from the above its all about yesterday!!!

[edit by admin: formatting]

Solved, using info from here, for info: https://www.tutorialspoint.com/flask/flask_sessions.htm Thanks.