- ReactJS
- Redux
- Material-UI.
- Django
- Django rest framework(DRF)
- PostgreSQL.
- Token authentication.
- REST based.
brew install postgres
psql postgres
create role admin with login password '1234';
\q
psql postgres -U admin
create database training;
GRANT ALL PRIVILEGES ON DATABASE training TO admin;
- Go to backend folder lets_train_backend
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
- python manage.py makemigrations
- python manage.py migrate
- python manage.py runserver
- Go to frontend folder lets_train_ui
- npm install
- npm start
-
Comment authentication in lets_train_backend/api_app/views.py
# authentication_classes = (TokenAuthentication,)
# permission_classes = (IsAdminOrReadOnly, )
-
URL: localhost:8000/api/user/
-
Method: POST
-
JSON: [{
"username":"1234", "first_name":"admin", "last_name":"", "email":"admin@localhost.com", "password":"1234", "userprofile":{ "employee_code":"00000" }, "is_staff": true
}]
-
This will create an admin user with username 1234 and password 1234
-
Uncomment authentication in lets_train_backend/api_app/views.py
- Go to backend folder lets_train_backend
- source venv/bin/activate
- python manage.py runserver
- Go to frontend folder lets_train_ui
- npm start
- Go to localhost:3000/admin/ on your browser.
- Go to localhost:3000/ on your browser.
- Categories are used to classify the Trainings.
- Departments are the divisions made by the organisation.
- Training can have a Category.
- Training can have a Department.
- Training can have multiple Contents.
- Content can be a part of multiple Trainings.