This project is a basic clone of Twitter.
Follow the below steps to run the project on your local computer:
- Open Command Prompt/Terminal.
- Check if Python is installed on your system by typing
python --version
orpython3 --version
. - If Python is not installed, download it from here.
- Check if PostgreSQL is installed. If not, download it from here.
- Clone the project repository by typing the following command in the terminal:
git clone git@github.com:GaganDureja/twitter.git
- Navigate to the project directory.
cd twitter
- Create a virtual environment to manage project dependencies Install and Run:
sudo apt install python3-venv
python3 -m venv twitterEnv
- Activate the virtual environment:
source twitterEnv/bin/activate
- Install the project requirements by running:
pip install -r requirements.txt
- Open pgAdmin either in the browser pgAdmin or using the application.
- Register a server with the following details:
- Name: localhost
- Address: 127.0.0.1
- Password: 123
- Username: postgres
- In the server, create a database named
twitter
using the same credentials as mentioned insettings.py
file. - Once the database setup is complete, apply migrations by running:
python3 manage.py migrate
- After all installations are done, start the server by running:
python3 manage.py runserver
- Access the application at localhost.
- To log in as an admin, you need a superuser account. Stop the server by
Ctrl+C
. - Create a superuser by running:
python3 manage.py createsuperuser
- Provide the required information (username, email, password) as prompted.
Username: admin
Email: admin@mail.com
Password: admin@123
Password (again): admin@123
- You can use the above credentials for testing/development purpose but for production I recommend to use strong credentials.
- Once the superuser is created, start the server again by running:
python3 manage.py runserver
- Access the Django admin panel here and log in using the superuser credentials.