Skip to content

Commit 18697ff

Browse files
committed
Add automatic useradmin creation
1 parent 36f2dcd commit 18697ff

1 file changed

Lines changed: 22 additions & 26 deletions

File tree

readme.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ You can use Docker Image
2727
The current version of the project is 1.2, which is considered the most stable and reliable release available. This version has undergone extensive testing and debugging to ensure a high level of stability and performance.
2828

2929
```
30-
sudo docker pull xandouglas/switchsetup:v1.2
31-
sudo docker run -p 8000:8000 --name switchsetup -d xandouglas/switchsetup:v1.2
30+
docker pull xandouglas/switchsetup:v1.2
31+
docker run -p 8000:8000 --name switchsetup -d xandouglas/switchsetup:v1.2
3232
```
3333

3434
After creating the image, use for login:
@@ -45,21 +45,7 @@ To set up the project locally, please follow these steps:
4545
2. Install the for ansible and Django in requirements.txt .
4646
3. You need generate your own [Secret Key](#SecretKey).
4747
4. [Configure your .env](#configure-.env)
48-
5. You can run it in your terminal or dockerfile
49-
50-
### Terminal: **(Before starting run [Configure your .env](#configure-env))**
51-
52-
```
53-
cd WebApi
54-
python manage.py runserver
55-
```
56-
57-
### Dockerfile: **(Before starting run [Configure your .env](#configure-env))**
58-
59-
```
60-
docker build -t image_name
61-
docker run -p 8000:8000 image_name
62-
```
48+
5. You can run it in [your terminal or dockerfile](#run-switchsetup)
6349

6450

6551
## SecretKey
@@ -68,7 +54,7 @@ Start the **Python interpreter**
6854
```
6955
import secrets
7056
secrets.token_hex(32)
71-
Copy the key
57+
Copy the key in .env
7258
```
7359
Be mindful that you can generate a new key whenever necessary.
7460
However, it is crucial to remember that if you are using our project, you should not disclose the key to anyone.
@@ -77,11 +63,26 @@ However, it is crucial to remember that if you are using our project, you should
7763

7864
Create an .env file in the /core directory:
7965
```
80-
SECRET_KEY=YOU SECRET KEY
66+
SECRET_KEY=SECRET KEY
8167
DEBUG=True
8268
```
8369
**Use DEBUG=TRUE only when in development.**
8470

71+
## Run SwitchSetup
72+
73+
#### Terminal Local:
74+
75+
```
76+
cd WebApi
77+
python manage.py runserver
78+
```
79+
80+
#### Dockerfile:
81+
82+
```
83+
docker build -t image_name
84+
docker run -p 8000:8000 image_name
85+
```
8586
## Database
8687

8788
We use SQLite at first, but it is possible to manage other databases.
@@ -90,19 +91,14 @@ Use [Django's](https://docs.djangoproject.com/en/4.2/ref/databases/) own referen
9091

9192
If you lose the database file or decide to switch to a different one, you will need to follow these steps:
9293

93-
1. Generate a new migration ( **Inside the WebApi file** )
94+
1. Migration ( **Inside the WebApi file** )
9495

9596

9697
```
97-
python manage.py makemigrations
9898
python manage.py migrate
9999
```
100100

101-
2. Create a new user ( **Inside the WebApi file** )
102-
103-
```
104-
python manage.py createsuperuser
105-
```
101+
After this, a new admin user with the username "admin" and password "123" is automatically created.
106102

107103
## Version
108104

0 commit comments

Comments
 (0)