Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] - All test passed #9

Merged
merged 150 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
ff7c8d7
refactor
williamjmorenor Jan 12, 2022
ac2d8b6
fix: Corrige lista de cursos del instructor
williamjmorenor Jan 16, 2022
3a375cc
Agrega codigo para agregar seccion a un curso.
williamjmorenor Jan 17, 2022
4a2147d
Utiliza codigos uuid para secciones y recursos
williamjmorenor Jan 17, 2022
713b273
fix: Corrige error al crear la DB en potgres
williamjmorenor Jan 17, 2022
d38dcc7
style: Corrige errores reportados por pylint.
williamjmorenor Jan 17, 2022
e42774c
refactor: Reduce cantidad de markup repetido
williamjmorenor Jan 17, 2022
0fe99f8
build: Actualiza Bootstrap Icons
williamjmorenor Jan 17, 2022
00cd6d9
feat: Acordeon para mostrar contenido del curso
williamjmorenor Jan 19, 2022
c4b1649
refactor: Pagina tipo de recurso
williamjmorenor Jan 20, 2022
d82793e
fix: Not require POST
williamjmorenor Jan 20, 2022
4fdecaa
refactor
williamjmorenor Jan 20, 2022
320190c
Agrega indice
williamjmorenor Feb 21, 2022
a4ce184
Agrega info a usuarios predterminados
williamjmorenor Feb 21, 2022
70295ee
Feat: Agrego macro para notificaciones
williamjmorenor Feb 26, 2022
2b9ac92
fix: Notify
williamjmorenor Feb 26, 2022
f4b851e
setup tet
williamjmorenor Feb 26, 2022
233b08a
test unitarios
williamjmorenor Feb 26, 2022
56eb114
pruebas unitarias
williamjmorenor Feb 26, 2022
3d88e68
test
williamjmorenor Feb 26, 2022
46dc788
build: Deploy to DO
williamjmorenor Feb 26, 2022
44c58d7
build: Deploy to Heroku
williamjmorenor Feb 26, 2022
b365c39
build: Deploy to DO
williamjmorenor Feb 26, 2022
4760b38
build: Deploy to Heroku
williamjmorenor Feb 26, 2022
d8e1d82
fix: Heroku postgresql requieres ssl
williamjmorenor Feb 27, 2022
3f00926
fix: Heroku postgresql requieres ssl
williamjmorenor Feb 27, 2022
0ca1c7c
fix: Heroku postgresql requieres ssl
williamjmorenor Feb 27, 2022
a7cc896
build: Heroku likes psycopg
williamjmorenor Feb 27, 2022
e038480
Update README.md
williamjmorenor Feb 27, 2022
ac6c11d
build: Minimal nginx configuration
williamjmorenor Feb 27, 2022
e00087b
Update readme
williamjmorenor Feb 27, 2022
8ddcb53
fix: Corrige permisos instructor
williamjmorenor Mar 2, 2022
b796874
fix: Corrige lista de cursos del instructor
williamjmorenor Jan 16, 2022
86818a6
test: Agrega pruebas
williamjmorenor Mar 4, 2022
6bc6eb2
Agrega metodo para eliminar curso.
williamjmorenor Mar 15, 2022
c81f994
fixup
williamjmorenor Mar 21, 2022
11f1e7d
build: Actualiza configuración de gitpod
williamjmorenor Mar 16, 2022
941943c
style: Correcciones de estilo
williamjmorenor Mar 21, 2022
ec1e0dd
fix: Typo
williamjmorenor Mar 21, 2022
21877d6
refactor: Ejecuta un query menos
williamjmorenor Mar 21, 2022
81fca57
WIP
williamjmorenor Mar 21, 2022
ec6efa9
style: pass mypy
williamjmorenor Mar 21, 2022
3a33093
style: Sonarcube
williamjmorenor Mar 21, 2022
3e8184b
feat: Corrige direcciones de base de datos
williamjmorenor Mar 21, 2022
57064e6
Update README.md
williamjmorenor Feb 27, 2022
6c35a03
build: Minimal nginx configuration
williamjmorenor Feb 27, 2022
f485647
Update readme
williamjmorenor Feb 27, 2022
c50478a
fix: Corrige permisos instructor
williamjmorenor Mar 2, 2022
5364cf0
fix: Corrige lista de cursos del instructor
williamjmorenor Jan 16, 2022
320c94b
test: Agrega pruebas
williamjmorenor Mar 4, 2022
802a6bb
Agrega metodo para eliminar curso.
williamjmorenor Mar 15, 2022
a045348
fixup
williamjmorenor Mar 21, 2022
d96b859
build: Actualiza configuración de gitpod
williamjmorenor Mar 16, 2022
d3ffd07
style: Correcciones de estilo
williamjmorenor Mar 21, 2022
766f776
fix: Typo
williamjmorenor Mar 21, 2022
0c12f57
refactor: Ejecuta un query menos
williamjmorenor Mar 21, 2022
e9f6a37
WIP
williamjmorenor Mar 21, 2022
f1195a8
style: pass mypy
williamjmorenor Mar 21, 2022
7135c63
build: Heroku likes psycopg
williamjmorenor Feb 27, 2022
189f86a
Merge branch 'heroku' into contenido-curso
williamjmorenor Mar 21, 2022
730d99b
build: PG8000 por defecto
williamjmorenor Mar 21, 2022
b804e0d
build: Test python3.11
williamjmorenor Mar 21, 2022
8e3065c
Revert "build: Test python3.11"
williamjmorenor Mar 21, 2022
716338d
Update README.md
williamjmorenor Mar 21, 2022
a56c28b
test: agrega test
williamjmorenor Mar 27, 2022
64da717
test: agrega test
williamjmorenor Mar 27, 2022
598511c
test: agrega test
williamjmorenor Mar 27, 2022
cc15fda
test: Mejora covertura
williamjmorenor Mar 27, 2022
414bde5
style: Correciones de estilo
williamjmorenor Mar 27, 2022
3d12b21
test: Mejor covertura
williamjmorenor Mar 27, 2022
810a072
test: Mejor covertura
williamjmorenor Mar 27, 2022
c7988ea
test: mejor cobertura
williamjmorenor Mar 27, 2022
a9053da
Merge branch 'main' into contenido-curso
williamjmorenor Apr 10, 2022
01bd3ca
Update README.md
williamjmorenor Apr 13, 2022
b247857
Update README.md
williamjmorenor Apr 13, 2022
b40f523
Update README.md
williamjmorenor Apr 13, 2022
32986ef
test: Crear usuario
williamjmorenor Apr 16, 2022
0f50a05
test: Fix test
williamjmorenor Apr 16, 2022
8d98500
test: Fix test
williamjmorenor Apr 16, 2022
aec7df6
test: Agrega mas test unitarios
williamjmorenor Apr 16, 2022
db6b80c
feat: Crear curso demo
williamjmorenor Apr 16, 2022
122ae7a
test: Update test
williamjmorenor Apr 16, 2022
d35feca
feat: Arregla relaciones entre tablas
williamjmorenor Apr 16, 2022
763cb00
test: Agrega test unitarios
williamjmorenor Apr 16, 2022
76f2728
Update README.md
williamjmorenor Apr 16, 2022
19f57b7
test: Agrega pruebas unitarias
williamjmorenor Apr 16, 2022
68e2bca
fix: Eliminar seccion
williamjmorenor Apr 16, 2022
7fdcb47
test: Agrega pruebas unitarias
williamjmorenor Apr 16, 2022
21ca6d0
feat: Seccion publica
williamjmorenor Apr 16, 2022
9df22f0
test: Actualiza test
williamjmorenor Apr 16, 2022
7e224aa
test: Actualiza test
williamjmorenor Apr 16, 2022
140f8ac
style: CSS fixes
williamjmorenor Apr 16, 2022
67d1581
style: Fixes
williamjmorenor Apr 16, 2022
1ffac44
style: CCS fixes
williamjmorenor Apr 16, 2022
23d083a
fix: Log message
williamjmorenor Apr 16, 2022
1d0c01b
feat: Asigna indice a nueva seccion
williamjmorenor Apr 16, 2022
57a84c0
feat: Agrega metodos para modificar indice seccion
williamjmorenor Apr 17, 2022
b43801a
style: Fixes
williamjmorenor Apr 17, 2022
0e82541
WIP
williamjmorenor Apr 17, 2022
ef71917
WIP
williamjmorenor Apr 17, 2022
c5bc6fa
WIP
williamjmorenor Apr 17, 2022
94e3000
test: Update test
williamjmorenor Apr 17, 2022
8ed7065
test: Update test
williamjmorenor Apr 17, 2022
3f26ec6
Revert "test: Update test"
williamjmorenor Apr 17, 2022
e4c2534
fix: Reorganiza indice de seccion
williamjmorenor Apr 17, 2022
7f9404f
fix: Reordenar indice
williamjmorenor Apr 17, 2022
5ccd99d
fix: Pagina inicio
williamjmorenor Apr 17, 2022
dcaef2e
fix: Reorganizar indice
williamjmorenor Apr 17, 2022
03eac5c
Fix typo
williamjmorenor Apr 29, 2022
db299a2
feat: Agrega recurso en youtube
williamjmorenor May 1, 2022
3025637
update
williamjmorenor May 5, 2022
aade69f
WIP
williamjmorenor May 8, 2022
97631bf
WIP
williamjmorenor May 8, 2022
44cace7
WIP
williamjmorenor May 8, 2022
75c83cb
WIP
williamjmorenor May 8, 2022
e91cabc
refactor: Reorganice project
williamjmorenor May 12, 2022
43be641
build: Development server
williamjmorenor May 13, 2022
1f84783
WIP
williamjmorenor Jul 15, 2022
320275d
WIP
williamjmorenor Jul 15, 2022
87d2832
Fix node_modules
Nov 18, 2022
2329c78
Merge
Nov 18, 2022
5aa7793
Actualiza mensajes del log
williamjmorenor Dec 8, 2022
b9ec466
Python 3.11
williamjmorenor Dec 8, 2022
de64a50
Python 3.11
williamjmorenor Dec 8, 2022
a5d44df
Merge branch 'contenido-curso' of https://github.com/bmosoluciones/no…
williamjmorenor Dec 8, 2022
926f11e
Clean pylint conf
williamjmorenor Dec 8, 2022
e4bace7
Corrige mensaje de error
williamjmorenor Dec 8, 2022
7174cb8
Fix test
williamjmorenor Dec 8, 2022
4c99640
Disable pylint
williamjmorenor Dec 8, 2022
e8c6a28
Disable pylint
williamjmorenor Dec 8, 2022
4f0dd3d
lint
williamjmorenor Dec 8, 2022
13db052
Support Python 3.9 and above
williamjmorenor Dec 8, 2022
aefc665
UBI 9
williamjmorenor Dec 8, 2022
c65e663
UBI 9
williamjmorenor Dec 8, 2022
38169de
UBI 9
williamjmorenor Dec 8, 2022
85c4b51
UBI 9
williamjmorenor Dec 8, 2022
9bb7b2b
Docker
williamjmorenor Dec 9, 2022
dd655cd
Docker
williamjmorenor Dec 9, 2022
20aae3d
Docker
williamjmorenor Dec 9, 2022
b6e8d16
Docker
williamjmorenor Dec 9, 2022
cb6d1aa
Docker
williamjmorenor Dec 9, 2022
2f168bc
Docker
williamjmorenor Dec 9, 2022
745ab80
Update README file
williamjmorenor Dec 9, 2022
afc903b
Update Docker file
williamjmorenor Dec 9, 2022
8b3a7ce
Enable type chequing
williamjmorenor Dec 9, 2022
6a06443
All test passed
williamjmorenor Dec 9, 2022
9beb20d
Fix mypy not interactive
williamjmorenor Dec 9, 2022
17ca684
Fix bandit
williamjmorenor Dec 9, 2022
be1e2ca
Ignore bandit errors
williamjmorenor Dec 9, 2022
1fcc62e
Check python 3.7
williamjmorenor Dec 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .do/deploy.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@ spec:
- key: LMS_PSWD
value: "admin123+"
type: SECRET
- key: DATABASE_URL
scope: RUN_TIME
value: ${example-db.DATABASE_URL}
databases:
- name: example-db
5 changes: 2 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
.idea
.do


# Documentacion
mkdocs.yml
docs
Expand All @@ -30,5 +29,5 @@ requirements-databases.txt
.mypy.ini
.gitpod.yml
.gitpod.sh

app.json
app.json
sonar-project.properties
17 changes: 13 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand All @@ -27,17 +27,26 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install bandit flake8 pytest
python -m pip install -r development.txt
- name: Lint project
run: |
rm -rf build
flake8 now_lms
flake8 --ignore=E712 now_lms
python -m build
python -m twine check dist/*
pylint now_lms
python -m bandit -r now_lms
python -m flake8 now_lms
python -m pylint now_lms
- name: Test with pytest
run: |
pytest -v --exitfirst --cov=now_lms
- name: Check python types
run: |
python -m pip install mypy
python -m mypy --install-types --non-interactive now_lms
- name: OCI Image
run: |
docker buildx build .
- name: Codecov
uses: codecov/codecov-action@v1
6 changes: 4 additions & 2 deletions .gitpod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ sudo apt install -y sqlite
git config pull.rebase true
python -m pip install --upgrade pip
python -m pip install --upgrade pip
python -m pip install -r development.txt
python -m pip install --upgrade -r development.txt
python -m pip install -e .
python setup.py develop
mypy now_lms --install-types --non-interactive
python -m pip install hupper
/home/gitpod/.pyenv/versions/3.8.12/bin/hupper -m waitress --port=8080 now_lms:app
python -m flask setup
/home/gitpod/.pyenv/versions/3.8.12/bin/hupper -m waitress --port=8080 now_lms:app
git push heroku mastergit remote add heroku https://git.heroku.com/app.git
73 changes: 1 addition & 72 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,85 +74,14 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
# Por la naturaleza del proyecto no todos los import estan al inicio para evitar
# importaciones circulares
import-outside-toplevel,
Expand Down
Binary file added .yarn/install-state.gz
Binary file not shown.
2 changes: 0 additions & 2 deletions .yarnrc

This file was deleted.

15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal AS js
RUN rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg \
&& curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo \
&& microdnf -y install yarn
COPY package.json .
COPY yarn.lock .
RUN yarn
FROM registry.access.redhat.com/ubi9/ubi-minimal AS js
RUN microdnf install -y nodejs npm
COPY ./now_lms/static/package.json package.json
RUN npm install

FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM registry.access.redhat.com/ubi9/ubi-minimal

ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED = 1
ENV FLASK_ENV "production"

RUN microdnf install -y --nodocs --best --refresh python39 python39-pip python39-cryptography \
RUN microdnf install -y --nodocs --best --refresh python39 python3-pip python3-cryptography \
&& microdnf clean all

# Install dependencies in a layer
Expand Down
60 changes: 53 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
![PyPI - License](https://img.shields.io/pypi/l/now_lms?color=brightgreen&logo=apache&logoColor=white)
![PyPI](https://img.shields.io/pypi/v/now_lms?color=brightgreen&label=version&logo=python&logoColor=white)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/now_lms?logo=python&logoColor=white)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellow)](https://github.com/PyCQA/pylint)
[![codecov](https://codecov.io/gh/bmosoluciones/now-lms/branch/main/graph/badge.svg?token=SFVXF6Y3R3)](https://codecov.io/gh/bmosoluciones/now-lms)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bmosoluciones_now-lms&metric=alert_status)](https://sonarcloud.io/dashboard?id=bmosoluciones_now-lms)
[![Join the chat at https://gitter.im/now-lms/community](https://badges.gitter.im/now-lms/community.svg)](https://gitter.im/now-lms/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Simple to {install, use, configure, mantain} learning management system.

Expand All @@ -30,32 +33,37 @@ python -m pip install now_lms
python -m now_lms
```

Visit http://127.0.0.1:8080/ in your browser, defaul user and password are `lms-admin`, note that the default server is olny bind to the localhost.
Visit http://127.0.0.1:8080/ in your browser, defaul user and password are `lms-admin`, note that the default server is only bind to the localhost.

### Other deployment options

There are available templates to deploy Now - LMS to these services:

[![Deploy to DO](https://img.shields.io/badge/DO-Deploy%20to%20DO-blue "Deploy as Digital Ocean App")](https://cloud.digitalocean.com/apps/new?repo=https://github.com/bmosoluciones/now-lms/tree/main)
[![Deploy to Heroku](https://img.shields.io/badge/Heroku-Deploy%20to%20Heroku-blueviolet "Deploy to Heroku")](https://heroku.com/deploy?template=https://github.com/bmosoluciones/now-lms/tree/main)
[![Deploy to Heroku](https://img.shields.io/badge/Heroku-Deploy%20to%20Heroku-blueviolet "Deploy to Heroku")](https://heroku.com/deploy?template=https://github.com/bmosoluciones/now-lms/tree/heroku)


### OCI Image
[![Docker Repository on Quay](https://quay.io/repository/bmosoluciones/now-lms/status "Docker Repository on Quay")](https://quay.io/repository/bmosoluciones/now-lms) [![Join the chat at https://gitter.im/now-lms/community](https://badges.gitter.im/now-lms/community.svg)](https://gitter.im/now-lms/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Docker Repository on Quay](https://quay.io/repository/bmosoluciones/now_lms/status "Docker Repository on Quay")](https://quay.io/repository/bmosoluciones/now_lms)

There is also a OCI image disponible if you prefer to user containers, in this example we use [podman](https://podman.io/):

```
# <---------------------------------------------> #
# Install the podman command line tool.
# Fedora, CentOS ...
# DNF family (CentOS, Rocky, Alma):
sudo dnf -y install podman

# Debian, Ubuntu ...
# APT family (Debian, Ubuntu):
sudo apt install -y podman

# OpenSUSE
# OpenSUSE:
sudo zypper in podman


# <---------------------------------------------> #
# Run the software.
# Create a new pod:
podman pod create --name now-lms -p 80:80 -p 443:443

Expand All @@ -77,4 +85,42 @@ podman run --pod now-lms --name now-lms-server --rm -v $PWD/nginx.conf:/etc/ngin

```

NOW-LMS also will work with MySQL or MariaDB just change the image of the database container and set the correct connect string.
NOW-LMS also will work with MySQL or MariaDB just change the image of the database container and set the correct connect string. SQLite also will work if you will serve a few users.

## Contributing

### Getting the source code

```
git clone https://github.com/bmosoluciones/now-lms.git
```
### Create a python virtual env

```
python3 -m venv venv
# Linux:
source venv/bin/activate
# Windows
venv\Scripts\activate.bat
```
### Install python deps

```
python3 - m pip install -r development.txt
```

### Install Boostrap

```
cd now_lms/static/
npm install
```

### Start a development server

```
hupper -m waitress --port=8080 now_lms:app
```
Please note that we use waitress as WSGI server because gunicorn do not work on Windows, hupper will live reload the WSGI server as you save changes in the source code so you will be able to work with your changes as you work, please note that changes to the jinja templates will not trigger the server reload, only changes to python files.

Default user and password are ```lms-admin```, default url to work with th server will be ```http://127.0.0.1:8080/```.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"logo": "https://github.com/bmosoluciones/now-lms/raw/main/now_lms/static/icons/logo/logo_small.png",
"keywords": ["lms", "python"],
"scripts": {
"postdeploy": "python -m flask setup"
"postdeploy": "python -m pip install psycopg2-binary && python -m flask setup"
},
"env": {
"LMS_KEY": {
Expand Down
7 changes: 7 additions & 0 deletions development.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Base
-r requirements.txt

# Servidor de desarrollo
hupper

# Crear tarball y wheel
build
twine
Expand All @@ -25,3 +28,7 @@ mkdocs-material

# Verificación de tipos
mypy

#Live realoader
hupper
# hupper -m now_lms
Loading