Skip to content

Commit

Permalink
Merge branch 'main' into feature/#68-Vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
mrarjona authored Dec 17, 2022
2 parents e77a36c + d2394de commit d10a29e
Show file tree
Hide file tree
Showing 58 changed files with 1,358 additions and 867 deletions.
17 changes: 17 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[flake8]
max-line-length = 88
select = C,E,F,W,B,B950
extend-ignore =
E302,
E203,
E501,
F403, ; Import * used
F405, ; X may be undefined, or defined from * imports
exclude =
.git,
__pycache__,
docs/source/conf.py,
old,
build,
dist,
*/migrations/*,
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: INNOSOFT eventos Build

on:
push:
branches:
branches:
- main
- feature/**
pull_request:
branches:
branches:
- main

env:
Expand All @@ -30,7 +30,7 @@ jobs:
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2
- name: Verify and configure MySQL connection
Expand All @@ -49,13 +49,13 @@ jobs:
pip install codacy-coverage
sudo apt-get install chromium-browser chromium-chromedriver
- name: Make Migrations and Migrate
run: |
run: |
python ./manage.py makemigrations
python ./manage.py migrate
- name: Run Tests
run: |
coverage run --branch --source=. ./manage.py test --keepdb
coverage xml
run: |
coverage run --branch --source=. ./manage.py test --keepdb
coverage xml
- name: Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
Expand Down
184 changes: 92 additions & 92 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ __pycache__
media
/**/migrations/**

# Backup files #
*.bak
# Backup files #
*.bak

# Vagrant #
/Vagrant/.vagrant

# If you are using PyCharm #
# If you are using PyCharm #
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
Expand Down Expand Up @@ -49,93 +49,93 @@ out/
# JIRA plugin
atlassian-ide-plugin.xml

# Python #
*.py[cod]
*$py.class

# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery
celerybeat-schedule.*

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Sublime Text #
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
.vscode/launch.json
!.vscode/extensions.json
# Python #
*.py[cod]
*$py.class

# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery
celerybeat-schedule.*

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Sublime Text #
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings

# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
.vscode/launch.json
!.vscode/extensions.json
.history
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
types: [python, javascript, html, css]
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
files: \.(py)$
exclude: ^migrations/
4 changes: 2 additions & 2 deletions accounts/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class AccountsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'accounts'
default_auto_field = "django.db.models.BigAutoField"
name = "accounts"
12 changes: 10 additions & 2 deletions accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@

from participant.models import Participant


class RegisterForm(UserCreationForm):
email = forms.EmailField()

class Meta:
model = Participant
fields = ['username', 'first_name', 'last_name', 'email', 'password1', 'password2', 'photo']

fields = [
"username",
"first_name",
"last_name",
"email",
"password1",
"password2",
"photo",
]
2 changes: 1 addition & 1 deletion accounts/templates/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% block content %}
<div class="register-layout">
<div class="titulo">

</div>
<div class="container-register">
<form method="POST" action="{% url 'register' %}" class="form-register" novalidate>
Expand Down
4 changes: 2 additions & 2 deletions accounts/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from accounts.views import *

urlpatterns = [
path('', register, name="register"),
]
path("", register, name="register"),
]
7 changes: 4 additions & 3 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

# Create your views here.


def register(request):
if request.method == 'POST':
if request.method == "POST":
form = RegisterForm(request.POST)
if form.is_valid():
form.save()
return redirect('/')
return redirect("/")
else:
form = RegisterForm()
return render(request, 'register.html', {'form': form})
return render(request, "register.html", {"form": form})
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3"

services:
services:
db:
image: mysql:8
environment:
Expand All @@ -12,12 +12,12 @@ services:
MYSQL_TCP_PORT: "3307"
ports:
- "3306:3307"

web:
image: innosoftinnoweb/innosoft-innoweb-1:latest
image: innosoftinnoweb/innosoft-innoweb-1:main
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
Expand All @@ -28,4 +28,4 @@ services:
deploy:
restart_policy:
condition: on-failure

3 changes: 2 additions & 1 deletion event/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.contrib import admin
from .models import Event

# Register your models here.

admin.site.register(Event)
admin.site.register(Event)
4 changes: 2 additions & 2 deletions event/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class EventConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'event'
default_auto_field = "django.db.models.BigAutoField"
name = "event"
Loading

0 comments on commit d10a29e

Please sign in to comment.