【发布时间】:2022-08-21 16:31:53
【问题描述】:
再会。使用 Django REST 框架创建项目https://github.com/LeonidPrice/advertisementboard 启动服务器时出现以下错误: (所有迁移都已完成)
(board) D:\\python_projects\\board\\board>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File \"C:\\Program Files\\Python310\\lib\\threading.py\", line 1009, in _bootstrap_inner
self.run()
File \"C:\\Program Files\\Python310\\lib\\threading.py\", line 946, in run
self._target(*self._args, **self._kwargs)
File \"D:\\python_projects\\board\\board\\lib\\site-packages\\django\\utils\\autoreload.py\", line 64, in wrapper
fn(*args, **kwargs)
File \"D:\\python_projects\\board\\board\\lib\\site-packages\\django\\core\\management\\commands\\runserver.py\", line 134, in inner_run
self.check(display_num_errors=True)
File \"D:\\python_projects\\board\\board\\lib\\site-packages\\django\\core\\management\\base.py\", line 558, in check
raise SystemCheckError(msg)
django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:
ERRORS:
?: (captcha.recaptcha_test_key_error) RECAPTCHA_PRIVATE_KEY or RECAPTCHA_PUBLIC_KEY is making use of the Google test keys and will not behave as expected in a production environment
HINT: Update settings.RECAPTCHA_PRIVATE_KEY and/or settings.RECAPTCHA_PUBLIC_KEY. Alternatively this check can be ignored by adding `SILENCED_SYSTEM_CHECKS = [\'captcha.recaptcha_test_key_error\']` to your settings file.
WARNINGS:
main.AdditionalImage: (models.W042) Auto-created primary key used when not defining a primary key type, by default \'django.db.models.AutoField\'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the MainConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. \'django.db.models.BigAutoField\'.
main.AdvUser: (models.W042) Auto-created primary key used when not defining a primary key type, by default \'django.db.models.AutoField\'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the MainConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. \'django.db.models.BigAutoField\'.
main.Board: (models.W042) Auto-created primary key used when not defining a primary key type, by default \'django.db.models.AutoField\'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the MainConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. \'django.db.models.BigAutoField\'.
main.Comment: (models.W042) Auto-created primary key used when not defining a primary key type, by default \'django.db.models.AutoField\'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the MainConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. \'django.db.models.BigAutoField\'.
main.Rubric: (models.W042) Auto-created primary key used when not defining a primary key type, by default \'django.db.models.AutoField\'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the MainConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. \'django.db.models.BigAutoField\'.
main.SubRubric: (models.W042) Auto-created primary key used when not defining a primary key type, by default \'django.db.models.AutoField\'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the MainConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. \'django.db.models.BigAutoField\'.
main.SuperRubric: (models.W042) Auto-created primary key used when not defining a primary key type, by default \'django.db.models.AutoField\'.
HINT: Configure the DEFAULT_AUTO_FIELD setting or the MainConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. \'django.db.models.BigAutoField\'.
System check identified 8 issues (0 silenced).
请告诉我是什么问题以及如何解决?
标签: python django django-rest-framework captcha traceback