Add management commands
This MR adds the following management commands:
-
createsuperuser_with_password: Gives the option to create superuser with password from the CLI -
set_secret_key: sets theSECRET_KEY. It copies the existing functionality ofpatchman-manage -
set_rdns_check: It sets rDNS check for hosts
Hi @furlongm, I am revisiting this PR since you appear to be active in Patchman again. Should I rebase to current develop and work on merging this PR? Do you find it a good idea?
A rebase on develop would make it clearer what's in the PR.
For the commands, I'm not sure if they are better as part of the patchman cli or in a set of separate commands? I think the rdns option is already set there?
For setting the secret key, it's useful to be able to do that without the app being fully functional (like when installing from deb or rpm).
The createsuper command might also be useful there though.
So not sure where they should go really, or what is best practice in this case?
@furlongm I proceeded with the rebase.
The main reason behind these commands, is the Helm Chart I have already developed. Inside that Helm Chart, there are some Jobs which are using the Patchman Docker image to prepare Patchman deployment. For example, setting the secret key, applying migrations, creating superuser with password (this is needed as long as Patchman stays in Django < 3.0. They added it to Django > 3.0 https://docs.djangoproject.com/en/3.0/ref/django-admin/#createsuperuser)
@furlongm Hi Marcus. Did you have the chance to take a look here? This acts as a kind reminder.
@skatsaounis apologies for the delay in replying! I released v2 with a lot of the django updates in it. Could you rebase this PR onto master?
@furlongm feel free to take a look again