· 4 years ago · Apr 23, 2021, 02:42 AM
1"""
2Django settings for WEB project.
3
4Generated by 'django-admin startproject' using Django 3.1.7.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/3.1/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/3.1/ref/settings/
11"""
12import os
13from pathlib import Path
14import sys
15# Build paths inside the project like this: BASE_DIR / 'subdir'.
16BASE_DIR = Path(__file__).resolve().parent.parent
17
18
19# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = 'w*-q%j_b=xhvw323we-lpaoh$c3q-1r%zurc_0s)!*nv$%!@c-'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = False
27
28ALLOWED_HOSTS = ["104.236.231.246"]
29
30
31# Application definition
32
33INSTALLED_APPS = [
34 'django.contrib.admin',
35 'django.contrib.auth',
36 'django.contrib.contenttypes',
37 'django.contrib.sessions',
38 'django.contrib.messages',
39 'django.contrib.staticfiles',
40 'tienda',
41 'articulos',
42 'contacto',
43 'aatienda',
44 'mayoristas',
45 'blog',
46 'carrito',
47 'checkout',
48]
49
50MIDDLEWARE = [
51 'django.middleware.security.SecurityMiddleware',
52 'django.contrib.sessions.middleware.SessionMiddleware',
53 'django.middleware.common.CommonMiddleware',
54 'django.middleware.csrf.CsrfViewMiddleware',
55 'django.contrib.auth.middleware.AuthenticationMiddleware',
56 'django.contrib.messages.middleware.MessageMiddleware',
57 'django.middleware.clickjacking.XFrameOptionsMiddleware',
58 'whitenoise.middleware.WhiteNoiseMiddleware',
59]
60
61ROOT_URLCONF = 'WEB.urls'
62
63TEMPLATES = [
64 {
65 'BACKEND': 'django.template.backends.django.DjangoTemplates',
66 'DIRS': [],
67 'APP_DIRS': True,
68 'OPTIONS': {
69 'context_processors': [
70 'django.template.context_processors.debug',
71 'django.template.context_processors.request',
72 'django.contrib.auth.context_processors.auth',
73 'django.contrib.messages.context_processors.messages',
74 'carrito.context_processor.monto_total',
75 ],
76 },
77 },
78]
79
80WSGI_APPLICATION = 'WEB.wsgi.application'
81
82
83# Database
84# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
85
86DATABASES = {
87 'default': {
88 'ENGINE': 'django.db.backends.postgresql_psycopg2',
89 'NAME': 'joyapandb1',
90 'USER': 'postgres',
91 'PASSWORD': 'Rmpv54321',
92 'HOST': '127.0.0.1',
93 'PORT': '5432',
94
95 }
96}
97
98# Password validation
99# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
100
101AUTH_PASSWORD_VALIDATORS = [
102 {
103 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
104 },
105 {
106 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
107 },
108 {
109 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
110 },
111 {
112 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
113 },
114]
115
116
117# Internationalization
118# https://docs.djangoproject.com/en/3.1/topics/i18n/
119
120#LANGUAGE_CODE = 'en-us'
121LANGUAGE_CODE = 'es-eu'
122
123TIME_ZONE = 'UTC'
124
125USE_I18N = True
126
127USE_L10N = True
128
129USE_TZ = True
130
131
132# Static files (CSS, JavaScript, Images)
133# https://docs.djangoproject.com/en/3.1/howto/static-files/
134
135STATIC_URL = '/static/'
136
137
138MEDIA_URL= '/media/'
139
140MEDIA_ROOT = os.path.join(BASE_DIR,'media')
141
142Cliente_Id="AT57_peUjz_M_FNOHo5Qbmgc16ft_-9YLpFQy85W51RoBlmwuw5fNDkeOx9G7uOMr3CrIr04Mx2Vgm_I"
143Cliente_Secret_Key="EM60643zxtyTJqzrvrYqRed4BPXlph7RdQDIhBJbAprmzC5NdZ0dwKFVqfa6Qp8xkmkrSFy69Q39ryJt"
144
145#stripe
146STRIPE_PUBLISHABLE_KEY ='pk_test_51IfVw7EoHQQLz8ZTPLwDGo3EY9nrWhEUI4aEiDqAiP1cZapE9pvp38BmRDIrLVsDfIZZjnvQVc1NKpt8NixbCkGC00ufXbNSA3'
147STRIPE_SECRET_KEY = 'sk_test_51IfVw7EoHQQLz8ZTC41QPlFihvKvTBs9ez5HUdV1cYsCVm0UIJ65vPjQb1qpC3nLJGP652CYHz4wBoYzc0DqhTIk00kysXrKGC'
148