Merge branch 'feature/static-login-page' into 'master'

Feature/static login page

See merge request lilschool/site!369
remotes/origin/hotfix/js-error
Danil 7 years ago
commit 2139ee712b
  1. 2
      apps/auth/templates/auth/login.html
  2. 2
      apps/auth/templates/auth/password_reset.html
  3. 2
      apps/auth/templates/auth/registration-learner.html
  4. 9
      apps/payment/tasks.py
  5. 62
      project/settings.py

@ -5,7 +5,7 @@
{% include "templates/blocks/header.html" with no_auth_btn=True %}
<div id="lilcity-vue-app" class="container">
<div class="section">
<div class="section__center center" style="width: 400px;">
<div class="section__center center" style="max-width: 400px;">
<div class="title">Авторизация</div>
<form id="learner-auth-form" method="post" action="{% url 'lilcity:login' %}" data-no-ajax="1">
{% csrf_token %}

@ -5,7 +5,7 @@
{% include "templates/blocks/header.html" with no_auth_btn=True %}
<div id="lilcity-vue-app" class="container">
<div class="section">
<div class="section__center center" style="width: 400px;">
<div class="section__center center" style="max-width: 400px;">
<div class="title">Восстановление пароля</div>
<form id="password-reset-form" method="post" action="{% url 'lilcity:password_reset' %}">
{% csrf_token %}

@ -5,7 +5,7 @@
{% include "templates/blocks/header.html" with no_auth_btn=True %}
<div id="lilcity-vue-app" class="container">
<div class="section">
<div class="section__center center" style="width: 400px;">
<div class="section__center center" style="max-width: 400px;">
<div class="title">Регистрация</div>
<form id="learner-registration-form" method="post" action="{% url 'lilcity:registration-learner' %}">
{% csrf_token %}

@ -55,4 +55,11 @@ def transaction_to_roistat(user_id, payment_id, event_name, amount, time, status
key = settings.ROISTAT_KEY
url = settings.ROISTAT_API_URL + f'/project/add-orders?key={key}&project={project}'
resp = requests.post(url, json=body)
logger.info('TRANSACTION_TO_ROISTAT: ' + str(resp))
try:
resp_json = resp.json()
except:
resp_json = None
if resp.status_code != 200 or not resp_json or not resp_json.get('processed'):
logger.error('TRANSACTION_TO_ROISTAT for payment # %d, %s RUB: %s' % (payment_id, amount, resp.text))
else:
logger.info('TRANSACTION_TO_ROISTAT: ' + str(resp))

@ -162,6 +162,68 @@ USE_L10N = True
# USE_TZ = True
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
},
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue'
}
},
'formatters': {
'verbose': {
'format': '%(levelname)s:%(name)s: %(message)s '
'(%(asctime)s; %(filename)s:%(lineno)d)',
'datefmt': "%Y-%m-%d %H:%M:%S",
},
'simple': {
'format': '{levelname} {message}',
'style': '{',
},
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
'console': {
'level': 'DEBUG',
'filters': ['require_debug_true'],
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
'log_file': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': 'logs/main.log',
'maxBytes': 1024 * 1024 * 5, # 5 MB
'backupCount': 7,
'formatter': 'verbose',
'filters': ['require_debug_false'],
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins', 'console'],
'level': 'ERROR',
'propagate': True,
},
'django': {
'handlers': ['console', ],
},
'py.warnings': {
'handlers': ['console', ],
},
'': {
'handlers': ['console', 'log_file',],
'level': "INFO",
},
}
}
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/

Loading…
Cancel
Save