1
0

index.py 537 B

12345678910111213141516
  1. from django.contrib.auth.decorators import login_required
  2. from SharixAdmin.views.context import get_context
  3. from django.shortcuts import render
  4. @login_required
  5. def index(request):
  6. ph_num = str(request.user.phone_number)
  7. convert_ph_num = f"+{ph_num[:1]} ({ph_num[1:4]}) {ph_num[4:7]}-{ph_num[7:9]}-{ph_num[9:11]}"
  8. #print(convert_ph_num)
  9. context = get_context(request, {
  10. 'title':'Главная/баланс',
  11. 'phone':convert_ph_num
  12. })
  13. return render(request, 'SharixAdmin/main.html', context)