StadtBank#
Basic Bank System with Web GUI and database
Setup#
Create Environment (Optional)#
To create a virtual environment, run the following command:
python -m venv .venv
Activate virtual environment (for Unix-based systems)#
source .venv/bin/activate
Activate virtual environment (for Windows)#
.venv\scripts\activate
Install Requirements#
Install the required Python Modules
python -m pip install -r requirements.txt
Create Database#
To set up the database, perform the following step:
Apply migration files:
python manage.py migrate
Data Samples#
You can use the bin/randCus.py and bin/randAct.py for generating sample data for your database.
Running Server#
After all setup, you can run the program with:
python manage.py runserver
Note
Use --insecure
if you can’t get Static Files
Admin GUI#
To access the admin GUI, you need to create a superuser account first. Run the following command:
python manage.py createsuperuser
Note
Alternatively, you can run bin/userSetup.py for account setup
For access, you need to go to http://IP_ADDRESS/admin
Note
Please ensure that your database migrations are applied before running the createsuperuser
command.
Compile Languages#
StadtBank has a multi-language system. You can find the translations in Bank/locale. You need to compile them to see the translations.
python manage.py compilemessages
Improve or add Translations#
Improve Translations#
You can change the msgstr
in the *.po
files. Every text has a
msgid
, and above them, you can see where they are used.
Add Translations#
python manage.py makemessages -l LANGUAGE_CODE
HTTPS Server#
It is still in development. I’m not very good with it. Up to now, I have only done what I found on the internet for it. You can find the links in settings.py.
Create Certificates#
You can run this command:
openssl req -x509 -newkey rsa:4096 -keyout certs/server.key -out certs/server.pem -days 365 -nodes
Alternatively, you can use the certs/file.sh for CA certificates.
Note
CHECK THE CONFIGURATION IN certs/file.sh BEFORE RUNNING IT!!!
Run Server#
python manage.py runserver_plus --cert-file certs/server.pem --key-file certs/server.key --insecure 127.0.0.1:443