Note: I'm currently taking a break from this course to focus on my studies so I can finally graduate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db import models | |
| from django.contrib.auth.models import User | |
| from django.utils import timezone | |
| # Create your models here. | |
| class Restaurant(models.Model): | |
| user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='restaurant') | |
| name = models.CharField(max_length=500) | |
| phone = models.CharField(max_length=500) | |
| address = models.CharField(max_length=500) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // digital ocean creds | |
| // db, err := sql.Open("mysql", "root:@/theory_mysql") | |
| databaseURL := os.Getenv("DATABASE_URL") | |
| fmt.Println(databaseURL) | |
| db, err := sql.Open("mysql", databaseURL) | |
| fmt.Println(databaseURL) | |
| if err != nil { | |
| fmt.Println("error opening theory database") |