Skip to content

Complete customer assignment with dashboard and step for step guide.

License

Notifications You must be signed in to change notification settings

seaic/cmshrcompass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMS HRCompass

Manage workflow of Dynamics 365 Business Central customer assignment.

Overview

Material designed for Django.
Tested with Django 3.1, python 3.8.5 and mariadb 10.5.5 (and other databases)

The program contains:

  • login page with two-factor authentification
  • task overview with filters
  • different edit pages
  • reporting overview
  • admin page

Image Login
Image Token Image Table
Image Statistic Image Statistic

Requirements

This tools are required for the installation:

Installation

Install packages:

pip install django-otp   
pip install django-two-factor-auth[phonenumbers] 
pip install sqlclient
pip install matplot
pip install xlsxwriter
pip install django-session-timeout
pip install mixer
pip install djecrety

Problem with sqlclient installation

If there is any problem to install the sqlclient on a windows. To install the binary package follow this steps.

pip install mysqlclient-1.4.6-cp38-none-win32.whl

Download Package:

Create database:

Create database and tables for application

Mysql(MariaDB):

mysql -u username -p password
CREATE DATABASE django_db;

PostgreSQL:

psql -u username
CREATE DATABASE django_db;

SQLite:

sqlite3 django_db.db

Edit models.py:
Change by every class meta the following parameter:

managed = True #False

Create tables:

python manage.py makemigrations
python manage.py migrate

Settings:

Before we can start the server we have to edit the DATABASE in settings.py
Do not forget to set the environment variables SECRET_KEY and DATABASE_PASSWORD

Generate SECRET_KEY

python manage.py djecrety
SECRET_KEY = get_env_value('SECRET_KEY')

DATABASES = {  
    'default': {  
        'ENGINE': 'django.db.backends.mysql', 
        'NAME': 'django_db',  
        'USER': 'root',  
        'PASSWORD': get_env_value('DATABASE_PASSWORD'),  
        'HOST': 'localhost',  
        'PORT': '3306',  
    }  
}  

Tests

Automated testing is helpful for detecting errors. Test should rund after changes. Tests are stored in test.py.
Run tests:

python manage.py test

Start Server:

Go to the root directory in your project and start the server.

python manage.py runserver  

Open: http://127.0.0.1:8000

Create Production Environment

On a webserver:

  • Install python, python-devel and nginx

  • Install dependencies:

    pip install django django-otp django-two-factor-auth[phonenumbers] psycopg2-binary matplot xlswriter django-session-timeout mixer djecrety
    
    pip install gunicorn
    
  • Copy the content of your project into /opt/[yourproject]

    chown -R nginx:niginx /opt/[yourproject]
    
  • Create a service for gunicorn, see https://www.howtoforge.com/how-to-install-django-on-centos-8/

  • Configure Nginx for Django, see link above

  • Change DEBUG = True to False in settings.py

  • Apply css to admin site in production

    python manage.py collectstatic
    
  • Generate SECRET_KEY

    python manage.py djecrety
    
  • Change database
    Edit the DATABASE in settings.py Do not forget to set the environment variables SECRET_KEY and DATABASE_PASSWORD

  • Add tables to database
    Set parameter managed to true in models.py

    python manage.py makemigrations hrcompass
    python manage.py migrate
    
  • Start server and give rights

     chown -R nginx:nginx cmshrcompass
     systemctl start gunicorn
     systemctl start nginx
    

    Done!

Getting help

For general questions regarding this package, please hop over to Stack Overflow. If you think there is an issue with this package, check if the issue is already listed (either open or closed), and file an issue if it's not.

Contribute

For Contribution please use the Github functions:

Releases

Need a stable release? You can find them at releases

Links

The tutorial is composed of the following tutorials:

Licensing

This project is licensed under the MIT license.

About

Complete customer assignment with dashboard and step for step guide.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published