DMASCoreDeclan / PRD-PP4-Blog

Blogstar for PP4
0 stars 1 forks source link

Developer User Story: Install Elephant SQL #2

Closed DMASCoreDeclan closed 9 months ago

DMASCoreDeclan commented 9 months ago

As a Developer I can securely connect to a DB so that I can store dynamic data

CI Steps

Acceptance criteria 1 ElephantSQL can display the VIEWS I create in Django

DMASCoreDeclan commented 9 months ago

image

image

ElephantSQL before migration: image

12/1/2024 14:04, I had to go to a previous version of DJANGO as Postgress 12 was not available on ElephantSQL, I did this with the help of Sean from Tutor Assistance: "PP4, cant't get Postgress >= 12 after 20+ attempts"

Commit

ElephantSQL after migration: image

DMASCoreDeclan commented 9 months ago

The Postgressql Issue on ElephantSQL has been circumvented by an inter fix with CI. CI no have their own Postgresql 12 version using: PostgreSQL from Code Institute

Migrate DB from ElephantSQL to CI facility

DMASCoreDeclan commented 9 months ago

Created new DB using PostgreSQL from Code Institute

Changed env.py from "os.environ["DATABASE_URL"] = 'postgres://ojzg . . . ." to "os.environ["DATABASE_URL"] = 'postgres://ugefic . . . . "

On Heroku, changed DATABASE_URL to the new setting.

added blog/fixtures/posts.json and loaded CI data using: python3 manage.py loaddata posts image

All the posts were loaded, but as expected, this new DB has no other Users and no Comments, so the site works but all the Comment and Users in the previous DB are gone. image image