revised 05-Sep-2023
For an institutional website, the need to have specific pages or areas designated as private and accessible only to authorized person is often felt. The demo here provides a learning environment but also a beginning of such an equipped website.
Found on an intergration of Flask-Login, the example below relies heavily on the example with its code base here.It is expanded to fit within a three page website with a contact page to show its abilities. As always, glance throught the README file and the __init__.py files for a better understanding of the app.
Download this compressed folder: flklogin.tar.gz (19Kb) and upload it (eg. via Filezilla - FTP client) to a home directory (eg. /home/sammy).
With the initial virtual environment described in the Flask 3pg Site and assuming a Debian 10 environment:
The app will now be served on http://0.0.0.0:5000 and one can see the app via the browser at http://(MyIP or MyDomain):5000 and logon with your Admin details
In preparing the app to run through at webserver, one could use uwsgi and by doing the following:
a. Create in directory: /home/sammy/flklogin the file: wsgi.py:
Enter the following commands:
Note:
1. The above confirms if the settings within wsgi.py are correct. The app should be seen via the browser at http://(MyIP or MyDomain):5000 Using a similar setup described in Step#3 (PartB) in Flask 3pg Site, one can establish the service to be render by the webserver.
2. Set the 'debug' to False in the __init__.py file
Flask Blog Demo | Advance Flask |
Flask Security-Roles Demo |