epicserve / django-base-site

The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages that you need to jumpstart your next project.
MIT License
391 stars 43 forks source link

Development environment is using sqlite instead of the Postgres `db` container #292

Closed codyfletcher closed 1 year ago

codyfletcher commented 1 year ago

When I ran just start I watched the containers come online and assumed my database migrations were running in the db container. My assumption was wrong—that the database used in my local development environment was the postgres/db container—but it took me an embarassingly long time to figure it out. :P

Figured I'd bring it up here before looking into it to see what your thoughts are. I was thinking along the lines of the "Dev/prod parity" from 12 Factor App.

epicserve commented 1 year ago

I'll need more steps to look into this. I'm going to close for now because I can't replicate what you are seeing. If you look at the settings in the Django Debug Toolbar, you should see what I'm seeing. The engine is set as Postgres.

image

If you use the setup script it should create an .env similar to the following.

DEBUG=on
SECRET_KEY='<redacted>'
EMAIL_URL='smtp://<redacted>:<redacted>@smtp.mailtrap.io:587/?ssl=True&_default_from_email=<redacted>'
DATABASE_URL=postgres://postgres:@db:5432/postgres
INTERNAL_IPS=127.0.0.1,0.0.0.0

The Django Base Site is a 12 Factor app and is setup to use environment variables for system settings.

FYI, I'm going on vacation and won't be back for a week.

codyfletcher commented 1 year ago

That makes perfect sense now! I've got a simple idea for a PR coming your way. Feel free to delete it if it doesn't fit with your philosophy/direction; I wont be offended.