Esempio n. 1
0
# CRISPY FORM
CRISPY_TEMPLATE_PACK = 'bootstrap4'
LOGIN_REDIRECT_URL = '/'

# ADD NEW CURENCY
IDN = moneyed.add_currency(
    code='IDN',
    numeric='068',
    name='Rupiah',
    countries=('INDONESIA', )
)

_FORMATTER.add_sign_definition(
    'default',
    IDN,
    prefix=u'Bs. '
)

_FORMATTER.add_formatting_definition(
    'es_BO',
    group_size=3, group_separator=".", decimal_point=",",
    positive_sign="",  trailing_positive_sign="",
    negative_sign="-", trailing_negative_sign="",
    rounding_method=ROUND_HALF_EVEN
)

CURRENCIES = ('USD', 'IDN')
CURRENCY_CHOICES = [('USD', 'USD $'), ('IDN', 'IDN Rp')]

#FOR CART
Esempio n. 2
0
LANGUAGE_CODE = 'pl'

LANGUAGES = (
    ('pl', 'Polski'),
    ('en', 'English'),
)

DEFAULT_CURRENCY = 'PLN'
CURRENCIES = ('PLN', 'USD', 'EUR')
CURRENCY_CHOICES = [('PLN', 'PLN zł'), ('USD', 'USD $'), ('EUR', 'EUR €')]

import moneyed
from moneyed.localization import _FORMATTER, DEFAULT

_FORMATTER.add_sign_definition('pl_PL', moneyed.USD, prefix='US$')
_FORMATTER.add_sign_definition('pl_PL', moneyed.EUR, prefix='€')
_FORMATTER.add_sign_definition('DEFAULT', moneyed.EUR, prefix='€')

LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'locale'),
)


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static_my_proj"),
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

KRW = moneyed.add_currency(
    code='KRW',
    numeric='410',
    name='KOREA (THE REPUBLIC OF)',
    countries=('REPUBLIC OF KOREA', )
)

OPEN_EXCHANGE_RATES_APP_ID = os.environ.get("OPEN_EXCHANGE_RATES_APP_ID")
OPEN_EXCHANGE_RATES_URL = 'https://openexchangerates.org/api/latest.json?symbols=KRW,EUR,JPY'
_FORMATTER.add_sign_definition(
    'default',
    moneyed.KRW,
    suffix=u' KRW'
)

_FORMATTER.add_formatting_definition(
    'es_KO',
    group_size=3, group_separator=".", decimal_point=",",
    positive_sign="",  trailing_positive_sign="",
    negative_sign="-", trailing_negative_sign="",
    rounding_method=ROUND_HALF_EVEN
)

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

# SECURITY WARNING: don't run with debug turned on in production!
Esempio n. 4
0
# LOGGING
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#logging
# See https://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.

# Money Setup
# ------------------------------------------------------------------------------
EEI = moneyed.add_currency(code="EEI",
                           numeric="068",
                           name="Eve Echoes ISK",
                           countries=("CHINA", ))

# Currency Formatter will output 2.000,00 Bs.
_FORMATTER.add_sign_definition("default", EEI, prefix=u"Ƶ ")

_FORMATTER.add_formatting_definition(
    "es_BO",
    group_size=3,
    group_separator=",",
    decimal_point=".",
    positive_sign="",
    trailing_positive_sign="",
    negative_sign="-",
    trailing_negative_sign="",
    rounding_method=ROUND_HALF_EVEN,
)

CURRENCIES = ["EEI"]
Esempio n. 5
0
    EMAIL_USE_TLS = True
    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_HOST = "smtp.gmail.com"
    EMAIL_HOST_USER = "******"
    EMAIL_HOST_PASSWORD = os.environ.get('gmail-password')
    EMAIL_PORT = 587

    STATIC_PRECOMPILER_USE_CACHE = True

    STATICFILES_DIRS = []
else:
    try:
        from .local_settings import *
    except:
        warnings.warn("local_settings.py file is not present. It "
                      "could contain database settings for postgres")

# django-money configuration
import moneyed
from moneyed.localization import _FORMATTER
from decimal import ROUND_HALF_EVEN

LTC = moneyed.add_currency('LTC', '068', 'Litecoin', ())
_FORMATTER.add_sign_definition('default', LTC, prefix=u'LTC ')

CURRENCIES = ['LTC']
CURRENCIES_CHOICE = [('LTC', 'LTC')]

AUTOCOMPLETE_LENGTH = 5
Esempio n. 6
0
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.sites",
    "djmoney",
    "djmoney.contrib.exchange",
    "reversion",
    "tests.testapp",
]

SITE_ID = 1

SECRET_KEY = "foobar"

USE_L10N = True

_FORMATTER.add_sign_definition("pl_PL", moneyed.PLN, suffix=" zł")
_FORMATTER.add_sign_definition(DEFAULT, moneyed.PLN, suffix=" zł")
_FORMATTER.add_formatting_definition(
    "pl_PL",
    group_size=3,
    group_separator=" ",
    decimal_point=",",
    positive_sign="",
    trailing_positive_sign="",
    negative_sign="-",
    trailing_negative_sign="",
    rounding_method=ROUND_HALF_EVEN,
)

moneyed.add_currency("USDT", "000", "Tether", None)
Esempio n. 7
0
USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/

STATIC_URL = "/static/"
STATIC_ROOT = env("STATIC_ROOT", default=root("static.run"))
STATICFILES_FINDERS = [
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
]

# Django-Money: restrict list of possible currencies
# See also: https://github.com/django-money/django-money#adding-a-new-currency

# XBT is unofficial but ISO 4217-conformant code for Bitcoin
BTC = moneyed.add_currency("XBT", "Nil", "Bitcoin", [])
_FORMATTER.add_sign_definition("default", BTC, suffix=" BTC")

CURRENCIES = ("USD", "EUR", "PHP", "XBT")

# Django REST Framework configuration

REST_FRAMEWORK = {
    "DEFAULT_RENDERER_CLASSES": (
        # Let's omit BrowsableAPIRenderer and use CoreAPI tooling instead.
        "rest_framework.renderers.JSONRenderer", ),
    "DEFAULT_PAGINATION_CLASS":
    "api_demo.pagination.DefaultPagination",
}
Esempio n. 8
0
import moneyed
from moneyed.localization import _FORMATTER
from decimal import ROUND_HALF_EVEN

BOB = moneyed.add_currency(
    code='Rp.',
    numeric='069',
    name='Indonesia Rupiah',
    countries=('INDONESIA', )
)

# Currency Formatter will output 2.000,00 Bs.
_FORMATTER.add_sign_definition(
    'default',
    BOB,
    prefix=u'Rp. '
)

_FORMATTER.add_formatting_definition(
    'es_BO',
    group_size=3, group_separator=".", decimal_point=",",
    positive_sign="",  trailing_positive_sign="",
    negative_sign="-", trailing_negative_sign="",
    rounding_method=ROUND_HALF_EVEN)
Esempio n. 9
0
    'PAGINATE_BY': 20,
    'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.DjangoFilterBackend',),
}

CORS_ORIGIN_ALLOW_ALL = True

AUTH_USER_MODEL = 'users.User'

## Currency
import moneyed
from moneyed.localization import _FORMATTER, DEFAULT

DEFAULT_CURRENCY_CODE = 'GBP'
GBP_CHOICE_TUPLE = [(DEFAULT_CURRENCY_CODE, "Pound Sterling")]

_FORMATTER.add_sign_definition(DEFAULT, moneyed.GBP, prefix=u"£")
_FORMATTER.add_sign_definition(DEFAULT, moneyed.USD, prefix=u"$")
_FORMATTER.add_sign_definition(DEFAULT, moneyed.AUD, prefix=u"A$")
_FORMATTER.add_sign_definition(DEFAULT, moneyed.EUR, prefix=u"€")

CURRENCIES = [
    'GBP',
    'USD',
    'AUD',
    'EUR',
]

CURRENCY_CHOICES = [
    (DEFAULT_CURRENCY_CODE, moneyed.get_currency(DEFAULT_CURRENCY_CODE).name),
]
Esempio n. 10
0
import moneyed
from moneyed.localization import _FORMATTER
from decimal import ROUND_HALF_EVEN


BRL = moneyed.add_currency(
    code='R$',
    numeric='999',
    name='Real',
    countries=('BRASIL', )
)

# Currency Formatter will output 2.000,00 Bs.
_FORMATTER.add_sign_definition(
    'R$',
    BRL,
    suffix='R$. '
)

_FORMATTER.add_formatting_definition(
    'pt_BR',
    group_size=3, group_separator=".", decimal_point=",",
    positive_sign="",  trailing_positive_sign="",
    negative_sign="-", trailing_negative_sign="",
    rounding_method=ROUND_HALF_EVEN
)


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
Esempio n. 11
0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import moneyed
from decimal import ROUND_HALF_EVEN
from moneyed.localization import _FORMATTER

BYN = moneyed.add_currency(code='BYN',
                           numeric='933',
                           name='Belarusian ruble',
                           countries=('BELARUS', ))

_FORMATTER.add_sign_definition('default', BYN, suffix=u'Br')

_FORMATTER.add_formatting_definition('by_BY',
                                     group_size=3,
                                     group_separator=".",
                                     decimal_point=",",
                                     positive_sign="",
                                     trailing_positive_sign="",
                                     negative_sign="-",
                                     trailing_negative_sign="",
                                     rounding_method=ROUND_HALF_EVEN)
Esempio n. 12
0
# https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static"),
]

MEDIA_URL = '/media/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

BSS = moneyed.add_currency(code='BSS',
                           numeric='068',
                           name='Bolivar Soberano',
                           countries=('VENEZUELA', ))

# Currency Formatter will output 2.000,00 Bs.
_FORMATTER.add_sign_definition('default', BSS, prefix=u'Bs.S ')

_FORMATTER.add_formatting_definition('es',
                                     group_size=3,
                                     group_separator=".",
                                     decimal_point=",",
                                     positive_sign="",
                                     trailing_positive_sign="",
                                     negative_sign="-",
                                     trailing_negative_sign="",
                                     rounding_method=ROUND_HALF_EVEN)

CRISPY_TEMPLATE_PACK = 'bootstrap4'
Esempio n. 13
0
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
STATIC_URL = '/static/'

## moneyd config

import moneyed
from moneyed.localization import _FORMATTER
from decimal import ROUND_HALF_EVEN

BRL = moneyed.add_currency(code='BRL',
                           numeric='068',
                           name='Real',
                           countries=('BRAZIL', ))

# Currency Formatter will output R$ 2.000,00
_FORMATTER.add_sign_definition('default', BRL, prefix=u'R$ ')

_FORMATTER.add_formatting_definition('pt_BR',
                                     group_size=3,
                                     group_separator=".",
                                     decimal_point=",",
                                     positive_sign="",
                                     trailing_positive_sign="",
                                     negative_sign="-",
                                     trailing_negative_sign="",
                                     rounding_method=ROUND_HALF_EVEN)

CURRENCIES = ('USD', 'BRL')

CORS_ORIGIN_ALLOW_ALL = True
USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/

STATIC_URL = '/static/'

AUTH_USER_MODEL = 'api.User'

PERCENT_CURRENCY = 'PERCENT'
CURRENCIES = ('USD', PERCENT_CURRENCY)

PERCENT = moneyed.add_currency(code=PERCENT_CURRENCY,
                               numeric='999',
                               name='Percent',
                               countries=('Earth', ))

# Currency Formatter will output 2.000,00 Bs.
_FORMATTER.add_sign_definition('default', PERCENT, prefix=u'%')

_FORMATTER.add_formatting_definition('eh_EH',
                                     group_size=3,
                                     group_separator="",
                                     decimal_point=",",
                                     positive_sign="",
                                     trailing_positive_sign="",
                                     negative_sign="-",
                                     trailing_negative_sign="",
                                     rounding_method=ROUND_HALF_DOWN)
Esempio n. 15
0
LANGUAGES = (
    ('pt-br', gettext_noop('Brazilian Portuguese')),
    ('en', gettext_noop('English')),
    # ('es', gettext_noop('Spanish')),
)

SOUTH_TESTS_MIGRATE = False

TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True

# Lib. Py-Moneyed
_FORMATTER.add_sign_definition('default', BRL, prefix='R$ ')
_FORMATTER.add_formatting_definition(
    "default",
    group_size=3, group_separator=".", decimal_point=",",
    positive_sign="", trailing_positive_sign="",
    negative_sign="-", trailing_negative_sign="",
    rounding_method=ROUND_HALF_EVEN
)

from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS

TEMPLATE_CONTEXT_PROCESSORS += ('core.context_processor.shared_context_processor',)


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
Esempio n. 16
0
USE_L10N = True

USE_TZ = False

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

STATIC_URL = '/static/'

TZS = moneyed.add_currency(code='TZS',
                           numeric='068',
                           name='Tanzanian shilling',
                           countries=('TANZANIA', ))

# Currency Formatter will output 2.000,00 Bs.
_FORMATTER.add_sign_definition('default', TZS, prefix=u'Tshs. ')

_FORMATTER.add_formatting_definition('es_TZ',
                                     group_size=3,
                                     group_separator=",",
                                     decimal_point=".",
                                     positive_sign="",
                                     trailing_positive_sign="",
                                     negative_sign="-",
                                     trailing_negative_sign="",
                                     rounding_method=ROUND_HALF_EVEN)

CURRENCIES = ('USD', 'TZS')

DEFAULT_FROM_EMAIL = "*****@*****.**"
Esempio n. 17
0
    'django.contrib.sessions',
    'django.contrib.sites',

    'djmoney',
    'djmoney.contrib.exchange',
    'reversion',

    'tests.testapp'
]

SITE_ID = 1

SECRET_KEY = 'foobar'

USE_L10N = True


_FORMATTER.add_sign_definition('pl_PL', moneyed.PLN, suffix=' zł')
_FORMATTER.add_sign_definition(DEFAULT, moneyed.PLN, suffix=' zł')
_FORMATTER.add_formatting_definition(
    'pl_PL', group_size=3, group_separator=' ', decimal_point=',',
    positive_sign='', trailing_positive_sign='',
    negative_sign='-', trailing_negative_sign='',
    rounding_method=ROUND_HALF_EVEN
)

moneyed.add_currency("USDT", "000", "Tether", None)

OPEN_EXCHANGE_RATES_APP_ID = 'test'
FIXER_ACCESS_KEY = 'test'
Esempio n. 18
0
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 587
LOGIN_URL = '/user/login/'

import moneyed
from moneyed.localization import _FORMATTER
from decimal import ROUND_HALF_EVEN

UAH = moneyed.add_currency(code='UAH',
                           numeric='068',
                           name='Украинская гривна',
                           countries=('UKRAINE', ))

# Currency Formatter will output 2.000,00 Bs.
_FORMATTER.add_sign_definition('default', UAH, prefix=u'грв. ')

_FORMATTER.add_formatting_definition('ua_UA',
                                     group_size=3,
                                     group_separator=".",
                                     decimal_point=",",
                                     positive_sign="",
                                     trailing_positive_sign="",
                                     negative_sign="-",
                                     trailing_negative_sign="",
                                     rounding_method=ROUND_HALF_EVEN)
Esempio n. 19
0
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',

    'djmoney',
    'djmoney.contrib.exchange',
    'reversion',

    'tests.testapp'
]

SITE_ID = 1

SECRET_KEY = 'foobar'

USE_L10N = True


_FORMATTER.add_sign_definition('pl_PL', moneyed.PLN, suffix=' zł')
_FORMATTER.add_sign_definition(DEFAULT, moneyed.PLN, suffix=' zł')
_FORMATTER.add_formatting_definition(
    'pl_PL', group_size=3, group_separator=' ', decimal_point=',',
    positive_sign='', trailing_positive_sign='',
    negative_sign='-', trailing_negative_sign='',
    rounding_method=ROUND_HALF_EVEN
)

OPEN_EXCHANGE_RATES_APP_ID = 'test'
FIXER_ACCESS_KEY = 'test'
Esempio n. 20
0
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os
import moneyed
from moneyed.localization import _FORMATTER
from decimal import ROUND_HALF_EVEN

# Setup angolan money
AOA = moneyed.add_currency(code='AOA',
                           numeric=973,
                           name='Kwanza',
                           countries=('ANGOLA', ))

_FORMATTER.add_sign_definition('default', AOA, prefix=u'kz')

_FORMATTER.add_formatting_definition('pt_AO',
                                     group_size=3,
                                     group_separator=",",
                                     decimal_point=".",
                                     positive_sign="",
                                     trailing_positive_sign="",
                                     negative_sign="-",
                                     trailing_negative_sign="",
                                     rounding_method=ROUND_HALF_EVEN)

CURRENCIES = ('AOA', )

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))