Archives

Meta

Django CRUD (Create, Retrieve, Update, Delete)

UPDATE 1: The main example use Class Based Views, I also added Function Based Views version of the same functionality.

UPDATE 2: I added a new example application with user access, user must login and each user has his own list.Sample Code: You can download a sample application from https://github.com/rayed/django_crud

Function Based View Version

The example above uses Class Based Views (or CBV for short) to implement the views, what I will cover now is how to implement the same functionality but with Function Based Views i.e. using functions instead of classes, we will be using the same templates:

What is the project name at this case…?
Is project name = ‘Server’ ?
And
At step of defining URL, in my app folder does’nt contain urls.py. Is that mean I must creating this file before…?
Great tutorial. Thanks.

I have a doubt. Where is the exact path for the following:
“templates/servers/server_form.html”

Is it under django_proj_name (the directory which contains the file manage.py)
or is it under the app “servers” (the directory which contains the file models.py)
or are you referring to some other place.

Love your post and project, I wonder if you have a similar minimalistic app for users/groups/admin (without the django admin).

So if I want to have a managing dashboard for a CRUD app to handle users, products/servers/items, and other things such as logging info.
– admin: handle users and their products
– users: handle their products
– visitor: handle their selections