请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

GitHub上面代码运行后账号密码是多少?

默认的密码不知道、我createsuper创建个账号也不行、

正在回答 回答被采纳积分+3

1回答

Jeson 2018-09-04 21:56:52

你好,这个就是django的admin账户密码,你这么操作:


$ python manage.py shell


In [1]: from django.contrib.auth.models import User

In [2]: user =User.objects.get(username='admin')

In [3]: user.set_password('admin')

In [4]: user.save()


0 回复 有任何疑惑可以回复我~
  • 老师,我试了一下还是不行呀。我首先重置了密码:
    python manage.py shell
    Python 2.7.12 (default, Nov  3 2018, 04:44:04) 
    Type "copyright", "credits" or "license" for more information.
    
    IPython 5.5.0 -- An enhanced Interactive Python.
    ?         -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help      -> Python's own help system.
    object?   -> Details about 'object', use 'object??' for extra details.
    In [1]: from django.contrib.auth.models import User
    In [2]: user =User.objects.get(username='admin')
    In [3]:  user.set_password('1234qwer')
    In [4]: user.save()
    In [5]: quit
    回复 有任何疑惑可以回复我~ 2018-11-04 12:55:06
  • 然后去页面访问,查看runserver的输出
    Exception happened during processing of request from ('61.135.155.34', 64146)
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/SocketServer.py", line 596, in process_request_thread
        self.finish_request(request, client_address)
      File "/usr/local/lib/python2.7/SocketServer.py", line 331, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/usr/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 102, in __init__
        super(WSGIRequestHandler, self).__init__(*args, **kwargs)
      File "/usr/local/lib/python2.7/SocketServer.py", line 652, in __init__
        self.handle()
    回复 有任何疑惑可以回复我~ 2018-11-04 12:57:10
  • 接上文
    File "/usr/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 167, in handle
        self.raw_requestline = self.rfile.readline(65537)
      File "/usr/local/lib/python2.7/socket.py", line 480, in readline
        data = self._sock.recv(self._rbufsize)
    error: [Errno 104] Connection reset by peer
    ----------------------------------------
    [04/Nov/2018 10:42:16]"GET /list/?type=cb&p=1 HTTP/1.1" 302 0
    [04/Nov/2018 10:42:16]"GET /user/login/ HTTP/1.1" 200 6479
    [04/Nov/2018 10:42:48]"POST /user/login_haddle/ HTTP/1.1" 200 6493
    
    前端的返回是
    在用户名的输入框下面出现红字:
    用户名错误,请重新输入
    回复 有任何疑惑可以回复我~ 2018-11-04 12:57:43
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信