SushantGautam commited on
Commit
284f0f1
·
1 Parent(s): 9edfa52

Update database connection options and improve home page structure

Browse files
BridgeMentor/settings.py CHANGED
@@ -104,10 +104,10 @@ DATABASES = {
104
  'PASSWORD': os.environ['DB_PASSWORD'],
105
  'HOST': os.environ['DB_HOST'],
106
  'PORT': os.environ['DB_PORT'],
107
- # 'OPTIONS': {
108
- # 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
109
- # 'connect_timeout': 10,
110
- # },
111
  },
112
  }
113
 
 
104
  'PASSWORD': os.environ['DB_PASSWORD'],
105
  'HOST': os.environ['DB_HOST'],
106
  'PORT': os.environ['DB_PORT'],
107
+ 'OPTIONS': {
108
+ 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
109
+ 'connect_timeout': 20,
110
+ },
111
  },
112
  }
113
 
core/templates/home.html CHANGED
@@ -1,48 +1,50 @@
1
  <!-- home/templates/home/home.html -->
2
  <!DOCTYPE html>
3
  <html>
4
- <head>
5
- <title>My Home Page</title>
6
- </head>
7
-
8
- <body>
9
- {% if user.is_authenticated %}
10
- <span>Welcome, {{ user.first_name }}!</span> <a href="{% url 'logout' %}">Logout</a>
11
- {% else %}
12
- <a href="{% url 'social:begin' 'google-oauth2' %}">Login With Google</a>
13
- {% endif %}
14
-
15
- <h2>Search Domains</h2>
16
- <input type="text" id="search-input" placeholder="Type something..." autocomplete="off" />
17
- <ul id="results-list"></ul>
18
-
19
- <script>
20
- const input = document.getElementById('search-input')
21
- const resultsList = document.getElementById('results-list')
22
-
23
- input.addEventListener('input', async () => {
24
- const query = input.value.trim()
25
- if (!query) {
26
- resultsList.innerHTML = ''
27
- return
28
- }
29
-
30
- const res = await fetch(`/api/search/?q=${encodeURIComponent(query)}`)
31
- const data = await res.json()
32
-
33
  resultsList.innerHTML = ''
34
- data.results.forEach((item) => {
35
- const li = document.createElement('li')
36
-
37
- const link = document.createElement('a')
38
- link.href = `/${item.type.toLowerCase()}/${item.id}/`
39
- link.textContent = item.text
40
- link.style.textDecoration = 'none'
41
- link.style.color = 'black'
42
- li.appendChild(link)
43
- resultsList.appendChild(li)
44
- })
 
 
 
 
 
 
45
  })
46
- </script>
47
- </body>
48
- </html>
 
 
 
1
  <!-- home/templates/home/home.html -->
2
  <!DOCTYPE html>
3
  <html>
4
+
5
+ <head>
6
+ <title>BridgeMentor</title>
7
+ </head>
8
+
9
+ <body>
10
+ {% if user.is_authenticated %}
11
+ <span>Welcome, {{ user.first_name }}!</span> <a href="{% url 'logout' %}">Logout</a>
12
+ {% else %}
13
+ <a href="{% url 'social:begin' 'google-oauth2' %}">Login With Google</a>
14
+ {% endif %}
15
+
16
+ <h2>Search Domains</h2>
17
+ <input type="text" id="search-input" placeholder="Type something..." autocomplete="off" />
18
+ <ul id="results-list"></ul>
19
+
20
+ <script>
21
+ const input = document.getElementById('search-input')
22
+ const resultsList = document.getElementById('results-list')
23
+
24
+ input.addEventListener('input', async () => {
25
+ const query = input.value.trim()
26
+ if (!query) {
 
 
 
 
 
 
27
  resultsList.innerHTML = ''
28
+ return
29
+ }
30
+
31
+ const res = await fetch(`/api/search/?q=${encodeURIComponent(query)}`)
32
+ const data = await res.json()
33
+
34
+ resultsList.innerHTML = ''
35
+ data.results.forEach((item) => {
36
+ const li = document.createElement('li')
37
+
38
+ const link = document.createElement('a')
39
+ link.href = `/${item.type.toLowerCase()}/${item.id}/`
40
+ link.textContent = item.text
41
+ link.style.textDecoration = 'none'
42
+ link.style.color = 'black'
43
+ li.appendChild(link)
44
+ resultsList.appendChild(li)
45
  })
46
+ })
47
+ </script>
48
+ </body>
49
+
50
+ </html>