StadtBank#

Conventional Commits

Documents

Basic Bank System with Web GUI and database.

Setup#

Create Environment (Optional)#

To create a virtual environment, run the following command:

Activate virtual environment (for Unix-based systems)#

python -m venv .venv
source .venv/bin/activate

Activate virtual environment (for Windows)#

python -m venv .venv
.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:

  • Show up to 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

Or you can run bin/userSetup.py for Account Setup.

For access, go to http://IP_ADDRESS/admin

Warning

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 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 you can see where it is used above it.

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 only did 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

Or you can use certs/file.sh for CA certificate.

Warning

CHECK THE CONFIGURATION IN certs/file.sh BEFORE RUN IT !!!

Run Server#

python manage.py runserver_plus --cert-file certs/server.pem --key-file certs/server.key --insecure 127.0.0.1:443