Skip to content

e-questtech/equestlms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Equesttech

A platform for teaching and mentoring students in tech

Useful links

Requirements

  • Python / Django 3.2

Project setup

If not using docker, you can setup a virtual environment using the command below

python -m venv env

then activate it with

./env/Scripts/activate   # windows or
source env/bin/activate  # linux or mac

Install required packages

Run the command below

python -m pip install -r requirements/local.txt

Once the virtual environment has been activated, install the necessary requirements by using the command below

python manage.py migrate

Database backups and restore

Sometimes you may want to delete your database but don't want to lose your data. To do this, run the following script

Backup command

python -Xutf8 manage.py dumpdata --natural-primary --exclude=contenttypes --exclude=auth.permission --exclude=admin.logentry --exclude=sessions.session > ../data.json

Restore command

python manage.py loaddata ../data.json

Important steps

Pre development

  • Go to the GitHub issue board (https://github.com/users/Victhereum/projects/4)
  • In the selected for development lane, choose a ticket an assign to yourself
  • Move the chosen ticket to in progress
  • Create a branch in your local pc but branching from the develop branch.
git checkout develop
git checkout -b EQU-1-lowercased-short-description

Dev complete

  • Once coding is done, run git commit -m "short description"
  • run the scripts.sh script.
  • Alternatively, you can manually run the commands below
pylint $(git ls-files '*.py')
flake8
python manage.py test --keepdb -v 2
  • If successful, git push your code to GitHub
  • Create a merge request using the link generated from the terminal

Dev complete

  • Notify two colleagues to perform code reviews
  • If code review is successful, merge to develop and move ticket to closed lane on GitHub

Contribution

Pick a ticket on the GitHub repository. If you haven't cloned the repository, use the command to clone from the terminal

git clone https://github.com/Victhereum/equestlms.git

When creating a new branch, ENSURE that the branch name starts with the format SSS-<issue-no>-<short-description> e.g. EQU-1-project-setup and the main branch is from develop. use the command below when creating a new branch.

git checkout develop
git branch -b <branch name>

Before creating a pull request, run the commands and fix any warning/errors encountered

sh ./scripts.sh

git add .
git commit -m "my commit message"
git push -u origin <branch name>

Note: You will need to have isort, autopep8, black and pylint installed for this to work and you can install it using the commands below.

python -m pip install autopep8 pylint isort flake8

When creating a pull request, please select the target branch as develop.

  • After writing your code, make sure to run the scripts.sh file and ENSURE it passes before pushing to the git repository. Use the command below to run the test.
sh ./scripts.sh

Pushing to the repository

Please run

pre-commit install

Run the following command

 # stage your commits
$ git add .
 # Commit
$ git commit -m "short desrciption"
 # if pushing for the first time
$ git push -u origin <branchname>

# if pushing normally
$ git push

Installing make

# Install make on windows
choco install make

# Linux or mac
sudo apt install make

Using make command

  • Export database content as json for backup purposes
make backup
  • Creates a virtual environment in current working directory
make env
  • Fixes your database if it gets corrupted. Creates a backup and also restore current data
make fixdb
  • Displays help text on how to use the makefile
make help
  • Syncs the project dependencies
make install
  • Checks if code is conforming to best practices like PEP8
make lint
  • Runs makemigrations and migrate commands
make migrate
  • Pushes committed changes to the GitHub remote repository
make push
  • Loads previously backed up data into the database
make restore
  • Spawns the Django server
make server
  • Runs unit test
make test
  • Syncs the project dependencies
make update

DOKCER

  1. Build the image
docker compose -f local.yml build
  1. Spin it up
docker compose -f local.yml up

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •