Posts

Showing posts from January, 2025

Setting Up PostgreSQL Database for a Django Project

Setting Up PostgreSQL Database for Django Project on Ubuntu  Follow these steps to configure a PostgreSQL database for your Django project on an Ubuntu server. This guide ensures that the database setup aligns with Blocksport.com’s project standards. 1. Access PostgreSQL Open a terminal on your Ubuntu server and enter the PostgreSQL shell: sudo -u postgres psql You may be prompted to provide the system's admin password. 2. List Existing Databases To verify existing databases, use: \l Press q to exit the list and return to the PostgreSQL shell. 3. Create a New Database Create a dedicated database for the Django project: CREATE DATABASE blocksport_tenant; 4. Create a Database User Define a new user for database access and assign a secure password: CREATE USER blocksport_tenant WITH PASSWORD 'blocksport_password'; Replace 'blocksport_password' with a strong password for security. 5. Connect to the Database Switch to the newly created database: \c blocksport_tenant Th...