@@ -116,4 +116,7 @@ GitHub.sublime-settings
.history
# exclude media folder
-media
+media
+
+# credentials
+credentials.json
@@ -21,4 +21,7 @@ RUN echo $WEBEXPE_PREFIX_URL
RUN WEBEXPE_PREFIX_URL=$WEBEXPE_PREFIX_URL
RUN WEB_API_PREFIX_URL=$WEB_API_PREFIX_URL
+# create super user admin automatically
+RUN bash create_admin.sh
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
@@ -22,6 +22,11 @@ Initialize the database with the following command :
python manage.py migrate
```
+Add your own super user admin credentials:
+```
+cp credentials.example.json credentials.json
#### Run server
Run the server :
@@ -38,6 +43,11 @@ python manage.py runserver 8080
### 2. Using docker (recommended)
+First, you need to add your own user admin credentials if you wished:
You can use make commands:
@@ -27,7 +27,6 @@ DEBUG = True
ALLOWED_HOSTS = ["diran.univ-littoral.fr", "localhost", "127.0.0.1"]
-
# Application definition
INSTALLED_APPS = [
@@ -0,0 +1,6 @@
+#! /bin/bash
+username=$(cat credentials.json | python -c "import sys, json; print(json.load(sys.stdin)['username'])")
+password=$(cat credentials.json | python -c "import sys, json; print(json.load(sys.stdin)['password'])")
+email=$(cat credentials.json | python -c "import sys, json; print(json.load(sys.stdin)['email'])")
+echo "from django.contrib.auth.models import User; User.objects.create_superuser('${username}', '${email}', '${password}')" | python manage.py shell
@@ -0,0 +1,5 @@
+{
+ "username":"username",
+ "email":"",
+ "password":"pass"
+}