dj auth test

clubs
Laurent 2 years ago
parent 57ad1f491a
commit 075c69e3bc
  1. 3
      padelclub_backend/settings.py
  2. 16
      padelclub_backend/settings_app.py
  3. 1
      padelclub_backend/urls.py
  4. 1
      requirements.txt
  5. 24
      tournaments/migrations/0022_alter_round_loser_alter_tournament_is_private.py

@ -26,9 +26,9 @@ SECRET_KEY = 'django-insecure-60*l@#e*-bc3o%#c#e3vikjcl$518bz2%xe3a3s3iudorq%dal
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
# ALLOWED_HOSTS = ['ssh-stax.alwaysdata.net', 'www.pokerrumble.net']
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
@ -41,6 +41,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'rest_framework', 'rest_framework',
'rest_framework.authtoken', 'rest_framework.authtoken',
'dj_rest_auth',
] ]
AUTH_USER_MODEL = "tournaments.CustomUser" AUTH_USER_MODEL = "tournaments.CustomUser"

@ -11,3 +11,19 @@ REST_FRAMEWORK = {
'rest_framework.authentication.TokenAuthentication', 'rest_framework.authentication.TokenAuthentication',
] ]
} }
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_HOST = 'smtp-xlr.alwaysdata.net'
# EMAIL_PORT = 587
# EMAIL_HOST_USER = 'automatic@padelclub.app'
# EMAIL_HOST_PASSWORD = 'XLRSport$2024'
# EMAIL_USE_TLS = True
# DEFAULT_FROM_EMAIL = 'Padel Club <automatic@padelclub.app>'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp-xlr.alwaysdata.net'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'xlr@alwaysdata.net'
EMAIL_HOST_PASSWORD = 'XLRSport$2024'
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'Padel Club <xlr@alwaysdata.net>'

@ -38,6 +38,7 @@ urlpatterns = [
path("", include("tournaments.urls")), path("", include("tournaments.urls")),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('api-auth/', include('rest_framework.urls')), path('api-auth/', include('rest_framework.urls')),
path('dj-rest-auth/', include('dj_rest_auth.urls')),
path('api/plus/api-token-auth/', obtain_auth_token, name='api_token_auth'), path('api/plus/api-token-auth/', obtain_auth_token, name='api_token_auth'),
path("api/plus/user-by-token/", views.user_by_token, name="user_by_token"), path("api/plus/user-by-token/", views.user_by_token, name="user_by_token"),
path("api/plus/change-password/", views.ChangePasswordView.as_view(), name="change_password"), path("api/plus/change-password/", views.ChangePasswordView.as_view(), name="change_password"),

@ -1,3 +1,4 @@
Django==4.2.11 Django==4.2.11
djangorestframework==3.14.0 djangorestframework==3.14.0
psycopg2-binary==2.9.9 psycopg2-binary==2.9.9
dj-rest-auth==5.1.0

@ -0,0 +1,24 @@
# Generated by Django 4.2.11 on 2024-04-02 08:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0021_match_name_match_order_and_more'),
]
operations = [
migrations.AlterField(
model_name='round',
name='loser',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='tournaments.round'),
),
migrations.AlterField(
model_name='tournament',
name='is_private',
field=models.BooleanField(default=False),
),
]
Loading…
Cancel
Save