Resources
Create/activate a virtual environment - Unix-based system
Install Django (the latest stable version)
Create a new Django Project
startproject
subcommand.
at the end of the command.Setup the database
Start the app
Create a new Django app
Visualize the default SQL settings -config/settings.py
Books
in sample
application. The below changes should be added to sample/models.py
:check
subcommand.migrate
the database).__str__()
method for the Book
modeladmin
section out-of-the-box that allows us to manage with ease all models defined in the project. To manage the Book
model in the administration console we need to create a superuser
(aka the admin) and after register
the Book
model to be visible in the admin section.Create the superuser
RegisterBook
model to be visible in theadmin
section - Editsample/admin.py
as below:
Authenticate as admin -http://localhost:8000/admin/
Books
model in the UI and able to execute CRUD operations.