From f00d7873c9b27b82ea1089858ea8760552127087 Mon Sep 17 00:00:00 2001 From: jbdoderlein Date: Tue, 13 Aug 2024 10:02:50 +0000 Subject: [PATCH] Small changes --- apps/member/forms.py | 2 +- apps/member/models.py | 22 +------------------ .../mails/email_validation_email.html | 4 ++-- note_kfet/settings/base.py | 5 +++-- uwsgi_note.ini | 12 +++++----- 5 files changed, 13 insertions(+), 32 deletions(-) diff --git a/apps/member/forms.py b/apps/member/forms.py index 36927f9..2e39fa8 100644 --- a/apps/member/forms.py +++ b/apps/member/forms.py @@ -60,7 +60,7 @@ class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = '__all__' - exclude = ('user', 'email_confirmed', 'registration_valid', ) + exclude = ('user', 'email_confirmed', 'registration_valid', 'section' ) class ImageForm(forms.Form): diff --git a/apps/member/models.py b/apps/member/models.py index 48f248a..30a381e 100644 --- a/apps/member/models.py +++ b/apps/member/models.py @@ -43,7 +43,7 @@ class Profile(models.Model): section = models.CharField( verbose_name=_('section'), - help_text=_('e.g. "1A0", "9A♥", "SAPHIRE"'), + help_text=_('Auto generated'), max_length=255, blank=True, default="", @@ -83,26 +83,6 @@ class Profile(models.Model): default=False, ) - ml_events_registration = models.CharField( - blank=True, - default='', - max_length=2, - choices=[ - ('', _("No")), - ('fr', _("Yes")), - ], - verbose_name=_("Register on the mailing list to stay informed of the events of the campus (1 mail/week)"), - ) - - ml_sport_registration = models.BooleanField( - default=False, - verbose_name=_("Register on the mailing list to stay informed of the sport events of the campus (1 mail/week)"), - ) - - ml_art_registration = models.BooleanField( - default=False, - verbose_name=_("Register on the mailing list to stay informed of the art events of the campus (1 mail/week)"), - ) report_frequency = models.PositiveSmallIntegerField( verbose_name=_("report frequency (in days)"), diff --git a/apps/registration/templates/registration/mails/email_validation_email.html b/apps/registration/templates/registration/mails/email_validation_email.html index 464bd17..c5ee63b 100644 --- a/apps/registration/templates/registration/mails/email_validation_email.html +++ b/apps/registration/templates/registration/mails/email_validation_email.html @@ -17,8 +17,8 @@

- - https://{{ domain }}{% url 'registration:email_validation' uidb64=uid token=token %} + + http://{{ domain }}{% url 'registration:email_validation' uidb64=uid token=token %}

diff --git a/note_kfet/settings/base.py b/note_kfet/settings/base.py index 817a393..bc94872 100644 --- a/note_kfet/settings/base.py +++ b/note_kfet/settings/base.py @@ -221,8 +221,9 @@ MEDIA_URL = '/media/' EMAIL_BACKEND = 'mailer.backend.DbBackend' MAILER_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_USE_SSL = os.getenv('EMAIL_USE_SSL', False) +EMAIL_USE_TLS = os.getenv('EMAIL_USE_TLS', True) EMAIL_HOST = os.getenv('EMAIL_HOST', 'smtp.example.org') -EMAIL_PORT = os.getenv('EMAIL_PORT', 25) +EMAIL_PORT = os.getenv('EMAIL_PORT', 587) EMAIL_HOST_USER = os.getenv('EMAIL_USER', None) EMAIL_HOST_PASSWORD = os.getenv('EMAIL_PASSWORD', None) @@ -235,7 +236,7 @@ DEFAULT_FROM_EMAIL = "NoteKfet2020 <" + SERVER_EMAIL + ">" cache_address = os.getenv("CACHE_ADDRESS", "127.0.0.1:11211") CACHES = { 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', 'LOCATION': cache_address, } } diff --git a/uwsgi_note.ini b/uwsgi_note.ini index 0eb3471..cea3ceb 100644 --- a/uwsgi_note.ini +++ b/uwsgi_note.ini @@ -4,25 +4,25 @@ uid = www-data gid = www-data # Django-related settings # the base directory (full path) -chdir = /var/www/notes-ker-lann +chdir = /var/www/notes-ker-lann/notes-ker-lann # Django's wsgi file #module = winaps.wsgi:application # the virtualenv (full path) -home = /var/www/notes-ker-lann/env -wsgi-file = /var/www/notes-ker-lann/note_kfet/wsgi.py +home = /var/www/notes-ker-lann/notes-ker-lann/env +wsgi-file = /var/www/notes-ker-lann/notes-ker-lann/note_kfet/wsgi.py plugin = python3 # process-related settings # master master = true # maximum number of worker processes -processes = 10 +processes = 2 # the socket (use the full path to be safe -socket = /var/www/notes-ker-lann/notes-ker-lann.sock +socket = /var/www/notes-ker-lann/notes-ker-lann/notes-ker-lann.sock # ... with appropriate permissions - may be needed chmod-socket = 664 # clear environment on exit vacuum = true # Touch reload -touch-reload = /var/www/notes-ker-lann/note_kfet/settings/__init__.py +touch-reload = /var/www/notes-ker-lann/notes-ker-lann/uwsgi_note.ini # Enable threads enable-threads = true