Skip to content

Commit

Permalink
refactor: troca database para sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorEsser committed Feb 27, 2023
1 parent 2453375 commit a0479f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
twikker/settings.py
db.sqlite3
media/*
*.pyc
Expand Down
8 changes: 4 additions & 4 deletions apps/feed/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from django.contrib.humanize.templatetags.humanize import naturaltime
from django.conf import settings

# if settings.DEBUG:
from apps.twikkerprofile.fields import MockCloudinaryField as CloudinaryField
# else:
# from cloudinary.models import CloudinaryField
if settings.DEBUG:
from apps.twikkerprofile.fields import MockCloudinaryField as CloudinaryField
else:
from cloudinary.models import CloudinaryField

class Tweek(models.Model):
# A tweek is a post made by a user
Expand Down
14 changes: 6 additions & 8 deletions twikker/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,12 @@
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

# DATABASES = {
# "default": {
# "ENGINE": "django.db.backends.postgresql",
# "NAME": "twiker_admin",
# "PORT": 5432,
# "HOST": "localhost",
# }
# }
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}

# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
Expand Down

0 comments on commit a0479f1

Please sign in to comment.