Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USER STORY: Create a database #40

Closed
10 tasks done
chris-townsend opened this issue Nov 15, 2022 · 0 comments
Closed
10 tasks done

USER STORY: Create a database #40

chris-townsend opened this issue Nov 15, 2022 · 0 comments
Assignees
Labels
1 User Story Estimate is 1 story point must-have A must-have feature

Comments

@chris-townsend
Copy link
Owner

chris-townsend commented Nov 15, 2022

User Story:

As a developer, I should set up the necessary database items so that the database is viewable through Heroku

Relevant Information:

  • The database provided by Django is only accessible within Gitpod and is not suitable for a production environment. Your deployed project on Heroku will not be able to access it. So, you need to create a new database that can be accessed by Heroku.

  • The code that has been commented out connects your Django application to the created db.sqlite3 database within your repo. However, as we know, that database is not suitable for production. This line of code separates the database URL stored by your env.py file into the relevant name and password

Acceptance Criteria:

  • After creating the database, data will be viewable by clicking on the STATS tab on the left-hand side of the screen.
  • The database statistics will show the number of rows in a table.

Related User Stories:

Tasks:

  • Log in to ElephantSQL.com to access your dashboard

  • Click 'Create New Instance'

  • Set up your plan

    • Give your plan a Name (this is commonly the name of the project)
    • Select the Tiny Turtle (Free) plan
    • You can leave the Tags field blank
  • Select 'Select Region'

  • Select a data center near you and click 'Review'

  • Create an instance

  • Return to the ElephantSQL dashboard and click on the database instance name for this project

  • In the URL section, click the copy icon to copy the database URL

  • Comment out the original DATABASES variable and add DATABASES = { 'default': dj_database_url.parse(os.environ.get("DATABASE_URL")) }

  • Migrate your database structure to the newly-connected ElephantSQL database

    • python manage.py migrate

@chris-townsend chris-townsend added must-have A must-have feature 1 User Story Estimate is 1 story point labels Nov 15, 2022
@chris-townsend chris-townsend self-assigned this Nov 15, 2022
Repository owner moved this from In Progress to Done in Kitchen Tales Kanban board Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 User Story Estimate is 1 story point must-have A must-have feature
Projects
Development

No branches or pull requests

1 participant