You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+22-26Lines changed: 22 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,8 +27,8 @@ You can use Docker Image
27
27
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.
28
28
29
29
```
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
32
32
```
33
33
34
34
After creating the image, use for login:
@@ -45,21 +45,7 @@ To set up the project locally, please follow these steps:
45
45
2. Install the for ansible and Django in requirements.txt .
46
46
3. You need generate your own [Secret Key](#SecretKey).
47
47
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)
63
49
64
50
65
51
## SecretKey
@@ -68,7 +54,7 @@ Start the **Python interpreter**
68
54
```
69
55
import secrets
70
56
secrets.token_hex(32)
71
-
Copy the key
57
+
Copy the key in .env
72
58
```
73
59
Be mindful that you can generate a new key whenever necessary.
74
60
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
77
63
78
64
Create an .env file in the /core directory:
79
65
```
80
-
SECRET_KEY=YOU SECRET KEY
66
+
SECRET_KEY=SECRET KEY
81
67
DEBUG=True
82
68
```
83
69
**Use DEBUG=TRUE only when in development.**
84
70
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
+
```
85
86
## Database
86
87
87
88
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
90
91
91
92
If you lose the database file or decide to switch to a different one, you will need to follow these steps:
92
93
93
-
1.Generate a new migration ( **Inside the WebApi file** )
94
+
1.Migration ( **Inside the WebApi file** )
94
95
95
96
96
97
```
97
-
python manage.py makemigrations
98
98
python manage.py migrate
99
99
```
100
100
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.
0 commit comments