A company management system that allow a general admin to create and remove companies and allow company admins to add or remove employees to the company or to teams.
- Linux-based system
- Python 3.6
- Install pip and vitualenv:
sudo apt-get install -y virtualenv
sudo apt-get install -y python3-pip
- Create a virtual environment:
virtualenv -p python3 ~/.virtualenvs/company_management
- Activate
company_management
virtual environment:
source ~/.virtualenvs/company_management/bin/activate
- Install requirements in the virtual environment:
pip3 install -r requirements.txt
- Run the project:
python manage.py runserver
- Install components for Ubuntu:
sudo apt-get update
sudo apt-get install python-dev libpq-dev postgresql postgresql-contrib
- Switch to postgres (PostgreSQL administrative user):
sudo su postgres
- Log into a Postgres session:
psql
- Create database with name company_management:
CREATE DATABASE company_management;
- Create a database user which we will use to connect to the database:
CREATE USER company_management_user WITH PASSWORD 'company_management_pass';
- Modify a few of the connection parameters for the user we just created:
ALTER ROLE company_management_user SET client_encoding TO 'utf8';
ALTER ROLE company_management_user SET default_transaction_isolation TO 'read committed';
ALTER ROLE company_management_user SET timezone TO 'UTC';
- Give our database user access rights to the database we created:
GRANT ALL PRIVILEGES ON DATABASE company_management TO company_management_user;
- Exit the SQL prompt and the postgres user's shell session:
\q
thenexit
- Activate the virtual environment:
source ~/.virtualenvs/company_management/bin/activate
- Make Django database migrations:
python manage.py makemigrations
then:python manage.py migrate
- Create an admin user:
python manage.py createsuperuser
- Run the project locally:
python manage.py runserver
- Navigate to:
http://localhost:8000/admin/