Search code examples
gitgithubversion-controlworkflowgitignore

How Do I Setup a Git Workflow for a Django Wagtail application?


I'm currently the only person working on this project. I am using git and GitHub to pass the project between two computers has I move around. Both are set up identically to run the project in development.

I am now wanting to push the project to a server. I am not asking about setting up the server or altering the wagtail project for production.

What I would like to know how to do is to continue being able to pass my project between my computers to work on, but I would also like to be able to push to the live server.

I understand using the .gitignore file to ignore files you don't want to replace so that you can keep your server settings and what not. That'd be fine if I was using one computer with a server. But what if I want to continue passing the project between by dev computers and the server? It seams like I would need a second .gitignore file to use when sending to the server. I want to share my sqlite.db between my computers, for instance, but I don't want to send it to the server.

I am caught up on using the master branch for production and an alt branch for dev. I'm just confused on how to separate files between them.


Solution

  • have you considered building two separate django setting files ? One for dev environnement and one for production. By gitignoring them, you can setup a database in prod different than the dev one.

    https://www.coderedcorp.com/blog/django-settings-for-multiple-environments/

    Maybe you can gitignore ".gitignore" file itself and setup one for dev and one for prod which will avoid pulling .sqlite file for instance.

    Good luck