openchatai / OpenChat

LLMs custom-chatbots console ⚡
https://open.cx
MIT License
5.2k stars 639 forks source link

Adding a custom command to create default super user + More enhancements #180

Closed codebanesr closed 1 year ago

codebanesr commented 1 year ago

Summary: This pull request (PR) introduces a new feature that allows for the creation of a default superuser during application initialization through a data migration. The primary goal is to simplify the setup process for developers by providing an easy way to add an initial superuser account without the need for a custom management command.

Key Changes:

  1. A new data migration is added to the app's migrations directory.
  2. The data migration contains a function that creates a superuser with predefined credentials (e.g., username 'admin', email 'admin@example.com', password 'password').
  3. The migration is designed to execute automatically during the application's database setup process, ensuring that the default user is created as part of the initial database schema.