]> git.atlas4tour.it Git - pia_atlas.git/commitdiff
- Update views
authorCostantino Vitale <costantino.vitale@dyrecta.com>
Mon, 24 Oct 2022 07:17:01 +0000 (09:17 +0200)
committerCostantino Vitale <costantino.vitale@dyrecta.com>
Mon, 24 Oct 2022 07:17:01 +0000 (09:17 +0200)
sistema/views.py
socoin_atlas/settings.py

index b6b60deebf18a4201092554bd0f17f7e3807c731..5bdc2ff6eefbe0b66e8a5c7d17be3adf078e33be 100644 (file)
@@ -244,7 +244,7 @@ class PoiView(View):#PermissionRequiredMixin
     def post(self, request, *args, **kwargs):
         if 'mod' in request.POST:
             self.mod_poi(request)
-        elif 'add-multimedia'in request.POST:
+        elif 'add-multimedia' in request.POST:
             self.add_multimedia(request)
         else:
             self.add_poi(request)
index f7d5f67a77b1d8279c29604a01bb1f59a131412d..64a8646d8820aa7616a46c1ad375d71ec59a7174 100644 (file)
@@ -9,7 +9,7 @@ https://docs.djangoproject.com/en/3.2/topics/settings/
 For the full list of settings and their values, see
 https://docs.djangoproject.com/en/3.2/ref/settings/
 """
-
+import datetime
 import os
 from pathlib import Path
 
@@ -26,7 +26,7 @@ SECRET_KEY = 'django-insecure-h&&@$m&_9g%%jj%yo0vlne*^2fld=-#9*uhm4snirl&w4!08bo
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
 
-ALLOWED_HOSTS = []
+ALLOWED_HOSTS = ['*']
 
 
 # Application definition
@@ -55,9 +55,21 @@ MIDDLEWARE = [
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
 ]
 
-AUTHENTICATION_BACKENDS = [
-    "django.contrib.auth.backends.ModelBackend",
-]
+REST_FRAMEWORK = {
+    'DEFAULT_PERMISSION_CLASSES'    : (
+        'rest_framework.permissions.IsAuthenticated',
+    ),
+    'DEFAULT_AUTHENTICATION_CLASSES': (
+        'rest_framework_simplejwt.authentication.JWTAuthentication',
+        'rest_framework.authentication.SessionAuthentication',
+        'rest_framework.authentication.BasicAuthentication',
+    ),
+}
+
+JWT_AUTH = {
+    'JWT_ALLOW_REFRESH'   : True,
+    'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=3600),
+}
 
 
 ROOT_URLCONF = 'socoin_atlas.urls'
@@ -90,7 +102,7 @@ DATABASES = {
         'ENGINE': 'django.db.backends.mysql',
         'NAME': 'socoin_atlas',
         'USER': 'root',
-        'PASSWORD': "",
+        'PASSWORD': "password",
         'HOST': '127.0.0.1',  # Or an IP Address that your DB is hosted on
         'PORT': '3306',
         'AUTOCOMMIT': True,
@@ -140,6 +152,9 @@ USE_TZ = True
 STATIC_URL = '/static/'
 STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
 
+MEDIA_URL = '/media/'
+MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
+
 # Default primary key field type
 # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
 
@@ -148,4 +163,9 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
 
 CLIENTI_GROUPS = 'CLIENTE'
 TOUR_OPERATOR_GROUPS = 'TOUR_OPERATOR'
-ADMIN_GROUPS = 'ADMIN'
\ No newline at end of file
+ADMIN_GROUPS = 'ADMIN'
+
+'''
+PER INTEGRARE I PAGAMENTI CON PAYPAL
+https://www.youtube.com/watch?v=8rMfW4wO-vU&ab_channel=DennisIvy
+'''
\ No newline at end of file