In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the example analysis of user accounts and profile portraits in Django, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.
Today, let's start with the display of user account information and personal avatars in the blog project: first, create a new folder media under django_project to store avatar files, and store avatars uploaded by users in the new profile_pics folder under media:
Modify django_project/users/models.py to add model class personal information:
Under the django_project folder command line, execute python manage.py makemigrations to create the migration, and perform the migration python manage.py migrate:
Modify the django_project/users/admin.py and register for Profile:
Run project access login http://127.0.0.1:8000/admin:
Click Profile to add an avatar for the user's yale:
The avatar will be uploaded to the django_project/media/profile_pics folder.
Use yale to log in to the system to view personal information:
Modify django_project/django_project/urls.py to add avatar access path rules:
Add signals.py under django_project\ user, and specify upload avatar when you register:
Modify django_project\ user\ apps.py to introduce signals.py:
Run the project, register a user tbag, log in and access your personal information:
This is the end of the sample analysis of user accounts and profile portraits in Django. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.