shield shield shield Postgres shield DjangoREST shield shield shield

Description

EpicEvent is a CRM to handle clients, events and contracts.

Prerequisites

  • Python 3
  • Pip

Installation

To clone the repository, you can download the zip or clone either HTTPS or SSH. And when you are in the repository you can activate your virtual environement.

On Linux or Mac

$ pip install virtualenv
$ virtualenv venv --python=python3
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt

On Windows

c:\Python38\python -m venv c:\path\to\myenv
C:\\{venv}\\Scripts\\activate.bat
pip install -r requirements.txt

If you want to use pipenv

  • 1 - install pipenv
$ pip install --user pipenv
  • 2 - install dependencies
$ cd myproject
$ pip install -r requirements.txt
  • 3 - activate the virtual environnement
$ pipenv shell

Database setup

1 - Install PostgreSql

sudo apt-get install postgresql postgresql-contrib

2 - Connect to postgres

sudo -i -u postgres psql

3 - Choose database

postgres=# \c epic;

4 - Create the database

create database epic;

Quickstart

To create a superuser:

python manage.py createsuperuser

This will allow you to connect to the admin panel.

To see the website in local, run this command :

python manage.py runserver

When you launch this command, it will start the website on http://127.0.0.1:8000. You can create a user or you can login if you have already created one.

You can also create users from shell:

python manage.py shell
from django.contrib.auth.models import User
User.objects.create_user('foo', password='bar')

If you want to give some permissions:

python manage.py shell
from django.contrib.auth.models import User
user = User.objects.create_user('foo', password='bar')
user.is_superuser=True
user.is_staff=True
user.save()

Code Style

flake8 .

To get a report. It will create a directory named "flake8-report". Then you can open index.html in a browser.

flake8 --format=html --htmldir=flake8-report

To check types of the project.

mypy .

Tests

To launch all tests :

pytest

To get a report. It will create a directory named "htmlcov". Then you can open index.html in a browser.

pytest --cov=. --cov-report html

Contributor

If you have any suggestions to improve the project, you can create an issue.