PyCharm and django admin

I am trying to start the Django admin page in PyCharm.

I created a test project with an empty test application and a simple model.

class User(models.Model):
    name = models.CharField(max_length=15)
    email = models.EmailField()

When I open 127.0.0.1:8000/admin/, I can see the admin page. However, not only do I not know where the password is located (I do not remember to set the password so far), but an attempt to log in will cause the server to crash with this error:

OperationalError at / admin /

no such table: auth_user

Exception Location: / Library / Python / 2.7 / site-packages / django / db / backends / sqlite3 / base.py at run line 451

Why? And how can I set a password?

+4
source share
1 answer

cd ./manage.py syncdb. .

auth_user, admin . , .

: , Django 1.7+, ./manage.py migrate. , . , ./manage.py createsuperuser.

+10

Source: https://habr.com/ru/post/1540409/


All Articles