Live vs development Django project versions on Pythonanywhere


I was wondering what the best workflow is on Pythonanywhere for having actualy two versions of a project. One is the development version, which should be only available for the devs and one, which is actually live.

Of course only the live version should be available to the public via its own domain.

You could have a common git repo where you have a dev branch and a live branch. Do all of your work on the dev branch and have that checked out in the development web app. When you're ready to publish, merge onto the live branch and pull in the live web app.

The suggestion to keep a branch that reflects the live site is a good one. One additional thing I do is seperate out the live and dev settings into different files then conditionally import those into the file depending on which site you I'm working on.

So for example you have:
from .local_settings import * #import the settings specific to the environment (dev or live)
#other common settings go in here...
from .dev_settings import *

This way you can keep and in version control by keeping local_settings out of version control.

Thanks a lot for your feedback.