初版代码

detached
RogerWork 1 year ago
parent 6d331985e6
commit 5a7f9fdab3
  1. 2
      common/base_model.py
  2. 4
      dingxin_toolbox_drf/settings.py
  3. 5
      dingxin_toolbox_drf/urls.py
  4. 231
      logs/dingxin.log
  5. 19
      update/admin.py
  6. 1
      update/apps.py
  7. 17
      update/models.py
  8. 11
      update/urls.py
  9. 17
      update/views.py

@ -3,7 +3,7 @@ from django.db import models
# Create your models here.
class BaseModels(models.Model):
update_time = models.DateTimeField(auto_now=True, verbose_name="最后更新时间")
update_time = models.DateTimeField(auto_now=True, verbose_name='最后更新时间', help_text='最后更新时间')
class Meta:
abstract = True # 设置为抽象类

@ -38,7 +38,8 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'corsheaders',
'corsheaders', # coreapi生成接口文档
'rest_framework.authtoken', # Token验证应用
'update',
]
@ -168,6 +169,7 @@ LOGGING = {
}
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.TokenAuthentication',), # 配置验证方式
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema' # 配置接口文档
}

@ -17,10 +17,11 @@ Including another URLconf
from django.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls
from rest_framework.authtoken.views import obtain_auth_token
urlpatterns = [
path('admin/', admin.site.urls),
path('docs/', include_docs_urls(title='接口文档')),
path('api-token-auth/', obtain_auth_token),
path('update/', include('update.urls')),
path('docs/', include_docs_urls(title='接口文档')),
]

@ -181,3 +181,234 @@ WARNING 2023-11-06 21:25:24,661 log 241 Forbidden: /docs/
WARNING 2023-11-06 21:25:24,662 basehttp 212 "GET /docs/ HTTP/1.1" 403 5171
WARNING 2023-11-06 21:25:32,868 log 241 Not Found: /update/docs/
WARNING 2023-11-06 21:25:32,869 basehttp 212 "GET /update/docs/ HTTP/1.1" 404 3096
INFO 2023-11-07 08:24:17,834 autoreload 668 Watching for file changes with StatReloader
WARNING 2023-11-07 08:25:06,608 log 241 Not Found: /
WARNING 2023-11-07 08:25:06,609 basehttp 212 "GET / HTTP/1.1" 404 2399
WARNING 2023-11-07 08:25:07,409 log 241 Not Found: /favicon.ico
WARNING 2023-11-07 08:25:07,410 basehttp 212 "GET /favicon.ico HTTP/1.1" 404 2450
WARNING 2023-11-07 08:25:16,087 log 241 Not Found: /doces
WARNING 2023-11-07 08:25:16,088 basehttp 212 "GET /doces HTTP/1.1" 404 2432
INFO 2023-11-07 08:25:19,955 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 08:25:20,114 basehttp 212 "GET /static/rest_framework/css/bootstrap.min.css HTTP/1.1" 304 0
INFO 2023-11-07 08:25:20,136 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 08:25:20,463 basehttp 212 "GET /static/rest_framework/css/bootstrap-theme.min.css HTTP/1.1" 200 23411
INFO 2023-11-07 08:25:20,477 basehttp 212 "GET /static/rest_framework/css/font-awesome-4.0.3.css HTTP/1.1" 200 21658
INFO 2023-11-07 08:25:20,481 basehttp 212 "GET /static/rest_framework/js/jquery-3.5.1.min.js HTTP/1.1" 304 0
INFO 2023-11-07 08:25:20,484 basehttp 212 "GET /static/rest_framework/js/bootstrap.min.js HTTP/1.1" 304 0
INFO 2023-11-07 08:25:20,487 basehttp 212 "GET /static/rest_framework/docs/js/api.js HTTP/1.1" 200 10391
INFO 2023-11-07 08:25:20,498 basehttp 212 "GET /static/rest_framework/docs/css/base.css HTTP/1.1" 200 6156
INFO 2023-11-07 08:25:20,508 basehttp 212 "GET /static/rest_framework/docs/css/jquery.json-view.min.css HTTP/1.1" 200 1307
INFO 2023-11-07 08:25:20,519 basehttp 212 "GET /static/rest_framework/docs/js/jquery.json-view.min.js HTTP/1.1" 200 2700
INFO 2023-11-07 08:25:20,528 basehttp 212 "GET /static/rest_framework/js/coreapi-0.1.1.js HTTP/1.1" 200 157600
INFO 2023-11-07 08:25:20,628 basehttp 212 "GET /static/rest_framework/fonts/fontawesome-webfont.woff?v=4.0.3 HTTP/1.1" 200 44432
INFO 2023-11-07 08:25:20,848 basehttp 212 "GET /static/rest_framework/docs/img/favicon.ico HTTP/1.1" 200 5430
INFO 2023-11-07 08:25:42,181 basehttp 212 "POST /api-token-auth/ HTTP/1.1" 200 52
INFO 2023-11-07 08:25:43,870 basehttp 212 "POST /api-token-auth/ HTTP/1.1" 200 52
INFO 2023-11-07 08:35:44,093 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 08:35:44,741 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 08:37:14,440 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 08:37:15,279 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 08:37:34,278 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 08:37:35,020 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 08:37:43,133 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 08:37:43,214 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 08:45:38,825 basehttp 212 "GET /update/cinema_list HTTP/1.1" 301 0
ERROR 2023-11-07 08:45:38,899 log 241 Internal Server Error: /update/cinema_list/
Traceback (most recent call last):
File "D:\Code\Work\Python\dingxin_toolbox_drf\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
response = get_response(request)
File "D:\Code\Work\Python\dingxin_toolbox_drf\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: CinemaViewSet() takes no arguments
ERROR 2023-11-07 08:45:38,901 basehttp 212 "GET /update/cinema_list/ HTTP/1.1" 500 61266
INFO 2023-11-07 08:46:50,500 basehttp 212 "GET /update/cinema_list HTTP/1.1" 301 0
ERROR 2023-11-07 08:46:50,524 log 241 Internal Server Error: /update/cinema_list/
Traceback (most recent call last):
File "D:\Code\Work\Python\dingxin_toolbox_drf\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
response = get_response(request)
File "D:\Code\Work\Python\dingxin_toolbox_drf\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: CinemaViewSet() takes no arguments
ERROR 2023-11-07 08:46:50,526 basehttp 212 "GET /update/cinema_list/ HTTP/1.1" 500 61440
INFO 2023-11-07 08:49:18,460 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 08:49:19,226 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 08:49:20,328 basehttp 212 "GET /update/cinema_list HTTP/1.1" 301 0
ERROR 2023-11-07 08:49:20,362 log 241 Internal Server Error: /update/cinema_list/
Traceback (most recent call last):
File "D:\Code\Work\Python\dingxin_toolbox_drf\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
response = get_response(request)
File "D:\Code\Work\Python\dingxin_toolbox_drf\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: CinemaViewSet() takes no arguments
ERROR 2023-11-07 08:49:20,363 basehttp 212 "GET /update/cinema_list/ HTTP/1.1" 500 61440
INFO 2023-11-07 08:49:33,773 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 08:49:33,882 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 08:53:24,738 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\urls.py changed, reloading.
INFO 2023-11-07 08:53:25,456 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 08:56:19,045 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 08:56:19,894 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:05:34,985 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\dingxin_toolbox_drf\settings.py changed, reloading.
INFO 2023-11-07 09:05:35,851 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:05:40,770 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 09:05:40,882 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 09:06:15,693 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\dingxin_toolbox_drf\settings.py changed, reloading.
INFO 2023-11-07 09:06:16,567 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:06:28,151 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:06:38,956 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 09:06:39,068 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 09:06:39,914 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 09:06:40,086 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 09:08:48,377 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\dingxin_toolbox_drf\settings.py changed, reloading.
INFO 2023-11-07 09:08:49,059 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:11:15,098 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\dingxin_toolbox_drf\urls.py changed, reloading.
INFO 2023-11-07 09:11:15,827 autoreload 668 Watching for file changes with StatReloader
WARNING 2023-11-07 09:11:20,611 log 241 Not Found: /docs/
WARNING 2023-11-07 09:11:20,627 basehttp 212 "GET /docs/ HTTP/1.1" 404 2327
INFO 2023-11-07 09:11:30,616 basehttp 212 "GET /update/docs/ HTTP/1.1" 200 13469
INFO 2023-11-07 09:11:30,863 basehttp 212 "GET /update/docs/schema.js HTTP/1.1" 200 836
INFO 2023-11-07 09:12:10,642 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\urls.py changed, reloading.
INFO 2023-11-07 09:12:11,869 autoreload 668 Watching for file changes with StatReloader
WARNING 2023-11-07 09:12:12,567 log 241 Not Found: /update/docs/
WARNING 2023-11-07 09:12:12,567 basehttp 212 "GET /update/docs/ HTTP/1.1" 404 3211
WARNING 2023-11-07 09:12:13,544 log 241 Not Found: /update/docs/
WARNING 2023-11-07 09:12:13,544 basehttp 212 "GET /update/docs/ HTTP/1.1" 404 3211
INFO 2023-11-07 09:12:17,261 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 09:12:17,495 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 09:15:08,986 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 09:15:09,792 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:15:14,172 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 09:15:14,299 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 09:20:16,877 basehttp 212 "GET /admin HTTP/1.1" 301 0
INFO 2023-11-07 09:20:16,886 basehttp 212 "GET /admin/ HTTP/1.1" 302 0
INFO 2023-11-07 09:20:17,012 basehttp 212 "GET /admin/login/?next=/admin/ HTTP/1.1" 200 4195
INFO 2023-11-07 09:20:17,518 basehttp 212 "GET /static/admin/css/login.css HTTP/1.1" 200 958
INFO 2023-11-07 09:20:17,518 basehttp 212 "GET /static/admin/css/nav_sidebar.css HTTP/1.1" 200 2694
INFO 2023-11-07 09:20:17,537 basehttp 212 "GET /static/admin/css/base.css HTTP/1.1" 200 21207
INFO 2023-11-07 09:20:17,558 basehttp 212 "GET /static/admin/js/nav_sidebar.js HTTP/1.1" 200 3063
INFO 2023-11-07 09:20:17,569 basehttp 212 "GET /static/admin/css/dark_mode.css HTTP/1.1" 200 2929
INFO 2023-11-07 09:20:17,571 basehttp 212 "GET /static/admin/css/responsive.css HTTP/1.1" 200 18533
INFO 2023-11-07 09:20:17,571 basehttp 212 "GET /static/admin/js/theme.js HTTP/1.1" 200 1943
INFO 2023-11-07 09:20:20,813 basehttp 212 "POST /admin/login/?next=/admin/ HTTP/1.1" 302 0
INFO 2023-11-07 09:20:20,988 basehttp 212 "GET /admin/ HTTP/1.1" 200 6224
INFO 2023-11-07 09:20:21,066 basehttp 212 "GET /static/admin/css/dashboard.css HTTP/1.1" 200 441
INFO 2023-11-07 09:20:21,089 basehttp 212 "GET /static/admin/img/icon-changelink.svg HTTP/1.1" 200 380
INFO 2023-11-07 09:20:21,089 basehttp 212 "GET /static/admin/img/icon-addlink.svg HTTP/1.1" 200 331
INFO 2023-11-07 09:20:23,287 basehttp 212 "GET /admin/authtoken/tokenproxy/ HTTP/1.1" 200 8429
INFO 2023-11-07 09:20:23,379 basehttp 212 "GET /static/admin/css/changelists.css HTTP/1.1" 200 6566
INFO 2023-11-07 09:20:23,395 basehttp 212 "GET /static/admin/js/jquery.init.js HTTP/1.1" 200 347
INFO 2023-11-07 09:20:23,408 basehttp 212 "GET /static/admin/js/core.js HTTP/1.1" 200 5682
INFO 2023-11-07 09:20:23,408 basehttp 212 "GET /static/admin/js/actions.js HTTP/1.1" 200 7872
INFO 2023-11-07 09:20:23,408 basehttp 212 "GET /static/admin/js/admin/RelatedObjectLookups.js HTTP/1.1" 200 8943
INFO 2023-11-07 09:20:23,408 basehttp 212 "GET /static/admin/js/urlify.js HTTP/1.1" 200 7887
INFO 2023-11-07 09:20:23,426 basehttp 212 "GET /static/admin/js/prepopulate.js HTTP/1.1" 200 1531
INFO 2023-11-07 09:20:23,451 basehttp 212 "GET /static/admin/js/vendor/jquery/jquery.js HTTP/1.1" 200 292458
INFO 2023-11-07 09:20:23,472 basehttp 212 "GET /static/admin/js/filters.js HTTP/1.1" 200 978
INFO 2023-11-07 09:20:23,472 basehttp 212 "GET /static/admin/js/vendor/xregexp/xregexp.js HTTP/1.1" 200 232381
INFO 2023-11-07 09:20:23,509 basehttp 212 "GET /static/admin/img/sorting-icons.svg HTTP/1.1" 200 1097
INFO 2023-11-07 09:20:23,510 basehttp 212 "GET /static/admin/img/tooltag-add.svg HTTP/1.1" 200 331
INFO 2023-11-07 09:32:41,339 basehttp 212 "GET /admin/authtoken/tokenproxy/add/ HTTP/1.1" 200 9237
INFO 2023-11-07 09:32:41,457 basehttp 212 "GET /static/admin/css/forms.css HTTP/1.1" 200 9047
INFO 2023-11-07 09:32:41,473 basehttp 212 "GET /static/admin/img/icon-viewlink.svg HTTP/1.1" 200 581
INFO 2023-11-07 09:32:41,487 basehttp 212 "GET /static/admin/js/prepopulate_init.js HTTP/1.1" 200 586
INFO 2023-11-07 09:32:41,497 basehttp 212 "GET /static/admin/css/widgets.css HTTP/1.1" 200 11900
INFO 2023-11-07 09:32:41,511 basehttp 212 "GET /static/admin/js/change_form.js HTTP/1.1" 200 606
INFO 2023-11-07 09:32:41,555 basehttp 212 "GET /admin/jsi18n/ HTTP/1.1" 200 8560
INFO 2023-11-07 09:32:43,295 basehttp 212 "GET /admin/authtoken/tokenproxy/ HTTP/1.1" 200 8429
INFO 2023-11-07 09:34:16,743 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\apps.py changed, reloading.
INFO 2023-11-07 09:34:17,557 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:34:18,288 basehttp 212 "GET /admin/authtoken/tokenproxy/ HTTP/1.1" 200 8429
INFO 2023-11-07 09:34:30,168 basehttp 212 "POST /admin/logout/ HTTP/1.1" 200 3578
INFO 2023-11-07 09:34:31,613 basehttp 212 "GET /admin/ HTTP/1.1" 302 0
INFO 2023-11-07 09:34:31,643 basehttp 212 "GET /admin/login/?next=/admin/ HTTP/1.1" 200 4195
INFO 2023-11-07 09:34:34,861 basehttp 212 "POST /admin/login/?next=/admin/ HTTP/1.1" 302 0
INFO 2023-11-07 09:34:34,986 basehttp 212 "GET /admin/ HTTP/1.1" 200 6224
INFO 2023-11-07 09:44:44,968 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\admin.py changed, reloading.
INFO 2023-11-07 09:44:45,950 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:46:52,304 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\admin.py changed, reloading.
INFO 2023-11-07 09:46:53,369 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:47:04,361 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\admin.py changed, reloading.
INFO 2023-11-07 09:47:05,115 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:47:14,397 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\admin.py changed, reloading.
INFO 2023-11-07 09:47:15,116 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:50:40,850 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\admin.py changed, reloading.
INFO 2023-11-07 09:50:41,560 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:50:48,165 basehttp 212 "GET /admin/ HTTP/1.1" 200 6885
INFO 2023-11-07 09:51:18,615 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\models.py changed, reloading.
INFO 2023-11-07 09:51:19,346 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 09:51:34,384 basehttp 212 "GET /admin/ HTTP/1.1" 200 6884
INFO 2023-11-07 09:51:36,954 basehttp 212 "GET /admin/update/cinema/ HTTP/1.1" 200 12687
INFO 2023-11-07 09:51:37,212 basehttp 212 "GET /admin/jsi18n/ HTTP/1.1" 200 8560
INFO 2023-11-07 09:51:37,311 basehttp 212 "GET /static/admin/img/search.svg HTTP/1.1" 200 458
INFO 2023-11-07 09:51:48,259 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 09:51:48,376 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 09:51:57,368 basehttp 212 "GET /admin/update/cinema/ HTTP/1.1" 200 12687
INFO 2023-11-07 09:51:57,522 basehttp 212 "GET /admin/jsi18n/ HTTP/1.1" 200 8560
INFO 2023-11-07 09:51:58,602 basehttp 212 "GET /admin/update/cinema/ HTTP/1.1" 200 12687
INFO 2023-11-07 09:51:58,762 basehttp 212 "GET /admin/jsi18n/ HTTP/1.1" 200 8560
INFO 2023-11-07 09:53:08,130 basehttp 212 "GET /docs/ HTTP/1.1" 200 13441
INFO 2023-11-07 09:53:08,235 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 828
INFO 2023-11-07 10:15:56,446 basehttp 212 "GET /update/cinema_list HTTP/1.1" 301 0
ERROR 2023-11-07 10:15:56,493 log 241 Internal Server Error: /update/cinema_list/
Traceback (most recent call last):
File "D:\Code\Work\Python\dingxin_toolbox_drf\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
response = get_response(request)
File "D:\Code\Work\Python\dingxin_toolbox_drf\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: CinemaViewSet() takes no arguments
ERROR 2023-11-07 10:15:56,493 basehttp 212 "GET /update/cinema_list/ HTTP/1.1" 500 61440
INFO 2023-11-07 10:18:53,278 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:18:54,079 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:19:42,407 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\urls.py changed, reloading.
INFO 2023-11-07 10:19:43,086 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:22:25,066 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:23:42,163 basehttp 212 "GET /update/cinema_list HTTP/1.1" 301 0
INFO 2023-11-07 10:23:42,282 basehttp 212 "GET /update/cinema_list/ HTTP/1.1" 200 483
WARNING 2023-11-07 10:25:26,585 log 241 Not Found: /cinema_get/1/
WARNING 2023-11-07 10:25:26,586 basehttp 212 "GET /cinema_get/1/ HTTP/1.1" 404 2456
WARNING 2023-11-07 10:30:54,531 log 241 Not Found: /cinema_get/1/
WARNING 2023-11-07 10:30:54,532 basehttp 212 "GET /cinema_get/1/ HTTP/1.1" 404 2456
INFO 2023-11-07 10:32:28,225 basehttp 212 "GET /docs/ HTTP/1.1" 200 43841
INFO 2023-11-07 10:32:28,380 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 4948
WARNING 2023-11-07 10:33:27,781 log 241 Unauthorized: /update/cinema_get/1/
WARNING 2023-11-07 10:33:27,781 basehttp 212 "GET /update/cinema_get/1/ HTTP/1.1" 401 43
WARNING 2023-11-07 10:33:57,537 log 241 Unauthorized: /update/cinema_get/1/
WARNING 2023-11-07 10:33:57,538 basehttp 212 "GET /update/cinema_get/1/ HTTP/1.1" 401 92
INFO 2023-11-07 10:34:16,856 basehttp 212 "GET /update/cinema_get/1/ HTTP/1.1" 200 235
WARNING 2023-11-07 10:34:33,050 log 241 Not Found: /cinema_get/1/
WARNING 2023-11-07 10:34:33,051 basehttp 212 "GET /cinema_get/1/ HTTP/1.1" 404 2456
INFO 2023-11-07 10:34:56,707 basehttp 212 "GET /update/cinema_get/1/ HTTP/1.1" 200 235
INFO 2023-11-07 10:35:57,241 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:35:58,010 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:36:04,858 basehttp 212 "GET /update/cinema_list/ HTTP/1.1" 200 483
INFO 2023-11-07 10:36:14,646 basehttp 212 "GET /update/cinema_get/1/ HTTP/1.1" 200 235
INFO 2023-11-07 10:36:18,499 basehttp 212 "GET /update/cinema_get/2/ HTTP/1.1" 200 245
INFO 2023-11-07 10:36:28,821 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:36:29,611 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:36:45,310 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:36:46,076 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:36:58,634 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:36:59,449 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:38:01,639 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:38:02,439 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:38:31,843 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:38:32,743 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:38:35,446 basehttp 212 "GET /docs/ HTTP/1.1" 200 43969
INFO 2023-11-07 10:38:35,753 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 5128
INFO 2023-11-07 10:38:55,183 basehttp 212 "GET /docs/ HTTP/1.1" 200 43969
INFO 2023-11-07 10:38:55,268 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:38:56,132 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:38:56,743 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 5164
INFO 2023-11-07 10:38:59,271 basehttp 212 "GET /docs/ HTTP/1.1" 200 43937
INFO 2023-11-07 10:38:59,375 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 5164
INFO 2023-11-07 10:39:55,526 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:39:56,520 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:41:13,772 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\views.py changed, reloading.
INFO 2023-11-07 10:41:14,873 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:42:58,791 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\update\models.py changed, reloading.
INFO 2023-11-07 10:42:59,509 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 10:43:08,621 basehttp 212 "GET /docs/ HTTP/1.1" 200 45133
INFO 2023-11-07 10:43:08,747 basehttp 212 "GET /docs/schema.js HTTP/1.1" 200 5536
INFO 2023-11-07 10:45:54,722 autoreload 266 D:\Code\Work\Python\dingxin_toolbox_drf\common\base_model.py changed, reloading.
INFO 2023-11-07 10:45:55,519 autoreload 668 Watching for file changes with StatReloader
INFO 2023-11-07 16:51:26,696 basehttp 212 "GET /update/cinema_list HTTP/1.1" 301 0
INFO 2023-11-07 16:51:26,827 basehttp 212 "GET /update/cinema_list/ HTTP/1.1" 200 483

@ -1,3 +1,22 @@
from django.contrib import admin
from update.models import Cinema
# Register your models here.
@admin.register(Cinema)
class Cinema(admin.ModelAdmin):
admin.site.site_title = '影院管理'
admin.site.site_header = '影院管理'
admin.site.index_title = '影院管理'
# 设置显示字段
list_display = ['name', 'ip', 'zz_num', 'inner_id', 'db_user', 'db_pwd', 'sys_ver', 'client_ver', 'update_time']
# 设置搜素条件
search_fields = ['ip']
# 设置过滤条件
list_filter = ['ip', 'sys_ver']
# 设置日期选择器
data_hierarchy = 'update_time'
# 设置分页
list_per_page = 10
# 设置排序
ordering = ['ip']

@ -4,3 +4,4 @@ from django.apps import AppConfig
class UpdateConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'update'
verbose_name = '影院信息'

@ -7,18 +7,19 @@ class Cinema(BaseModels):
影院信息表
"""
id = models.AutoField(primary_key=True)
name = models.CharField(verbose_name='影院名称', max_length=100, null=False)
ip = models.CharField(verbose_name='影院ip', max_length=20, null=False)
zz_num = models.CharField(verbose_name='影院转账8位编码', max_length=8, null=False)
inner_id = models.CharField(verbose_name="影院4位编码", max_length=4, null=False)
db_user = models.CharField(verbose_name='影院数据库账号', max_length=20, null=False)
db_pwd = models.CharField(verbose_name='影院数据库密码', max_length=50, null=False)
sys_ver = models.CharField(verbose_name='鼎新系统版本', max_length=50, null=False)
client_ver = models.CharField(verbose_name='鼎新客户端版本', max_length=50, null=False)
name = models.CharField(verbose_name='影院名称', max_length=100, null=False, help_text='影院名称')
ip = models.CharField(verbose_name='影院ip', max_length=20, null=False, help_text='影院ip')
zz_num = models.CharField(verbose_name='影院转账8位编码', max_length=8, null=False, help_text='影院转账8位编码')
inner_id = models.CharField(verbose_name="影院4位编码", max_length=4, null=False, help_text='影院4位编码')
db_user = models.CharField(verbose_name='影院数据库账号', max_length=20, null=False, help_text='影院数据库账号')
db_pwd = models.CharField(verbose_name='影院数据库密码', max_length=50, null=False, help_text='影院数据库密码')
sys_ver = models.CharField(verbose_name='鼎新系统版本', max_length=50, null=False, help_text='鼎新系统版本')
client_ver = models.CharField(verbose_name='鼎新客户端版本', max_length=50, null=False, help_text='鼎新客户端版本')
def __str__(self):
return self.ip
class Meta:
verbose_name = '影院信息'
verbose_name_plural = '影院信息'
db_table = 'update_cinema'

@ -14,14 +14,13 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from update import views
urlpatterns = [
path('cinema_list/', views.CinemaViewSet),
path('cinema_add/', views.CinemaViewSet),
path('cinema_get/<pk>/', views.CinemaViewSet),
path('cinema_update/<pk>/', views.CinemaViewSet),
path('cinema_delete/<pk>/', views.CinemaViewSet),
path('cinema_list/', views.CinemaViewSet.as_view({'get': 'list'})),
path('cinema_add/', views.CinemaViewSet.as_view({'post': 'create'})),
path('cinema_get/<pk>/', views.CinemaViewSet.as_view({'get': 'retrieve'})),
path('cinema_update/<pk>/', views.CinemaViewSet.as_view({'put': 'update'})),
path('cinema_delete/<pk>/', views.CinemaViewSet.as_view({'delete': 'destroy'})),
]

@ -1,12 +1,17 @@
from rest_framework import viewsets, mixins
from rest_framework import viewsets, permissions
from update.models import Cinema
from update.serializers import CinemaSerializer
class CinemaViewSet(mixins.ListModelMixin,
mixins.RetrieveModelMixin,
mixins.CreateModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin):
class CinemaViewSet(viewsets.ModelViewSet):
# 接口文档的中文注释
"""
create: 添加测试影院
list: 获取测试影院列表
retrieve: 获取某个影院的信息
update: 更新某个影院的信息
delete: 删除指定影院
"""
queryset = Cinema.objects.all()
serializer_class = CinemaSerializer
permission_classes = (permissions.IsAuthenticated,)

Loading…
Cancel
Save