diff --git a/django_project/views.py b/django_project/views.py index f9042b4c..33c0572d 100644 --- a/django_project/views.py +++ b/django_project/views.py @@ -12,6 +12,8 @@ def home(request): data2 = reponse2.json() result2 = data2["message"] - + # USING APIS => Example 3 + response3 = requests.get('https://api.chucknorris.io/jokes/random') + data3 = response3.json() + result3 = data3["value"] - return render(request, 'templates/index.html', {'result': result, 'result2': result2}) \ No newline at end of file diff --git a/static/styles.css b/static/styles.css index 530d510b..97c0cf50 100644 --- a/static/styles.css +++ b/static/styles.css @@ -1,9 +1,34 @@ body{ - background: hotpink + background: pink; + font-family: 'Ariel', sans-serif; } - -img{ - width: 100px; +.container{ + width: 80%; + margin: auto; + padding: 20px; +} +h1, h2{ + text-align: center; + color: white; +} +.random-pet, .chuck-joke { + background-color: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + margin-bottom: 20px; +} +.image-random img { + width: 150px; height: 100px; - border-radius: 9999; + border-radius: 75px; + display: block; + margin: 0 auto; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); +} + +.joke-content { + font-style: italic; + color: #555; + text-align: center; } diff --git a/templates/index.html b/templates/index.html index b0f60817..8338d330 100644 --- a/templates/index.html +++ b/templates/index.html @@ -10,13 +10,29 @@