Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于安装方面的问题汇总 #5

Open
sadk opened this issue May 27, 2016 · 68 comments
Open

关于安装方面的问题汇总 #5

sadk opened this issue May 27, 2016 · 68 comments

Comments

@sadk
Copy link

sadk commented May 27, 2016

目前遇到的问题都是 ubuntu:latest 环境。

相关程序的安装:

apt-get update 
apt-get install -y nmap
apt-get install -y libjson-c-dev libjson-c2  libjson0 libjson0-dev
apt-get install -y redis-server zmap libffi-dev libssl-dev python-pip libmysqlclient-dev
apt-get install -y wget unzip

获取代码

wget https://github.com/nanshihui/toolforspider/archive/master.zip
unzip master.zip 
cd toolforspider-master/

安装相关的package

pip install MySQL-python
pip install BeautifulSoup==3.2.1
pip install beautifulsoup4==4.4.1
pip install Django==1.9
pip install python-nmap==0.5.0.post1
pip install DBUtils==1.1
pip install paramiko==1.16.0
pip install ruamel.ordereddict==0.4.9
pip install scapy==2.3.2
pip install scapy-http==1.7
pip install objgraph==2.0.1
pip install pycrypto==2.6.1
pip install dozer
pip install faulthandler
pip install apscheduler

配置

数据库配置位于 spidermanage/spidertool/config.py

如果本机没有装mysql,可以按照如下方式进行安装。

apt-get install mysql-server

启动mysql服务

/etc/init.d/mysql start

建立数据库

mysql -uroot -p -e 'create database datap'

启动

先迁移下数据库

python spidermanage/manage.py  migrate
mysql -uroot -p datap -e 'source /toolforspider-master/spidermanage/sqldata/Dump20160331.sql'

注意:因为环境问题,我去掉了/*!50100 WITH PARSER mysqlcft */ 这段。
mysqlcft 比较老旧,怕以后有兼容性问题,所以不打算继续折腾。

添加网站账户

mysql -uroot -p datap -e "insert INTO user_table set username = 'admin',password = 'admin'"

正式启动

python spidermanage/manage.py runserver 0.0.0.0:80

登录后你会发现有些页面点击进去会发生错误,那是因为作者有些功能还没有完成。

在 /toolforspider-master/spidermanage/common_static/nmaptool/css/bootstrap/ 下
新建 lib 文件夹
并且下载
http://cine9deabril.com.br/fn/jquery/jquery-ui-1.10.2.custom/css/custom-theme/jquery-ui-1.10.2.custom.css
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css
这两个文件到文件夹里

@sadk
Copy link
Author

sadk commented May 27, 2016

使用 python spidermanage/manage.py runserver localhost:80
运行后出现如下错误:

Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x7f98ed8368c0>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 116, in inner_run
    self.check(display_num_errors=True)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 10, in check_url_config
    return check_resolver(resolver)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 19, in check_resolver
    for pattern in resolver.url_patterns:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/toolforspider-master/spidermanage/spidermanage/urls.py", line 23, in <module>
    url(r'^nmaptool/', include('nmaptoolbackground.urls',namespace='nmaptool')),
  File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/toolforspider-master/spidermanage/nmaptoolbackground/urls.py", line 5, in <module>
    from . import nmaproute as route
  File "/toolforspider-master/spidermanage/nmaptoolbackground/nmaproute.py", line 8, in <module>
    from control import usercontrol,jobcontrol,ipcontrol,portcontrol,taskcontrol
  File "/toolforspider-master/spidermanage/nmaptoolbackground/control/taskcontrol.py", line 3, in <module>
    from spidertool import sniffertask,scapytask
  File "/toolforspider-master/spidermanage/spidertool/sniffertask.py", line 8, in <module>
    import  sniffertool
  File "/toolforspider-master/spidermanage/spidertool/sniffertool.py", line 20, in <module>
    import portscantask
  File "/toolforspider-master/spidermanage/spidertool/portscantask.py", line 7, in <module>
    import portscantool
  File "/toolforspider-master/spidermanage/spidertool/portscantool.py", line 11, in <module>
    from template_identify import port_identify
  File "/toolforspider-master/spidermanage/spidertool/template_identify/port_identify.py", line 5, in <module>
    from poc_file import pocsearchtask
  File "/toolforspider-master/spidermanage/spidertool/template_identify/poc_file/__init__.py", line 6, in <module>
    from lib.logger import initLog
ImportError: No module named lib.logger

临时解决办法

mkdir spidermanage/lib/
touch spidermanage/lib/__init__.py

在 spidermanage/lib/ 中新建 logger.py 内容如下

def initLog(a,b,c):
    pass

@sadk
Copy link
Author

sadk commented May 27, 2016

继续尝试运行,依然报错:

Performing system checks...

WARNING: Failed to execute tcpdump. Check it is installed and in the PATH
WARNING: No route found for IPv6 destination :: (no default route?)
Unhandled exception in thread started by <function wrapper at 0x7f0df1bd38c0>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 116, in inner_run
    self.check(display_num_errors=True)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 10, in check_url_config
    return check_resolver(resolver)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 19, in check_resolver
    for pattern in resolver.url_patterns:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/toolforspider-master/spidermanage/spidermanage/urls.py", line 23, in <module>
    url(r'^nmaptool/', include('nmaptoolbackground.urls',namespace='nmaptool')),
  File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/toolforspider-master/spidermanage/nmaptoolbackground/urls.py", line 5, in <module>
    from . import nmaproute as route
  File "/toolforspider-master/spidermanage/nmaptoolbackground/nmaproute.py", line 8, in <module>
    from control import usercontrol,jobcontrol,ipcontrol,portcontrol,taskcontrol
  File "/toolforspider-master/spidermanage/nmaptoolbackground/control/taskcontrol.py", line 4, in <module>
    import schedule
  File "/toolforspider-master/spidermanage/nmaptoolbackground/control/schedule.py", line 3, in <module>
    from apscheduler.schedulers.background import BackgroundScheduler
ImportError: No module named apscheduler.schedulers.background

临时解决办法

pip install apscheduler

@sadk
Copy link
Author

sadk commented May 27, 2016

继续运行,报错

May 27, 2016 - 13:03:45
Django version 1.9, using settings 'spidermanage.settings'
Starting development server at http://localhost:80/
Quit the server with CONTROL-C.
Unhandled exception in thread started by <function wrapper at 0x7fb197d5e668>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 135, in inner_run
    handler = self.get_handler(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/runserver.py", line 23, in get_handler
    handler = super(Command, self).get_handler(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 60, in get_handler
    return get_internal_wsgi_application()
  File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 57, in get_internal_wsgi_application
    sys.exc_info()[2])
  File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 47, in get_internal_wsgi_application
    return import_string(app_path)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/module_loading.py", line 20, in import_string
    module = import_module(module_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/toolforspider-master/spidermanage/spidermanage/wsgi.py", line 17, in <module>
    from dozer import Dozer,Logview
django.core.exceptions.ImproperlyConfigured: WSGI application 'spidermanage.wsgi.application' could not be loaded; Error importing module: 'No module named dozer'

解决办法
pip install dozer
pip install faulthandler

@nanshihui
Copy link
Owner

已更新到wik 谢谢。

@lucyxss
Copy link

lucyxss commented May 29, 2016

lucy@lucy:~/123/toolforspider$ python spidermanage/manage.py migrate
Traceback (most recent call last):
File "spidermanage/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 350, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(_args, _cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 398, in execute
self.check()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/model_checks.py", line 28, in check_all_models
errors.extend(model.check(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 1170, in check
errors.extend(cls._check_fields(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 1247, in _check_fields
errors.extend(field.check(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 925, in check
errors = super(AutoField, self).check(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 208, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 317, in _check_backend_specific_checks
return connections[db].validation.check_field(self, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/validation.py", line 18, in check_field
field_type = field.db_type(connection)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 625, in db_type
return connection.data_types[self.get_internal_type()] % data
File "/usr/local/lib/python2.7/dist-packages/django/db/init.py", line 36, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 184, in data_types
if self.features.supports_microsecond_precision:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/features.py", line 53, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 359, in mysql_version
with self.temporary_connection():
File "/usr/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 564, in temporary_connection
cursor = self.cursor()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 231, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 204, in _cursor
self.ensure_connection()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 95, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 171, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 264, in get_new_connection
conn = Database.connect(
_conn_params)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/init.py", line 81, in Connect
return Connection(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 193, in init
super(Connection, self).init(_args, **kwargs2)
django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

@nanshihui
Copy link
Owner

你是SQL密码 没改好 django 有个默认数据库配置文件

@lucyxss
Copy link

lucyxss commented May 30, 2016

lucy@lucy:~/toolforspider$ python spidermanage/manage.py  migrate
WARNING: No route found for IPv6 destination :: (no default route?)
Traceback (most recent call last):
  File "spidermanage/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 342, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 398, in execute
    self.check()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 10, in check_url_config
    return check_resolver(resolver)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 19, in check_resolver
    for pattern in resolver.url_patterns:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/lucy/toolforspider/spidermanage/spidermanage/urls.py", line 23, in <module>
    url(r'^nmaptool/', include('nmaptoolbackground.urls',namespace='nmaptool')),
  File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/lucy/toolforspider/spidermanage/nmaptoolbackground/urls.py", line 5, in <module>
    from . import nmaproute as route
  File "/home/lucy/toolforspider/spidermanage/nmaptoolbackground/nmaproute.py", line 8, in <module>
    from control import usercontrol,jobcontrol,ipcontrol,portcontrol,taskcontrol
  File "/home/lucy/toolforspider/spidermanage/nmaptoolbackground/control/taskcontrol.py", line 4, in <module>
    import schedule
  File "/home/lucy/toolforspider/spidermanage/nmaptoolbackground/control/schedule.py", line 3, in <module>
    from apscheduler.schedulers.background import BackgroundScheduler
  File "/usr/local/lib/python2.7/dist-packages/apscheduler/__init__.py", line 3, in <module>
    version_info = tuple(int(x) if x.isdigit() else x for x in parsed_version.public.split('.'))
AttributeError: 'tuple' object has no attribute 'public'
lucy@lucy:~/toolforspider$ 

@nanshihui
Copy link
Owner

Before you run it ,you have to make sure that all the environment you have already installed ,
then you can follow my wiki introduction step by step.

@ccavxx
Copy link

ccavxx commented May 30, 2016

折腾了俩三个小时还是没安装成功,唉,好郁闷啊

@fengge98
Copy link

fengge98 commented May 31, 2016

1.toolforspider/spidermanage/spidermanage/settings.py~要在这里添加数据库信息,这一步是不是没写啊
2.登录的时候返回django的debug页面说没有/toolforspider/spidermanage/logs/sqltool.log这个文件,新建一个就好了

@nanshihui
Copy link
Owner

谢谢 已补充

@ghost
Copy link

ghost commented Jun 13, 2016

WARNING: No route found for IPv6 destination :: (no default route?)
Traceback (most recent call last):
File "spidermanage/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 350, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(_args, *_cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 398, in execute
self.check()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 10, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 19, in check_resolver
for pattern in resolver.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/root/toolforspider-master/spidermanage/spidermanage/urls.py", line 23, in
url(r'^nmaptool/', include('nmaptoolbackground.urls',namespace='nmaptool')),
File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/init.py", line 52, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/root/toolforspider-master/spidermanage/nmaptoolbackground/urls.py", line 5, in
from . import nmaproute as route
File "/root/toolforspider-master/spidermanage/nmaptoolbackground/nmaproute.py", line 8, in
from control import usercontrol,jobcontrol,ipcontrol,portcontrol,taskcontrol
File "/root/toolforspider-master/spidermanage/nmaptoolbackground/control/taskcontrol.py", line 4, in
import schedule
File "/root/toolforspider-master/spidermanage/nmaptoolbackground/control/schedule.py", line 3, in
from apscheduler.schedulers.background import BackgroundScheduler
File "/usr/local/lib/python2.7/dist-packages/apscheduler/init.py", line 3, in
version_info = tuple(int(x) if x.isdigit() else x for x in parsed_version.public.split('.'))
AttributeError: 'tuple' object has no attribute 'public'
root@ip-172-31-45-179:/toolforspider-master# pip install apscheduler
Requirement already satisfied (use --upgrade to upgrade): apscheduler in /usr/local/lib/python2.7/dist-packages
Cleaning up...
root@ip-172-31-45-179:
/toolforspider-master#

@nanshihui
Copy link
Owner

这个问题 好像没遇见过,可能是插件的版本。 如果可以的话建议 还是参考wiki 上面的说明进行安装

@xiaoxiaoleo
Copy link

静态文件全部404,报这个WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DIRS.
请问怎么解决啊?

@nanshihui
Copy link
Owner

如果只是出现这句话 (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DIRS.
那是没有什么问题的。

如果静态文件全是404,请按wiki的安装方式来。

@xiaoxiaoleo
Copy link

3q,我试试wiki

@xiaoxiaoleo
Copy link

xiaoxiaoleo commented Jun 17, 2016

静态文件全部404我的解决方法:
1.在Scan-T-master\spidermanage\spidermanage\urls.py里面添加一条路由:
url(r'^static/(?P.*)$', 'django.views.static.serve',{'document_root': "common_static"}),
2.将Scan-T-master\spidermanage目录下的common_static文件夹 更名为static

然后成功~

@nanshihui
Copy link
Owner

@xiaoxiaoleo url.py 有三个,你可能需要明确的描述方式,避免误导

@ghost
Copy link

ghost commented Jun 17, 2016

我和@xiaoxiaoleo 一样python spidermanage/manage.py runserver 0.0.0.0:80后 也出现了
WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DIRS.

System check identified 1 issue (0 silenced).
June 17, 2016 - 12:18:17
Django version 1.9, using settings 'spidermanage.settings'
Starting development server at http://0.0.0.0:80/
Quit the server with CONTROL-C.
WARNING:py.warnings:/usr/local/lib/python2.7/dist-packages/dozer/leak.py:97: UserWarning: PIL is not installed, cannot show charts in Dozer
warnings.warn('PIL is not installed, cannot show charts in Dozer')

init schedule

取消后出现
@ip-172-31-28-150:~/Scan-T-master# Exception in thread APScheduler (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 763, in run
File "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/blocking.py", line 28, in _main_loop
File "/usr/lib/python2.7/threading.py", line 620, in wait
File "/usr/lib/python2.7/threading.py", line 354, in wait
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

用了@xiaoxiaoleo的解决方法,python spidermanage/manage.py runserver 0.0.0.0:80后出现

root@ip-172-31-28-150:~/Scan-T-master# python spidermanage/manage.py runserver 0.0.0.0:80 --insecure
Performing system checks...

WARNING: No route found for IPv6 destination :: (no default route?)
WARNING:py.warnings:/root/Scan-T-master/spidermanage/spidermanage/urls.py:27: RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got django.views.static.serve). Pass the callable instead.
url(r'^static/(?P.*)$', 'django.views.static.serve',{'document_root': "common_static"}),

Unhandled exception in thread started by <function wrapper at 0x7f73a894eb18>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
fn(_args, _kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 116, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 10, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 27, in check_resolver
warnings.extend(check_pattern_startswith_slash(pattern))
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 63, in check_pattern_startswith_slash
regex_pattern = pattern.regex.pattern
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 203, in regex
(regex, six.text_type(e)))
django.core.exceptions.ImproperlyConfigured: "^static/(?P.
)$" is not a valid regular expression: unknown specifier: ?P.

@ghost
Copy link

ghost commented Jun 17, 2016

还有系统可能需要安装gevent For Python
具体方法
下载gevent源码,并解压
wget http://pypi.python.org/packages/source/g/gevent/gevent-0.13.1.tar.gz#md5=5c1b03d9ce39fee4cfe5ea8befb1d4c4
tar -zxvf gevent-0.13.1.tar.gz
安装编译
cd gevent-0.13.1
python fetch_libevent.py
python setup.py build
sudo python setup.py install

@xiaoxiaoleo
Copy link

xiaoxiaoleo commented Jun 17, 2016

@iwarsong 我的解决方法不是完美的处理静态文件404的方案,http://127.0.0.1:8000/admin目录由于调用django自带的静态文件导致静态文件仍然是404。我的django版本是1.9。

@iwarsong 执行时候加一个--insecure试试。 python manage.py runserver --insecure

@nanshihui
Copy link
Owner

@iwarsong @xiaoxiaoleo django 默认在set debug 标签为false 的时候,静态路由 是交给 负载均衡器 来做的,你可以加一个nginx对静态文件路由,或者按着我的wiki 上的说明

@ghost
Copy link

ghost commented Jun 17, 2016

还有是否还得安装PIL~
下载PIL的Source Kit(因为这个包支持全部平台) Imaging--1.1.7.tar.gz
URL: http://www.pythonware.com/products/pil/index.htm

2、解压缩包 tar -zxvf Imaging-1.1.7.tar.gz

3、进入到解压后的目录 cd Imaging-1.1.7
4、Build pakage: python setup.py build_ext -i

5、测试; python selftest.py

6、安装 python setup.py install

@xiaoxiaoleo
Copy link

mysql一共三处地址需要配置:
Scan-T-master\Scan-T-master\spidermanage\spidertool\config.py
Scan-T-master\Scan-T-master\spidermanage\spidermanage\settings.py
Scan-T-master\Scan-T-master\spidermanage\spidertool\scapytool.py

@ghost
Copy link

ghost commented Jun 17, 2016

@nanshihui

@iwarsong @xiaoxiaoleo django 默认在set debug 标签为false 的时候,静态路由 是交给 负载均衡器 来做的,你可以加一个nginx对静态文件路由,或者按着我的wiki 上的说明

这方面我不是很懂能否给个过程thx~

@nanshihui
Copy link
Owner

请按wiki的操作安装

@yinghaochi
Copy link

yinghaochi commented Jul 27, 2016

spidermanage/manage.py runserver 0.0.0.0:80 insecure
Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x7fa1475da758>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
fn(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 116, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 10, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 19, in check_resolver
for pattern in resolver.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/root/Scan-T-master/spidermanage/spidermanage/urls.py", line 23, in
url(r'^nmaptool/', include('nmaptoolbackground.urls',namespace='nmaptool')),
File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/init.py", line 52, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/root/Scan-T-master/spidermanage/nmaptoolbackground/urls.py", line 5, in
from . import nmaproute as route
File "/root/Scan-T-master/spidermanage/nmaptoolbackground/nmaproute.py", line 12, in
from control import usercontrol,jobcontrol,ipcontrol,portcontrol,taskcontrol
File "/root/Scan-T-master/spidermanage/nmaptoolbackground/control/taskcontrol.py", line 3, in
from spidertool import sniffertask,scapytask
File "/root/Scan-T-master/spidermanage/spidertool/sniffertask.py", line 8, in
import sniffertool,Sqldatatask,Sqldata
File "/root/Scan-T-master/spidermanage/spidertool/sniffertool.py", line 20, in
import portscantask
File "/root/Scan-T-master/spidermanage/spidertool/portscantask.py", line 7, in
import portscantool
File "/root/Scan-T-master/spidermanage/spidertool/portscantool.py", line 11, in
from detection import port_identify
File "/root/Scan-T-master/spidermanage/spidertool/detection/port_identify.py", line 3, in
import component_func,port_func
File "/root/Scan-T-master/spidermanage/spidertool/detection/component_func.py", line 3, in
from plugins import port_template,rsyncdeal,sshdeal,ftp_weakpass
ImportError: No module named plugins

求解

@nanshihui
Copy link
Owner

把portscantool.py 第11行的from detection import port_identify 移到26行后面, 如果觉得麻烦的话,你可以不用修改 ,我晚些时候更新.

@yinghaochi
Copy link

谢谢。。可是,进去后访问后台总是500怎么办,也不显示详细信息。真心头疼

@nanshihui
Copy link
Owner

可能是你安装不完整

@nanshihui
Copy link
Owner

No module named elasticsearch_dsl.query 这个没事,如果 你装了es 模块,他会适配上去,不装也没事。
你使用的代码 是 这里的https://github.com/nanshihui/Scan-T/releases

@ldbfpiaoran
Copy link

用的你github博客上的
https://github.com/nanshihui/Scan-T/archive/master.zip这个

@ldbfpiaoran
Copy link

要不留个联系方式 我把服务器账户密码给你?

@nanshihui
Copy link
Owner

试试 搜索框输入 "ip":"104.143.40.245"
如果有结果, 搜索框 输入 这条数据的其他关键词 看看 有没有结果

@ldbfpiaoran
Copy link

这样搜索有结果请问是哪里的问题

@nanshihui
Copy link
Owner

@cuijianxiong 如果你不输入 引号 输入其他 关键词 也有结果, 说明是搜索权重问题。 等你数据变多的时候, 你原来的输入 就会有你要的结果了。

@ldbfpiaoran
Copy link

嗯嗯 还有详细信息{}{错误码为: 'module' object has no attribute '_create_unverified_context'}是正确的吧==

@nanshihui
Copy link
Owner

@cuijianxiong 这个没事,最好运行环境在python2.7的最新版,有些模块对2.6 或者之前的版本 不友好。

@ldbfpiaoran
Copy link

好的 太感谢了

@smallmeet
Copy link

根据安装教程是按不上的,教程改了,文件没变,大家注意坑

@nanshihui
Copy link
Owner

@smallmeet 你安装不上? 遇到什么问题 ? 有参考environment.sh?

@ldbfpiaoran
Copy link

我想问下 扫描队列你是怎么写的 最近也要自己造轮子了

@nanshihui
Copy link
Owner

@cuijianxiong 看你自己需求 ,可以设置好几个缓存队列,按优先级

@ldbfpiaoran
Copy link

好的 明白了~~

@nanshihui
Copy link
Owner

@cuijianxiong 谢谢你的宣传, 只不过因为一些涉密原因,暂时未开源指纹和攻击模型

@ldbfpiaoran
Copy link

客气了~ 学习嘛

@icysun
Copy link

icysun commented Jul 14, 2017

你好,我安装是没什么问题,扫描也没什么问题,目前是无法删除已完成的项目,这是需要完善代码还是?

@nanshihui
Copy link
Owner

@icysun 是的,这部分代码 还没写,如果你感兴趣的话,可以写完提交。谢谢。

@icysun
Copy link

icysun commented Jul 17, 2017

目前都安装完了,数据库也都设置OK,但发现扫描端口信息没有入库信息呢?这是为什么?
三个需要配置的地方 都做了配置

@nanshihui
Copy link
Owner

@icysun 需要配置数据库的地方有两个,Scan-T/spidermanage/spidertool/config.py
Scan-T/spidermanage/spidermanage/settings.py,请逐一确认,如果有报错,请反馈相关报错信息。

@icysun
Copy link

icysun commented Jul 17, 2017

@nanshihui 我已经配置了,你有微信吗?加一下?
目前就是扫描完成,但在web界面没有任何端口信息。

@nanshihui
Copy link
Owner

@icysun 可以联系 我的邮箱, [email protected]

@lucsus
Copy link

lucsus commented Jun 8, 2018

python manage.py runserver 0.0.0.0:80 --insecure
Performing system checks...

System check identified no issues (0 silenced).

You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.

June 08, 2018 - 16:25:57
Django version 1.9, using settings 'spidermanage.settings'
Starting development server at http://0.0.0.0:80/
Quit the server with CONTROL-C.
Unhandled exception in thread started by <function wrapper at 0x7f2f063e7ed8>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 135, in inner_run
handler = self.get_handler(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/runserver.py", line 23, in get_handler
handler = super(Command, self).get_handler(args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 60, in get_handler
return get_internal_wsgi_application()
File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 47, in get_internal_wsgi_application
return import_string(app_path)
File "/usr/local/lib/python2.7/dist-packages/django/utils/module_loading.py", line 20, in import_string
module = import_module(module_path)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/usr/th/端口扫描类/Scan-T/spidermanage/spidermanage/wsgi.py", line 29, in
taskcontrol.scheduleinit()
File "/usr/th/端口扫描类/Scan-T/spidermanage/nmaptoolbackground/control/taskcontrol.py", line 58, in scheduleinit
mainschedule.addschedule(taskitem.tick,'0-7','0-23','
/5','0',id='nmap')#nmap定时任务器
File "/usr/th/端口扫描类/Scan-T/spidermanage/nmaptoolbackground/control/schedule.py", line 31, in addschedule
self.scheduler.add_job(event,type, day_of_week=day_of_week, hour=hour,minute=minute ,second=second,id=id)
File "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/base.py", line 413, in add_job
'trigger': self._create_trigger(trigger, trigger_args),
File "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/base.py", line 907, in _create_trigger
return self._create_plugin_instance('trigger', trigger, trigger_args)
File "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/base.py", line 892, in _create_plugin_instance
return plugin_cls(**constructor_kwargs)
File "/usr/local/lib/python2.7/dist-packages/apscheduler/triggers/cron/init.py", line 83, in init
field = field_class(field_name, exprs, is_default)
File "/usr/local/lib/python2.7/dist-packages/apscheduler/triggers/cron/fields.py", line 33, in init
self.compile_expressions(exprs)
File "/usr/local/lib/python2.7/dist-packages/apscheduler/triggers/cron/fields.py", line 58, in compile_expressions
self.compile_expression(expr)
File "/usr/local/lib/python2.7/dist-packages/apscheduler/triggers/cron/fields.py", line 70, in compile_expression
six.raise_from(exc, None)
File "/usr/lib/python2.7/dist-packages/six.py", line 737, in raise_from
raise value
ValueError: Error validating expression '0-7': the last value (7) is higher than the maximum value (6)

/usr/lib/python2.7/dist-packages/six.py(737)raise_from()
735 else:
736 def raise_from(value, from_value):
--> 737 raise value
738
739
然后我执行了一下python manage.py migrate这个也不行

@nanshihui
Copy link
Owner

@lucsus 你的情况, 应该是你定时器 时间 没改对, 0-7 改成 0-6 就好了

@Angelcansmail
Copy link

Angelcansmail commented Jul 24, 2018

@nanshihui @lucsus 请问这个定时器时间怎么改的呢?遇到同样问题

ValueError: Error validating expression '0-7': the last value (7) is higher than the maximum value (6)

/usr/lib/python2.7/dist-packages/six.py(718)raise_from()
717 def raise_from(value, from_value):
--> 718 raise value
719

@nanshihui
Copy link
Owner

改成6 就好了, 应该是 他的定时组件更新了

@nihaohello
Copy link

@cuijianxiong 这个没事,最好运行环境在python2.7的最新版,有些模块对2.6 或者之前的版本 不友好。

试试 搜索框输入 "ip":"104.143.40.245"
如果有结果, 搜索框 输入 这条数据的其他关键词 看看 有没有结果

作者前辈,我也遇到了有引号,如"mysql",在黑框就存在这个搜索词,但是页面并不显示,我也不确定数据库里面有没有,(其他的没有问题)

@nanshihui
Copy link
Owner

@nihaohello 目前查询引擎有两个,一个是 mysql的 全文检索,一个是es 的 全文检索。 由于是 先通过json 解析,所以需要看你选择的是 哪一个版本

@KangD1W2
Copy link

Unhandled exception in thread started by <function wrapper at 0xb69cb8ec>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 116, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/model_checks.py", line 28, in check_all_models
errors.extend(model.check(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 1170, in check
errors.extend(cls._check_fields(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 1247, in _check_fields
errors.extend(field.check(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 925, in check
errors = super(AutoField, self).check(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 208, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 317, in _check_backend_specific_checks
return connections[db].validation.check_field(self, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/validation.py", line 18, in check_field
field_type = field.db_type(connection)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 625, in db_type
return connection.data_types[self.get_internal_type()] % data
File "/usr/local/lib/python2.7/dist-packages/django/db/init.py", line 36, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 184, in data_types
if self.features.supports_microsecond_precision:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/features.py", line 53, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 359, in mysql_version
with self.temporary_connection():
File "/usr/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 564, in temporary_connection
cursor = self.cursor()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 233, in cursor
cursor = self.make_cursor(self._cursor())
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 204, in _cursor
self.ensure_connection()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 95, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 171, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 264, in get_new_connection
conn = Database.connect(**conn_params)
File "/usr/lib/python2.7/dist-packages/MySQLdb/init.py", line 86, in Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 204, in init
super(Connection, self).init(*args, **kwargs2)
django.db.utils.OperationalError: (1698, "Access denied for user 'root'@'localhost'")
求解

@nihaohello
Copy link

Unhandled exception in thread started by <function wrapper at 0xb69cb8ec>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 116, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/model_checks.py", line 28, in check_all_models
errors.extend(model.check(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 1170, in check
errors.extend(cls._check_fields(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 1247, in _check_fields
errors.extend(field.check(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 925, in check
errors = super(AutoField, self).check(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 208, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 317, in _check_backend_specific_checks
return connections[db].validation.check_field(self, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/validation.py", line 18, in check_field
field_type = field.db_type(connection)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 625, in db_type
return connection.data_types[self.get_internal_type()] % data
File "/usr/local/lib/python2.7/dist-packages/django/db/init.py", line 36, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 184, in data_types
if self.features.supports_microsecond_precision:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/features.py", line 53, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 359, in mysql_version
with self.temporary_connection():
File "/usr/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 564, in temporary_connection
cursor = self.cursor()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 233, in cursor
cursor = self.make_cursor(self._cursor())
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 204, in _cursor
self.ensure_connection()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 95, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", line 171, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 264, in get_new_connection
conn = Database.connect(**conn_params)
File "/usr/lib/python2.7/dist-packages/MySQLdb/init.py", line 86, in Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 204, in init
super(Connection, self).init(*args, **kwargs2)
django.db.utils.OperationalError: (1698, "Access denied for user 'root'@'localhost'")
求解

显然 最后一行 你被自己的数据库拒绝了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests