Adding new app to existing project with several apps using custom user

Hello all,

I’ve deployed my first project that uses 6 apps 1 database created using custom user as app called ‘accounts’

I now want to create a new app that will require and use same custom user model but I need to test the new app in a development environment. I just want to check my build logic to ensure custom user is correctly incorporated to avoid issue when I move the new app into development.

  • I replicate db onto development server
  • create new project in django and create app called accounts and copy existing accounts app code into it
  • add the new app to the project, create some code, admin, logic,
  • do makemigrations, migrate which adds new table to replica only
  • complete coding, testing
  • copy the new app into production project, add the app to settings
  • makemigrate, migrate for the new app (create new empyt db tables)

Does this sound OK or did I miss something?

Thanks, AB

This sounds like it would work - but it’s not how I would do it.

How I would do this:

  • Replicate the database
  • Create a new fork of my project in my git repo
  • Code, test, etc
  • Check my modified code back into the repo
  • Merge my updates to main
  • Stop the existing server
  • Deploy new code
  • Run migrate, collectstatic as necessary
    • There shouldn’t be a need to run makemigrations again.
  • Restart the server

Note: If you’re not using some type of version control system, you should be - even on a 1-person project. It’s incredibly helpful in situations like this.

Thanks Ken, I’m still learning the git process, so I’ll come back to that later.

I was more concerned about the django process and specifically the custom user part, if i understand your response I’m on the right track.

Your use of a custom User object does not materially affect any other code you write. It shouldn’t affect your development process.