Professional Documents
Culture Documents
what is backref
Part 6:
when registerd with the same email getting the ugly error sqlalhemy integrity error
do not the application in debug mode when deployed in production.
flask_login package
login_user is used to login
Login_manager = https://flask-login.readthedocs.io/en/latest/
whenever the login is required the previosuly accessed page will be stored in the
args dictionary and the value if it exist redirect to the particular page
next_page = request.args.get('next')
redirect(next_page) if next_page else redirect(url_for('home'))
part 7:
User account page:
profile pciture upload
account.html ---> picture upload
filefield and file allowed validator for wt kind of file needs to be updated,
enctype which is used to encode the data during the post request
save_picture
logic to save the uploaded picture in the profile
Os module video
part 8:
abort(403)
part 9 : Pagination
s = Serializer('secret', 30)
token = s.dumps({'user_id': 1}).decode('utf-8')
Signature expired
decode.utf -----?
Generate a app password and enable 2 factor authentication so that it will enale to
send the mail
why 2 factor authentication.
what its dangerous lib how does it work using the json web token
part11 :
Users blueprint
errors
500 error
why we have to
@errors.app_errorhander(404)
def error_404(error):
return render_template('errors/404.html'), 404
sudo vi /etc/nginx/sites-enabled/flask_blog
ngnix documentation
gunicron documenation
supervisor
stderr_logfile=/var/log/flaskblog/flaskblog.err.log
stdout_logfile=/var/log/flaskblog/flaskblog.out.log