mirror of
https://github.com/YunoHost-Apps/django_example_ynh.git
synced 2024-09-03 18:26:21 +02:00
fix superuser setup
This commit is contained in:
parent
9f0c74664d
commit
3d8b18788e
3 changed files with 7 additions and 13 deletions
|
@ -105,14 +105,7 @@ def create_local_test(django_settings_path, destination, runserver=False):
|
|||
if runserver:
|
||||
call_manage_py(final_home_path, 'migrate --no-input')
|
||||
call_manage_py(final_home_path, 'collectstatic --no-input')
|
||||
|
||||
verbose_check_call(
|
||||
command=(
|
||||
f'{sys.executable} -m django_ynh.create_superuser'
|
||||
f' --ds="{django_settings_name}" --username="test" --password="test123"'
|
||||
),
|
||||
cwd=final_home_path,
|
||||
)
|
||||
call_manage_py(final_home_path, 'create_superuser --username="test"')
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = django_settings_name
|
||||
|
||||
|
|
|
@ -159,9 +159,9 @@ touch "$final_path/local_settings.py"
|
|||
cp "../conf/urls.py" "$final_path/urls.py"
|
||||
|
||||
#=================================================
|
||||
# MIGRATE / COLLECTSTATIC / CREATEADMIN
|
||||
# MIGRATE / COLLECTSTATIC / CREATE SUPERUSER
|
||||
#=================================================
|
||||
ynh_script_progression --message="migrate/collectstatic/createadmin..." --weight=10
|
||||
ynh_script_progression --message="migrate/collectstatic/create superuser..." --weight=10
|
||||
|
||||
(
|
||||
set +o nounset
|
||||
|
@ -175,7 +175,8 @@ ynh_script_progression --message="migrate/collectstatic/createadmin..." --weight
|
|||
./manage.py migrate --no-input
|
||||
./manage.py collectstatic --no-input
|
||||
|
||||
python -m django_ynh.create_superuser --ds="django_ynh_demo_settings" --username="$admin" --email="$admin_mail" --password="$app"
|
||||
# Create/update Django superuser (set unusable password, because auth done via SSOwat):
|
||||
./manage.py create_superuser --username="$admin" --email="$admin_mail"
|
||||
|
||||
# Check the configuration
|
||||
# This may fail in some cases with errors, etc., but the app works and the user can fix issues later.
|
||||
|
|
|
@ -147,9 +147,9 @@ touch "$final_path/local_settings.py"
|
|||
cp "../conf/urls.py" "$final_path/urls.py"
|
||||
|
||||
#=================================================
|
||||
# MIGRATE django_ynh
|
||||
# MIGRATE / COLLECTSTATIC / CREATE SUPERUSER
|
||||
#=================================================
|
||||
ynh_script_progression --message="migrate/collectstatic/createadmin..." --weight=10
|
||||
ynh_script_progression --message="migrate/collectstatic/create superuser..." --weight=10
|
||||
|
||||
(
|
||||
set +o nounset
|
||||
|
|
Loading…
Add table
Reference in a new issue