Training django and DRF project.
Part of Open Classrooms "DA Python" formation, 12th Project.
EpicEvents CRM is composed of an admin interface for managers, sales team and support team members on one hand, and an API for front ends destined to sales team and support team members on the other hand.
It is designed to manage data concerning clients, contracts they make with sales team members and events managed by support team members.
You can consult the ER diagram here.
You need Python 3 (tested on 3.10), git and venv installed on your machine.
Open a terminal and navigate into the folder you want EpicEvent CRM to be downloaded, and run the following commands:
- On Linux or macOS:
git clone https://github.com/YoannDeb/EpicEvents.git
cd EpicEvents
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt- On Windows:
git clone https://github.com/YoannDeb/EpicEvents.git
cd EpicEvents
python -m venv env
env\Scripts\activate
pip install -r requirements.txtYou first must install postgresSQL and configure a database.
See official PostgreSQL doc and official Django doc for more info.
You need to create a database for the app, and then configure it in epicevents/settings.py.
Open a terminal and navigate into the root of the project (i.e. the folder where is situated manage.py) , and run the following commands:
python manage.py makemigrations
python manage.py migrate
python manage.py collectstaticOpen a terminal and navigate into the root of the project (i.e. the folder where is situated manage.py) , and run the following command:
python manage.py createsuperuserYou will be prompted an email, first and last name, and a password. That's it, the superuser is created !
Open a terminal and navigate into the root of the project (i.e. same folder than manager.py), and run the following command:
python manage.py runserverThe admin page will be accessible at http://127.0.0.1:8000/admin. You can then login with previously created superuser email and password. It is now possible to populate the database, with some sales or support team members (don't forget to assign roles).
API will be accessible (with Postman for example) at http://127.0.0.1:8000 .
Once server is running, API specifications are accessible on those urls with different formats:
- JSON view: http://127.0.0.1/swagger.json
- YAML view: http://127.0.0.1/swagger.yaml
- Swagger-ui view: http://127.0.0.1/swagger/
- ReDoc view: http://127.0.0.1/redoc/
Logs are registered in two files at the root of the project (i.e. same folder than manager.py):
- debug.log, which shows all messages, but only activated if DEBUG is set to True in epicevents/settings.py
- warning.log which shows messages from WARNING level and above. It is always active.