index.py 576 B

123456789101112131415161718
  1. from django.contrib.auth.decorators import login_required
  2. from SharixAdmin.views.context import get_context
  3. from django.shortcuts import render
  4. from django.utils.translation import gettext as _
  5. @login_required
  6. def index(request):
  7. ph_num = str(request.user.phone_number)
  8. convert_ph_num = f"+{ph_num[:1]} ({ph_num[1:4]}) {ph_num[4:7]}-{ph_num[7:9]}-{ph_num[9:11]}"
  9. #print(convert_ph_num)
  10. context = get_context(request, {
  11. 'title':_('Home/Balance'),
  12. 'phone':convert_ph_num
  13. })
  14. return render(request, 'SharixAdmin/main.html', context)