tomgranuja / CayumanDjango

School workshops inscription web form for students enrollment.
0 stars 0 forks source link

Cayuman - School workshops inscription web form for students enrollment

Install

Cayuman makes use of poetry and python3.10 or superior. Let's go step by step

Installing python3.10

If you don't have the required python version installed then you can do so by following these instructions. Otherwise You can skip this section.

Start by installing pyenv, a python module that makes it easy to manage several different python versions.

$ curl https://pyenv.run | bash

Then add pyenv to .bash_profile or your shell's profile file

# pyenv
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Remember to run source ~/.bash_profile (or whatever's the name of your shell profile file) after adding the lines above.

Now install python3.10 by doing

$ pyenv install 3.8

Instaling poetry and getting your dev instance ready

Now it's time to install poetry

$ pip install poetry

Then clone the repo

$ git clone git@github.com:tomgranuja/CayumanDjango.git

and install the dev environment

$ cd CayumanDjango
$ poetry install --with test

Install pre-commit hooks (to enforce coding standards)

$ poetry run pre-commit install

Running Tests

In order to run our tests you just have to do

$ poetry run pytest

Applying migrations

$ poetry run python manage.py migrate

Creating First Super User

$ poetry run python manage.py createsuperuser

Running dev server

$ poetry run python manage.py runserver

Generating new migrations

$ poetry run python manage.py makemigrations

Manage translation

# Update translation file
$ poetry run python manage.py makemessages -l es

# Compile translation file
$ poetry run python manage.py compilemessages

# restart django server or webserver for changes to take effect

Maintenance mode

If there's a need to set cayuman as maintenance mode, you must run this command

$ python manage.py maintenance_mode <on|off>

Conventions

These are some conventions or design decisions made by this project, which are not currently enforced by code or may not be so clear just from using it: