MentorShip connects professionals in the technology industry with aspiring coders.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
MentorShip’s purpose is to make finding and choosing mentors for She Codes workshops seamless. This repository hosts the code for the back end of the website. You can find the front end repository here. The deployed DRF project can be found here
To get a local copy up and running follow these simple steps.
python
pip
- unrestricted execution policy (Windows requirement)
-
Clone the repo
git clone https://github.com/SheCodesAus/layer_8_victory_backend_bris_2023.git
-
Create the local environment
python -m venv venv
-
Activate the virtual environment
- navigate to the folder that contains the
requirements.txt
file- If you're on a windows machine, run the command
. venv/Scripts/activate
- If you're on a linux machine, run the command
source venv/bin/activate
- navigate to the folder that contains the
-
Install the required libraries
python -m pip install -r requirements.txt
-
Make initial migrations
cd mentorship python manage.py migrate
-
Run the server
python manage.py runserver
- Use the url http://127.0.0.1:8000/, your favourite API Tool (e.g. Insomnia, Postman) and refer to the API Specifications to create HTTP requests
- When you're finished press CTRL+C to quit the server
- Deactivate the virtual environment by either using the command
deactivate
or terminate your terminal session.
HTTP Method | Url | Purpose | Request Body | Successful Response Code | Authentication Authorization |
---|---|---|---|---|---|
GET | events/ | Return all events | N/A | 200 | N/A to see published events. Must be authenticated as staff to see unpublished events |
GET | mentor-events/ | Return all mentor event registrations | N/A | 200 | N/A to see confirmed records. Must be authenticated as staff to see all. Authenticated mentors can see their own records. |
GET | users/ | Return all users | N/A | 200 | Bearer Token authentication. Staff user can view list of all users. Non staff user will only return own user object. |
GET | skills/ | Return all skills | N/A | 200 | N/A |
GET | mentor-events/self | Return records for own event registration records | N/A | 200 | Bearer Token authentication. |
POST | events/ | Create a new event | event object | 201 | Bearer Token authentication. Only available to staff users. |
POST | mentor-events/ | Register mentor against event | event_id, mentor_id (mentor_id only required if request is made by staff user) | 201 | Bearer Token authentication. Only available to users with onboarding_status of "Ready". |
POST | skills/ | Create a new skill | skill name | 201 | Bearer Token authentication. Only available to staff users. |
POST | users/ | Create a new user | user object | 201 | N/A for creating general mentors. Must be authenticated as a staff user if creating another staff user |
POST | api-token-auth/ | Obtain Bearer Token for Authorisation | username and password | 200 | N/A |
PUT | events/< int:pk >/ | Update event | event object or event field | 201 | Bearer Token authentication. Only available to staff users. |
PUT | mentor-events/< int:pk >/ | Update mentor-event record | available and/or confirmed fields | 201 | Bearer Token authentication. Mentors can update the available field of own record only. Staff users can update both fields for any record. |
PUT | users/< int:pk >/ | Update user | user object or user field | 201 | Bearer Token authentication. Mentors can update the available field of own record only. Staff users can update both fields for any record. |
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Mentorship was created by
- Andrea del Pilar Rivera Peña
- Jenny Waller
- Maya Dominice
- Oriyan Nadav
- Rosie Maguire
If you would like to get in contact with the application creators, you can do so by emailing [email protected]