---
# System prepended metadata

title: Troubleshooting

---

## What we use

The whole setup is based on VirtualBox virtual machine wrapped on a high level with Vagrant. We are using setup provided by [@florczakraf](https://github.com/florczakraf) and modified in [PR #888](https://github.com/iiuni/projektzapisy/pull/888/).

The whole system is based on Django and PostgreSQL.

## Environment setup

1. Install VirtualBox and Vagrant.
2. Clone this repository ( https://github.com/iiuni/projektzapisy ). Its directory will be shared with the virtual machine. Let's call it **project directory**. The root directory of Django application — `zapisy` — will be called **app directory**.

## Project setup

1. Skip this point if you want to have empty database. Download a database dump from the `db_backups` Slack channel. You will probably need `7z` to decompress it. Save it somewhere in the _root directory_ so that it can be accessed from the virtual machine.
2. Run `vagrant up` inside *project directory*.
3. In development database dumps every user has their password set to `pass`. If you need an account with administrative privileges, use `mbiernacka`.
4. Run `vagrant provision` inside *project directory* to setup database again.

## Running the server

Only thing you have to do is run `vagrant up` inside *project directory* and wait a few minutes.
Every service you need will run automatically. If you need see logs from Django Runserver service or yarn service:
1. SSH into your virtual machine (run `vagrant ssh` in *project directory*).
2. Execute `journalctl -u runserver.service -f` or `journalctl -u yarn_devw.service -f`

## Worth noting

* You can quit the VM with `exit` command (or just CTRL-D)
* You can safely turn off the virtual machine by running `vagrant halt` inside the _project directory_ (when you're outside the VM).

# Troubleshooting

### Error when launching Django's server - `ValueError: unknown locale: UTF-8`

You most probably are a Mac user. You just need to export some variables in your shell's configuration.

For Bash users, add the lines listed below to `~/.bash_profile`. For ZSH users, it's `~/.zshrc`:

````
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
````