Here I have created the DataBase part of the Project which is responsible to store Customer data as well as the website content.
To getting started with DataBase design I want to introduce the "PostgreSQL: the most advanced Open source Relational Database". which I have used as a DataBase for this Project. If you are new to this DataBase System you can refer to this link of the there official website (https://www.postgresql.org/about/). To start with the database system you need to download some important software PostgreSQL(https://www.postgresql.org/download/) itself and the pgAdmin which is the administration and development platform for PostgreSQL (https://www.pgadmin.org/download/).
- How to create a DataBase schema?
for this, we need to create a model for a specific table in Python language. After creating that model we need to migrate that model into the DataBase. I am showing the example of my project Table: You need to create models.py
NAME = models.CharField(max_length=100)
IMG = models.ImageField(upload_to= 'pics')
UPDATED_DATE = models.DateField()
START_DATE = models.DateField()
END_DATE = models.DateField()
AREA_CODE = models.IntegerField()
DESC = models.TextField()
PRICE = models.IntegerField()
STATUS = models.BooleanField(default=False)
AGR_AUTO_UPDATE = models.BooleanField(default=False)
then you can migrate this model into DB using this command :
python manage.py make migrations
before that you need to create the migration file :
create migration python manage.py sqlmigrate advertisement "migration file_name"
python manage.py migrate
Demo: For my project website I have created the several schemas which are responsible for the particular section of the website. They are divided into groups
1)
advertisement_agreement_details
advertisement_customer_details
advertisement_site
advertisement_site_details
advertisement_user_authentication
2)
auth_group
auth_group_permissions
auth_permission
auth_user
auth_user_groups
auth_user_user_permissions
3)
django_admin_log
django_content_type
django_migrations
django_session
Here I have attached the picture and video of created DataBase Tables and Schemas:
