Beginner, Adding a feature in a Django based website

50 views
Skip to first unread message

Sourav Singh

unread,
Mar 11, 2016, 2:08:31 PM3/11/16
to Django users
Hi,

I require some help in the issue given here.We wish to implement a closing account feature in a Django Website.So far, I know that the corresponding database entry for the user must be deleted from the database.But I require some help in making it possible.

Any kind of help would be very much appreciated!

With Regards,
Sourav

René Fleschenberg

unread,
Mar 12, 2016, 10:40:09 AM3/12/16
to django...@googlegroups.com
Hi Sourav,

> I require some help in the issue given here
> <https://github.com/NeuroVault/NeuroVault/issues/420>.We wish to implement
> a closing account feature in a Django Website.So far, I know that the
> corresponding database entry for the user must be deleted from the
> database.But I require some help in making it possible.

Can you tell us what exactly is giving you trouble?

Some general hints:

- To delete an object from the database, you can call something like
``MyModel.objects.get(username=theusername).delete()``

- There also is a generic class-based view (CBV) for deleting objects:
https://docs.djangoproject.com/en/1.9/ref/class-based-views/generic-editing/#deleteview

- Of course, you must protect the feature, such that users cannot delete
other users' accounts.

Have fun!
René

--
René Fleschenberg
Reply all
Reply to author
Forward
0 new messages