Evgeny Polivanov 1 рік тому
батько
коміт
933cdf7e1d

+ 7 - 6
SharixAdmin/admin.py

@@ -40,6 +40,7 @@ send_phone.short_description = u"Отправить сообщение на но
     
 @admin.register(SharixUser)
 class SharixUserAdmin(adm.UserAdmin):
+    
     list_display = (
         'username',
         'phone_number',
@@ -53,17 +54,17 @@ class SharixUserAdmin(adm.UserAdmin):
     )
     fieldsets = (
         ("Главное", {'fields': ('phone_number', 'password')}),
-        ('Персональные данные', {'fields': (('username', 'email'), ('first_name','last_name'))}),
-        ('Разрешения', {'fields': (('is_staff', 'is_active', 'is_superuser'),)}),
+        ('Персональные данные', {'fields': ('username', 'email', 'first_name','last_name')}),
+        ('Разрешения', {'fields': ('is_staff', 'is_active', 'is_superuser',)}),
         ('Прочие разрешения', {'fields': ('groups', 'user_permissions'), 'classes': ['collapse']}),
-        ('Прочее', {'fields': (('last_login', 'date_joined'),)}),
+        ('Прочее', {'fields': ('last_login', 'date_joined',)}),
     )
     add_fieldsets = (
         ("Главное", {'fields': ('phone_number', 'password1', 'password2')}),
-        ('Персональные данные', {'fields': (('username', 'email'), ('first_name','last_name'))}),
-        ('Разрешения', {'fields': (('is_staff', 'is_active', 'is_superuser'),)}),
+        ('Персональные данные', {'fields': ('username', 'email', 'first_name','last_name')}),
+        ('Разрешения', {'fields': ('is_staff', 'is_active', 'is_superuser',)}),
         ('Прочие разрешения', {'fields': ('groups', 'user_permissions'), 'classes': ['collapse']}),
-        ('Прочее', {'fields': (('last_login', 'date_joined'),)}),
+        ('Прочее', {'fields': ('last_login', 'date_joined',)}),
     )
     #raw_id_fields = ('groups', 'user_permissions')
     actions = [send_phone]

+ 1 - 1
SharixAdmin/templates/drf-yasg/redoc.html

@@ -16,7 +16,7 @@
     {% endblock %}
 
     {% block main_styles %}
-        <link rel="stylesheet" type="text/css" href="{% static 'drf-yasg/style.css' %}"/>
+        <link rel="stylesheet" type="text/css" href="{% static 'SharixAdmin/style.css' %}"/>
     {% endblock %}
     {% block extra_styles %}
         {# -- Add any additional CSS scripts here -- #}

+ 2 - 0
SharixAdmin/views.py

@@ -79,6 +79,8 @@ class LoginSharix(LoginView):
 
     
     def get_success_url(self):
+        print(self.request.GET['next'])
+        
         return reverse_lazy('home')
 
 def testPage(request):

+ 4 - 0
core/settings.py

@@ -3,6 +3,7 @@ import os
 from core.db_settings import *
 from core.api_settings import *
 from core.tickets_mail_settings import *
+#from core.jazzmin_settings import *
 # Build paths inside the project like this: BASE_DIR / 'subdir'.
 BASE_DIR = Path(__file__).resolve().parent.parent
 
@@ -17,6 +18,7 @@ CSRF_TRUSTED_ORIGINS = []
 
 # Application definition
 INSTALLED_APPS = [
+    'jazzmin.apps.JazzminConfig',
     'django.contrib.admin',
     'django.contrib.auth',
     'django.contrib.contenttypes',
@@ -36,6 +38,7 @@ INSTALLED_APPS = [
     'schema_graph',
     'drf_yasg',
     'django_spaghetti',
+    
 ]
 
 MIDDLEWARE = [
@@ -46,6 +49,7 @@ MIDDLEWARE = [
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
+    'django.contrib.admindocs.middleware.XViewMiddleware',
 ]
 
 ROOT_URLCONF = 'core.urls'

+ 2 - 1
core/urls.py

@@ -7,10 +7,11 @@ from django.conf.urls.static import static
 
 urlpatterns = (
     [
+    path('admin/doc/', include('django.contrib.admindocs.urls')),
     path('admin/', admin.site.urls),
     path('', include('SharixAdmin.urls')),
     path('tickets/', include("tickets.urls"), name='tickets'),
-   
+    
 
 ] 
 + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

+ 1 - 0
requirements.txt

@@ -18,6 +18,7 @@ django-templated-mail==1.1.1
 djangorestframework==3.14.0
 djangorestframework-simplejwt==4.8.0
 djoser==2.1.0
+docutils==0.19
 drf-yasg==1.21.5
 graphene==3.2.1
 graphql-core==3.2.3