Django and python3.x based website for Datateknologerna vid Åbo Akademi rf
This project requires Docker and Docker Compose
A local django-admin
is required for translations
Development happens mainly in the develop
-branch
Create a copy of example.env
and change example
to your local username with the following command:
cp example.env $USER.env
Eg. otto.env
Edit the file you just created to match your setup.
This must be done every time you start your terminal or edit the profile file!
In the terminal, navigate to the root of the project, where your .env
file is located.
Run the command source $USER.env
Now you can run all date-
commands!
Start the server with
date-start
and make sure everything starts ok.
If the date-start
command complains about docker not being found, make sure that your user account is in the docker
group (with command groups $USER
). If it is not, run usermod -aG docker $USER
, and restart your bash session!
If you want a clean database you can run the
date-migrate
command after everything has started correctly. Otherwise continue on to the next step.
This will completely delete and recreate the database (all existing data will be lost)
If you want initial development data run the script clean-init.sh
in the folder scripts/
.
If you get an illegal option error
in your shell, use /bin/bash clean-init.sh
to run the script instead.
After this you can re-run the date-createsuperuser.
Visit http://localhost:8000 or whatever your port is.
The admin page is at http://localhost:8000/admin
NOTE: No need to implement yet
Locales (stupidly called language codes) used in this project
The actual language code will be one of
As the the default language is sv
,
we only need to create translations in the language fi
.
To generate the translation file, called django.po
is done by executing the following command in the root directory of the project
$ django-admin makemessages -l fi
This creates/updates the django.po
in date-website/locale/fi/LC_MESSAGES
.
Add translations to the empty fields or use a third party translation software,
such as Poedit
.
To compile the translations to django.mo
, use the following command
$ django-admin compilemessages
For minor version upgrades change the DATE_POSTGRESQL_VERSION
environment variable.
This script will wipe out ALL data from the volume \ MAKE SURE YOU HAVE PROPER BACKUPS BEFORE ATTEMPTING THIS
If the dump command fails all data may be lost.
Run
DATE_POSTGRESQL_VERSION
is set to the CURRENT version before running the following command./update-postgres.sh target_version [env_file]
after which you have to update your environment variables using
source ${USER}.env