简体   繁体   中英

Django admin login

I am pretty new to Django and Python. I am using Pycharm as my IDE (may not be relevant to my question). I am working on existing code. The previous programmer has developed the basic framework. He has created admin page. When I run django server using manage.py I use the following url to login:

127.0.0.1:8000/admin/login/?next=/admin/

Where can I find the credentials for this page? Is this generic or somewhere in a settings file?

in your console you can create a user:

python manage.py createsuperuser

https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-createsuperuser

  • I had to log in to the admin view with the same url: 127.0.0.1:8000/admin/login/?next=/admin/ and the view did not had the basic nice looking Django interface what it normally has in 127.0.0.1:8000/admin/

  • After switching the local bootstrap files

<script src="{% static 'public/js/jquery/jquery.min.js' %}"></script>
<script src="{% static 'public/js/popper/popper.min.js' %}"></script>
<script src="{% static 'public/js/bootstrap/bootstrap.min.js' %}"></script>
  • to URL based files
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
  • You have to do the following in terminal
python3 manage.py collectstatic
python3 manage.py makemigrations
python3 manage.py migrate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM