File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -eux
3
+
4
+ # remove database file
5
+
6
+ # construct the path to the database file from environment or default
7
+ DB_DIR=" ${DJANGO_DB_DIR:- .} "
8
+ DB_FILE=" ${DB_DIR} /django.db"
9
+
10
+ # -f forces the delete (and avoids an error when the file doesn't exist)
11
+ rm -f " ${DB_FILE} "
12
+
13
+ # run database migrations
14
+
15
+ python manage.py migrate
16
+
17
+ # create a superuser account for backend admin access
18
+ # (set username, email, and password using environment variables
19
+ # DJANGO_SUPERUSER_USERNAME, DJANGO_SUPERUSER_EMAIL, and DJANGO_SUPERUSER_PASSWORD)
20
+
21
+ python manage.py createsuperuser --no-input
Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ By default the application sends logs to `stdout`.
126
126
127
127
Django's primary secret, keep this safe!
128
128
129
+ ### ` DJANGO_SUPERUSER_EMAIL `
130
+
131
+ The email address of the Django Admin superuser created when resetting the database.
132
+
133
+ ### ` DJANGO_SUPERUSER_PASSWORD `
134
+
135
+ The password of the Django Admin superuser created when resetting the database.
136
+
137
+ ### ` DJANGO_SUPERUSER_USERNAME `
138
+
139
+ The username of the Django Admin superuser created when resetting the database.
140
+
129
141
### ` DJANGO_TRUSTED_ORIGINS `
130
142
131
143
!!! warning "Deployment configuration"
You can’t perform that action at this time.
0 commit comments