DJANGO: ddtcms thoughts on website users and real people

Source: Internet
Author: User

It was written in and has never been shared.

What are the differences and connections between network users and real users?

1. users on the website are real users.
A person must sit in front of a computer and use his/her account (network user) for operations,
Virtual users are operated by real users (except for programs created by machines that replace virtual Users)

2. An ID is unique and the user name is unique. If you use it, you cannot use it.
The name of a real person can be repeated. A real person can have multiple IDs (multiple websites and multiple IDs of one website)
One ID must correspond to one person, only one, and multiple IDs may correspond to only the same person.
True: The network user is a shell, a vest, a role, and a real person.
Create a user, user name and password, and store the database
For websites, personal user accounts are real and real people are virtual. The website is people-oriented. It should be user-oriented and the real website behind the user account.

Website users:
User Name
Password
Virtual gender (it can make real people feel the opposite sex)
Virtual avatar (let yourself have a look)
Account creation date (website virtual birthday)
Short Message

Real person:
Public information (used by everyone): name, gender, photo
Private Information (Privacy): Birthday (AGE), address (mailbox, home address, office, etc.), height, weight, personal habits

Two systems should be used for website management to combine them with loose connections. Real-Name authentication and mobile phone binding methods can be considered to determine the real-person identity.

The website's time records are mainly for users. Users are advised not to delete them because many users have produced information on the website (whether it is useful information or junk information) and other records are associated with users. If a user is deleted, the Association is damaged, and the information is incomplete.
If the database is designed to cascade and delete data, the user will be deleted, and the records of many other modules will be deleted accordingly, which is worth the candle.

How to deal with the sales of website users
What measures should be taken?
Set the user status. After the account is canceled, the user's valid status is set to invalid, but the record is still saved.
In Django, the user name is unique. In this way, after a user is canceled (the user is set to invalid), the same user name cannot be registered again. After the account is canceled, you can add a suffix after the user name, similar to "_ del20090320153204ete". In this way, the 20090320153204 In The Middle Of The delete is the delete (set to invalid) timestamp. If you want to restore the user, delete the suffix. In this case, the user name must not contain two consecutive underlines "_" and "Del. In this way, the user name must have at least 16 + characters in length.
In the future, after the user closes the account, the relevant records in other modules (instead of the user name, but the user ID) can be used to determine the user suffix.

For a real person, the way to manage his/her information is to set his/her real person information to belong to the Website user. In Django
Zhenren = models. foriegnkey (User) method, but it can be null in the database or empty in the form. Because not everyone on your website is accessing the internet and becoming your user. For example, Liu Dehua and Zhang Xueyou cannot be users on your website. However, the character column does not necessarily require them to register as users on the website. But once they register on the website, we can help him associate his personal data with the user he registered on the website.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.