Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Django settings for pac_gateway project.
- Generated by 'django-admin startproject' using Django 1.9.5.
- For more information on this file, see
- https://docs.djangoproject.com/en/1.9/topics/settings/
- For the full list of settings and their values, see
- https://docs.djangoproject.com/en/1.9/ref/settings/
- """
- import os
- DEBUG = False
- if os.environ.get('DJANGO_DEBUG', False):
- DEBUG = True
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- # Quick-start development settings - unsuitable for production
- # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
- # SECURITY WARNING: keep the secret key used in production secret!
- SECRET_KEY = 'nbqoc-^@f#1(g#cux^w*$%14opecsr8np@m^h2vykctm+76!pw'
- ALLOWED_HOSTS = []
- # Application definition
- INSTALLED_APPS = [
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'django.contrib.postgres',
- 'rest_framework.authtoken',
- 'rest_framework',
- 'corsheaders',
- 'rest_framework_swagger',
- 'anymail',
- 'pac_gateway.cfd',
- 'daterange_filter',
- 'colorfield',
- 'colorful'
- ]
- MIDDLEWARE_CLASSES = [
- 'django.middleware.security.SecurityMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'corsheaders.middleware.CorsMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- ]
- CORS_ORIGIN_ALLOW_ALL = True
- CORS_ALLOW_CREDENTIALS = True
- ROOT_URLCONF = 'pac_gateway.urls'
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR, 'templates'), ],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- ],
- 'debug': DEBUG
- },
- },
- ]
- WSGI_APPLICATION = 'pac_gateway.wsgi.application'
- # Password validation
- # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
- AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
- ]
- # Internationalization
- # https://docs.djangoproject.com/en/1.9/topics/i18n/
- LANGUAGE_CODE = 'es'
- TIME_ZONE = 'UTC'
- USE_I18N = True
- # USE_L10N = True
- USE_TZ = True
- LOCALE_PATHS = (
- os.path.join(BASE_DIR, 'locale'),
- )
- # Static files (CSS, JavaScript, Images)
- # https://docs.djangoproject.com/en/1.9/howto/static-files/
- STATIC_URL = '/static/'
- STATIC_ROOT = os.path.join(BASE_DIR, 'static')
- # Rest Framework
- REST_FRAMEWORK = {
- 'DEFAULT_PERMISSION_CLASSES': (
- 'rest_framework.permissions.IsAuthenticated',
- ),
- 'DEFAULT_FILTER_BACKENDS': (
- 'rest_framework.filters.DjangoFilterBackend',
- 'rest_framework.filters.SearchFilter'
- ),
- 'DEFAULT_AUTHENTICATION_CLASSES': (
- 'rest_framework.authentication.SessionAuthentication',
- 'rest_framework.authentication.TokenAuthentication'
- ),
- 'DEFAULT_PAGINATION_CLASS': (
- 'rest_framework.pagination.LimitOffsetPagination'
- )
- }
- LOGIN_REDIRECT_URL = "/api/docs/"
- # PAC Gateway setup
- CFDI_DEFAULT_VERSION = '3.2'
- CFDI_IR_SCHEMA_PATH = os.path.join(BASE_DIR, 'share', 'schemas',
- 'comprobante.json')
- PAC_GATEWAY_ENCRYPTION_KEY = os.environ.get('PAC_GATEWAY_ENCRYPTION_KEY', '')
- FINKOK_USERNAME = os.environ.get('FINKOK_USERNAME', '')
- FINKOK_PASSWORD = os.environ.get('FINKOK_PASSWORD', '')
- PAC_GATEWAY_AVAIL_SHEETS_WARNING_PCT = 0.125
- PAC_GATEWAY_DEFAULT_CERTIFICATION_DAYS = 3
- PAC_GATEWAY_FROM_EMAIL = "support@f-ambit.mx"
- # SAT Formats
- SAT_DATE_FORMAT = '%Y-%m-%dT%H:%M:%S'
- # Default prefixes
- PAC_GATEWAY_DEFAULT_GLOBAL_INVOICE_PREFIX = 'FG'
- PAC_GATEWAY_DEFAULT_GLOBAL_CREDIT_NOTE_PREFIX = 'NCG'
- PAC_GATEWAY_DEFAULT_CREDIT_NOTE_PREFIX = 'NC'
- # Payment form strings
- PAC_GATEWAY_PAYMENT_FORM_SINGLE = 'Pago en una sola exhibición'
- PAC_GATEWAY_PAYMENT_FORM_MULTIPLE = 'Parcialidad {part} de {total_parts}'
- # Invoice defaults
- PAC_GATEWAY_DEFAULT_SAT_PAYMENT_METHOD = '01'
- PAC_GATEWAY_DEFAULT_UNIT = 'Unidad'
- PAC_GATEWAY_INSTALLED_APPS = {
- 'lightspeed-retail': ('pac_gateway.applications.lightspeed'
- '.retail.LightSpeedRetailHandler')
- }
- DEFAULT_PAF_CONFIG = {
- 'palette': {
- 'bg': '#F9F9F9',
- 'header_bg': '#FDFDFD',
- 'container_bg': '#FFFFFF',
- 'title_bg': '#E31818',
- 'form_footer_bg': '#F5F5F5',
- 'footer_bg': '#FDFDFD',
- 'primary_button_bg': '#E31818',
- 'secondary_button_bg': '#A0A0A0',
- 'font_color': '#838383',
- 'title_color': '#FFFFFF',
- 'link_color': '#337AB7',
- 'primary_button_color': '#FFFFFF',
- 'secondary_button_color': '#FFFFFF',
- 'form_footer_color': '#838383',
- 'footer_color': '#838383'
- }
- }
- # Invoice PDF setup
- INVOICE_PDF_PAGESIZE = 'letter'
- INVOICE_PDF_ORIENTATION = 'portrait'
- INVOICE_PDF_MARGIN = '1cm'
- INVOICE_PDF_PADDING = '0'
- # Swagger settings
- SWAGGER_SETTINGS = {
- 'api_version': '0.1',
- 'api_path': '/api/v1/',
- 'enabled_methods': [
- 'get',
- 'post',
- ],
- 'is_authenticated': True,
- 'permission_denied_handler': 'pac_gateway.cfd.views.permission_denied_handler',
- 'info': {
- 'contact': 'team@uakami.com',
- 'description': 'API Pac Gateway to search, claim and stamp invoices. ',
- # 'license': 'Apache 2.0',
- # 'licenseUrl': 'http://www.apache.org/licenses/LICENSE-2.0.html',
- # 'termsOfServiceUrl': 'http://helloreverb.com/terms/',
- 'title': 'Ambit - API Pac Gateway',
- }
- }
- # Anymail settings
- ANYMAIL = {
- "MAILGUN_API_KEY": os.environ.get('MAILGUN_API_KEY', None)
- }
- EMAIL_BACKEND = "anymail.backends.mailgun.MailgunBackend"
- DEFAULT_FROM_EMAIL = "no-reply@f-ambit.mx"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement