How to create user from Django shell Last Updated : 14 Sep, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report Let's look at how to create a user for Django using Django's interactive shell? Make sure you have the virtual environment activated, and you are within the folder that has the manage.py file. Note: Refer to the article How to Create a Basic Project using MVT in Django? to understand how to create a project in Django. Let's launch Django's interactive shell using the below command python manage.py shell You will get a similar output as mentioned below Now enter the following code in the shell to create a user for Django. Python3 from django.contrib.auth.models import User user = User.objects.create_user('sonu','[email protected]','sn@pswrd') user.save() Let's check our new user using superuser credentials. You can follow How to create superuser in Django? to create a superuser. Let's start the server and log in using the admin URL (make sure path('admin/', admin.site.urls), is mentioned in the URL patterns). http://127.0.0.1:8000/admin/ Sharing the screenshot below You can check the newly added user details under the Users section. Comment More infoAdvertise with us Next Article How to create user from Django shell S sonugeorge Follow Improve Article Tags : Python Python Django Django-basics Practice Tags : python Similar Reads How to create a form using Django Forms ? This article explains how to create a basic form using various form fields and attributes. Creating a form in Django is very similar to creating a model, you define the fields you want and specify their types. For example, a registration form might need fields like First Name (CharField), Roll Numbe 2 min read How to create superuser in Django? Django comes with a built-in admin panel that allows developers to manage the database, users and other models efficiently. This eliminates the need for creating a separate admin interface from scratch. To access and manage the Django Admin panel, we need to create a superuser i.e. a user with full 2 min read How to create a Django project? Dive into the world of web development with Python by exploring the versatile Django framework. Django is a go-to for many developers due to its popularity, open-source license, and robust security features. It enables fast and efficient project development. In this tutorial, we will guide you throu 5 min read How to use PostgreSQL Database in Django? This article revolves around how can you change your default Django SQLite-server to PostgreSQL. PostgreSQL and SQLite are the most widely used RDBMS relational database management systems. They are both open-source and free. There are some major differences that you should be consider when you are 2 min read How to Create a basic API using Django Rest Framework ? Django REST Framework (DRF) is a powerful extension of Django that helps you build APIs quickly and easily. It simplifies exposing your Django models as RESTfulAPIs, which can be consumed by frontend apps, mobile clients or other services.Before creating an API, there are three main steps to underst 4 min read Like