Compare commits

...

7 Commits

Author SHA1 Message Date
Yohann D'ANELLO e9ab9e6c27
We don't use Django Guardian
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2022-03-09 19:48:27 +01:00
Yohann D'ANELLO 8cb3815777
Add migrations
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2022-03-09 19:46:53 +01:00
Yohann D'ANELLO c585644dd6
Install Pillow to manage images
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2022-03-09 19:01:31 +01:00
Yohann D'ANELLO 086a22e36a
Fix app translation
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2022-03-09 18:56:48 +01:00
Yohann D'ANELLO 5b713f0a19
Bump libs versions
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2022-03-09 16:02:53 +01:00
Yohann D'ANELLO 7b4f5cc704
Port code to Bullseye
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2022-03-09 15:54:26 +01:00
Yohann D'ANELLO aec09185fa
Fix dependencies
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2022-03-09 15:47:49 +01:00
8 changed files with 52 additions and 47 deletions

3
.gitignore vendored
View File

@ -42,6 +42,3 @@ secrets.py
env/
venv/
db.sqlite3
# Ignore migrations during first phase dev
migrations/

View File

@ -1,4 +1,4 @@
FROM python:3-buster
FROM python:3.9-slim-bullseye
ENV PYTHONUNBUFFERED 1
@ -7,6 +7,9 @@ WORKDIR /code
RUN apt update && \
apt install -y gettext nginx uwsgi uwsgi-plugin-python3 && \
apt install -y python3-django python3-django-crispy-forms \
python3-django-extensions python3-django-tables2 python3-docutils \
python3-pil python3-psycopg2 && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt /code/

View File

@ -1,6 +1,7 @@
# Copyright (C) 2020 by BDE ENS Paris-Saclay
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class TBDEConfig(AppConfig):

View File

@ -0,0 +1,33 @@
# Generated by Django 3.2.12 on 2022-03-09 18:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Ticket',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('number', models.PositiveIntegerField(verbose_name='number')),
('note', models.CharField(blank=True, max_length=255, null=True, verbose_name='note')),
],
),
migrations.CreateModel(
name='Reward',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('order', models.PositiveIntegerField(verbose_name='order')),
('name', models.CharField(max_length=255, verbose_name='name')),
('image', models.ImageField(upload_to='', verbose_name='image')),
('rewarded_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='tbde.ticket', verbose_name='rewarded by')),
],
),
]

View File

View File

@ -1,27 +1,8 @@
certifi==2019.6.16
chardet==3.0.4
defusedxml==0.6.0
Django~=2.2
django-allauth==0.39.1
django-autocomplete-light==3.5.1
django-crispy-forms==1.7.2
django-extensions==2.1.9
django-filter==2.2.0
django-guardian==2.1.0
django-polymorphic==2.0.3
djangorestframework==3.9.0
django-rest-polymorphic==0.1.8
django-reversion==3.0.3
django-tables2==2.1.0
docutils==0.14
psycopg2==2.8.4
idna==2.8
oauthlib==3.1.0
Pillow==6.1.0
python3-openid==3.1.0
pytz==2019.1
requests==2.22.0
requests-oauthlib==1.2.0
six==1.12.0
sqlparse==0.3.0
urllib3==1.25.3
Django>=3.2,<4.0
django-autocomplete-light~=3.9
django-crispy-forms~=1.9.2
django-extensions~=3.0.3
djangorestframework~=3.12.1
django-tables2~=2.4.1
docutils~=0.16
pillow~=8.1.2

View File

@ -32,14 +32,6 @@ ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
# Theme overrides Django Admin templates
# 'theme',
# External apps
'polymorphic',
'reversion',
'crispy_forms',
'django_tables2',
# Django contrib
'django.contrib.admin',
'django.contrib.admindocs',
@ -55,6 +47,10 @@ INSTALLED_APPS = [
# Autocomplete
'dal',
'dal_select2',
# External apps
'crispy_forms',
'django_tables2',
'django_extensions',
# Tombola apps
'tbde',
@ -112,11 +108,8 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
# Django Guardian object permissions
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', # this is default
'guardian.backends.ObjectPermissionBackend',
)
REST_FRAMEWORK = {
@ -130,10 +123,6 @@ REST_FRAMEWORK = {
]
}
ANONYMOUS_USER_NAME = None # Disable guardian anonymous user
GUARDIAN_GET_CONTENT_TYPE = 'polymorphic.contrib.guardian.get_polymorphic_base_content_type'
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
@ -177,3 +166,4 @@ STATIC_URL = '/static/'
ALIAS_VALIDATOR_REGEX = r''
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

View File

@ -15,7 +15,7 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from . import settings
from django.conf import settings
from django.contrib import admin
from django.contrib.staticfiles.urls import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns