| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Setup the DB Database:
CREATE DATABASE carsdb;
CREATE USER carsadmin WITH ENCRYPTED PASSWORD 'carspass';
GRANT ALL PRIVILEGES ON DATABASE carsdb TO carsadmin;Clone Git-Repo into Local Directory.
Update DB credentials in settings.py file in .\myproject\ folder to as per your own configuration.
Open Command Line in main directory of project.
Run below command inside project directory to setup environment
python -m venv venvActivate enviroment with below command (for Windows):
venv\Scripts\activateRun below command next to install required modules plus dependencies defined in requirements.txt
pip install -r requirements.txtMigrate default/admin tables:
python manage.py makemigrations
python manage.py migrateCreate a super user(admin) for your project:
python manage.py createsuperuserNote: This user is used to manage administration for your project via the admins console: /admin.
Migrate cars tables - cars_car and cars_driver tables:
python manage.py makemigrations cars
python manage.py migrate carsInsert some data into the newly created cars_car and cars_driver tables.
Note: You can use sample insert queries provided in below files:
cars_car.txt
cars_driver.txt
Run the project:
python manage.py runserver 0.0.0.0:5000All Done!! Click Here to interact with your app:
Assumptions: Python and Postgres has been setup and running prior to starting with this project.
References: For Complete details, please refer How to use PostgreSQL with Django - the source article for this Repo.
| Back | FazBrowse Home | New Git URL |