1

I'm not having any luck elsewhere so I appreciate any help/suggestions I get here. Here's a rundown of what I'd like to do:

  • Local development environment of Mezzanine, which would also integrate Bootstrap for front-end, static/media served by S3.
  • Push to GitHub with unique config files (settings.py, API keys, S3 settings, etc) in .gitignore.
  • Pull to remote production server for publishing on web.

I want to use GitHub as a way to track and display what I'm doing with my website. The problem I'm running into is how to efficiently manage the files in .gitignore to make sure the necessary configs are present on the production server. What would be a "best practice" for this scenario?

The local development environment would be used for working on front-end more than back-end but should I have an identical setup locally to match production server setup? For example, serving production static/media with S3, changing db to PostgreSQL for production, etc...should I mirror these on production server manually?

One guide I've been reading is https://tutorial.djangogirls.org/en/ but they don't really mention how to manage major back-end differences that aren't pushed to the repo.

Thanks!

EDIT: Found this How to manage local vs production settings in Django? but it's pretty old. Relevant?

emTr0
  • 77
  • 7

2 Answers2

0

I would try to use and dig deeper in the docs of django-environ Also study how pydanny does it in this starter template, you will master the art of deploying with s3 https://github.com/pydanny/cookiecutter-django

willyhakim
  • 327
  • 4
  • 11
0

After doing a bunch of searching and chatting on IRC (#django on freenode), I found the following links which answered my question:

As for keeping sensitive config and site-specific settings info out of GitHub, I'm going to follow 12factor and make dev/prod environments as identical as possible but keep the prod config settings on prod server since the local dev environment won't be dependent on them. I'll also be using the envs no prod server so I don't have to change code being pushed to GitHub.

Community
  • 1
  • 1
emTr0
  • 77
  • 7