[Python] Show All Data Using python manage.py shell

Discussão em 'Python' iniciado por Stack, Agosto 4, 2025.

  1. Stack

    Stack Membro Participativo

    I have tried to migrate my database but am still having issues. I wanted to try and look at all my sites databases via Command Prompt. I want to try and see which columns do or don't exist in models.

    I did python manage.py shell but then could not work out the queries that would allow me to see all the information in both my sites databases.

    [​IMG]

    (project2_env) C:\Users\HP\django_project3>python manage.py shell
    (InteractiveConsole)
    >>> from blog.models import Post
    >>> from django.contrib.auth.models import User
    >>> User.objects.all()
    <QuerySet [<User: RossSymonds>, <User: RossTheExplorer>, <User: RossSymondsFacebook>, <User: testuser>]>
    >>> objects.all()

    Continue reading...

Compartilhe esta Página