Compare commits
No commits in common. "e9ab9e6c27ee0a4022b61202b81bc7e81f8b4e86" and "f81c7d1924ef3aa01ba88b6b7b5fb36e0026a17a" have entirely different histories.
e9ab9e6c27
...
f81c7d1924
3
.gitignore
vendored
3
.gitignore
vendored
@ -42,3 +42,6 @@ secrets.py
|
|||||||
env/
|
env/
|
||||||
venv/
|
venv/
|
||||||
db.sqlite3
|
db.sqlite3
|
||||||
|
|
||||||
|
# Ignore migrations during first phase dev
|
||||||
|
migrations/
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM python:3.9-slim-bullseye
|
FROM python:3-buster
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
@ -7,9 +7,6 @@ WORKDIR /code
|
|||||||
|
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt install -y gettext nginx uwsgi uwsgi-plugin-python3 && \
|
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/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY requirements.txt /code/
|
COPY requirements.txt /code/
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
# Copyright (C) 2020 by BDE ENS Paris-Saclay
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
|
|
||||||
class TBDEConfig(AppConfig):
|
class TBDEConfig(AppConfig):
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
# 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')),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
]
|
|
@ -1,8 +1,27 @@
|
|||||||
Django>=3.2,<4.0
|
certifi==2019.6.16
|
||||||
django-autocomplete-light~=3.9
|
chardet==3.0.4
|
||||||
django-crispy-forms~=1.9.2
|
defusedxml==0.6.0
|
||||||
django-extensions~=3.0.3
|
Django~=2.2
|
||||||
djangorestframework~=3.12.1
|
django-allauth==0.39.1
|
||||||
django-tables2~=2.4.1
|
django-autocomplete-light==3.5.1
|
||||||
docutils~=0.16
|
django-crispy-forms==1.7.2
|
||||||
pillow~=8.1.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
|
||||||
|
@ -32,6 +32,14 @@ ALLOWED_HOSTS = []
|
|||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
# Theme overrides Django Admin templates
|
||||||
|
# 'theme',
|
||||||
|
|
||||||
|
# External apps
|
||||||
|
'polymorphic',
|
||||||
|
'reversion',
|
||||||
|
'crispy_forms',
|
||||||
|
'django_tables2',
|
||||||
# Django contrib
|
# Django contrib
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.admindocs',
|
'django.contrib.admindocs',
|
||||||
@ -47,10 +55,6 @@ INSTALLED_APPS = [
|
|||||||
# Autocomplete
|
# Autocomplete
|
||||||
'dal',
|
'dal',
|
||||||
'dal_select2',
|
'dal_select2',
|
||||||
# External apps
|
|
||||||
'crispy_forms',
|
|
||||||
'django_tables2',
|
|
||||||
'django_extensions',
|
|
||||||
|
|
||||||
# Tombola apps
|
# Tombola apps
|
||||||
'tbde',
|
'tbde',
|
||||||
@ -108,8 +112,11 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Django Guardian object permissions
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = (
|
AUTHENTICATION_BACKENDS = (
|
||||||
'django.contrib.auth.backends.ModelBackend', # this is default
|
'django.contrib.auth.backends.ModelBackend', # this is default
|
||||||
|
'guardian.backends.ObjectPermissionBackend',
|
||||||
)
|
)
|
||||||
|
|
||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
@ -123,6 +130,10 @@ REST_FRAMEWORK = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ANONYMOUS_USER_NAME = None # Disable guardian anonymous user
|
||||||
|
|
||||||
|
GUARDIAN_GET_CONTENT_TYPE = 'polymorphic.contrib.guardian.get_polymorphic_base_content_type'
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/2.2/topics/i18n/
|
# https://docs.djangoproject.com/en/2.2/topics/i18n/
|
||||||
|
|
||||||
@ -166,4 +177,3 @@ STATIC_URL = '/static/'
|
|||||||
|
|
||||||
ALIAS_VALIDATOR_REGEX = r''
|
ALIAS_VALIDATOR_REGEX = r''
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
|
||||||
|
@ -15,7 +15,7 @@ Including another URLconf
|
|||||||
1. Import the include() function: from django.urls import include, path
|
1. Import the include() function: from django.urls import include, path
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.conf import settings
|
from . import settings
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.contrib.staticfiles.urls import static
|
from django.contrib.staticfiles.urls import static
|
||||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||||
|
Loading…
x
Reference in New Issue
Block a user