Skip to content

Server Installation And Configuration


You need to install the following dependencies :

  • python3.6
  • Nginx
  • virtualenv

Application Setup

Clone the latest source code from the repository, and I assume you put it to /var/www/html/

$ cd /var/www/html/
$ git clone {repository}
$ cd hujan_ui

With Virtuan Environment

Create virtualenv with python3

$ virtualenv --python=python3.6
$ source/env/bin/activate
$ pip install -r requirements.txt
$ pip install gunicorn

Without Virtual Environment

$ pip3.6 install -r requirements.txt
$ pip3.6 install gunicorn

Then create a configuration file, just copy from sample file and modify as your preference

$ cp hujan_ui/ hujan_ui/

Then run the database migration

$ python migrate

Then create first superuser

$ python createsuperuser
Username (leave blank to use 'root'):
Email address:
Password (again):
Superuser created successfully.

Then generate static files

$ python collectstatic

Create logs directory

$ mkdir logs

Runing the service

python runserver 8001

Then open your browser http://[hujan-ip]:8001 and viola your web apps is already running !

Run Hujan UI as Systemd Service

To run Hujan UI as Systemd, simply you can follow this instruction.

  • Create hujan_ui.service file
# touch /etc/systemd/system/hujan_ui.service
  • Add the following entry.
Description=hujan ui daemon

## Without virtualenv
ExecStart=/usr/local/bin/gunicorn hujan_ui.wsgi --bind --log-level=debug --log-file=logs/gunicorn.log

## With virtualenv
ExecStart=/var/www/html/hujan_ui/env/bin/gunicorn hujan_ui.wsgi --bind --log-level=debug --log-file=logs/gunicorn.log

  • Reload daemon and start the service.
# systemctl daemon-reload
# systemctl start hujan_ui.service