-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e899ad0
commit b9ee686
Showing
16 changed files
with
231 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import requests | ||
|
||
url = 'http://api.openweathermap.org/data/2.5/weather?q=Paris,fr&units=imperial&appid=2e37fd2364d867821f298280137eecc0' | ||
r = requests.get(url).json() | ||
paris_weather={} | ||
|
||
if r['cod']==200: | ||
paris_weather = { | ||
'city':'Paris', | ||
'temperature' :float("{0:.2f}".format((r['main']['temp']-32)* 5/9)), | ||
'description' : r['weather'][0]['description'], | ||
'icon' : r['weather'][0]['icon'], | ||
'country':r['sys']['country']} | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,51 @@ | ||
<div class="row notification"> | ||
<!-- <div class="row notification"> | ||
<div class="card col-10 ml-md-2 mb-3"> | ||
<div class="card-body"> | ||
<p class="card-text"> | ||
<span><i class="fas fa-bullhorn fa-2x"></i> 持续修改更新中</span> | ||
</p> | ||
</div> | ||
</div> | ||
</div> --> | ||
|
||
<div class="row"> | ||
<article class="media col-10 ml-md-2 mb-3 "> | ||
<div class="media-left"> | ||
<figure class="image is-60x60"> | ||
<img src="http://openweathermap.org/img/w/{{ paris_weather.icon }}.png" alt="Image"> | ||
</figure> | ||
</div> | ||
<div class="media-content"> | ||
<div class="content"> | ||
<p> | ||
<span class="title">{{ paris_weather.city }}, {{ paris_weather.country }}</span> | ||
<br> | ||
<span class="subtitle">{{ paris_weather.temperature }} °c, {{ paris_weather.description }}</span> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
</article> | ||
</div> | ||
<!-- <div class="row"> | ||
<div class="col-10 ml-md-2 mb-1"> | ||
<div class="media"> | ||
<div class="media-left"> | ||
<figure class="image is-80x80"> | ||
<img | ||
src="http://openweathermap.org/img/w/{{ paris_weather.icon }}.png" | ||
alt="Image" | ||
/> | ||
</figure> | ||
</div> | ||
<div class="media-body"> | ||
<p> | ||
{{ paris_weather.temperature }} °C, {{ paris_weather.city }} | ||
</p> | ||
<p>Today: {{ paris_weather.description }}</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ <h6 class="card-title">About Me | |
|
||
<a href="https://github.com/yaozeliang/"> | ||
<i class="fab fa-github" style="color: lightslategrey"></i></a> | ||
{{ current_time }} | ||
</h6> | ||
<!-- <p class="card-text mb-1"><b>所以我们奋力向前,逆水行舟,直至被推回往昔岁月</b> </p> --> | ||
<p class="card-text mb-0"><span><i class="far fa-envelope "></i></span> [email protected]</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
from django.urls import path | ||
from . import views | ||
from .views import user_login,user_logout,user_delete,profile_edit,RegisterView,user_register | ||
|
||
|
||
|
||
app_name = 'userprofile' | ||
|
||
urlpatterns = [ | ||
# 用户登录 | ||
path('login/', views.user_login, name='login'), | ||
path('logout/', views.user_logout, name='logout'), | ||
path('register/', views.user_register, name='register'), | ||
path('delete/<int:id>/', views.user_delete, name='delete'), | ||
path('edit/<int:id>/', views.profile_edit, name='edit'), | ||
path('login/', user_login, name='login'), | ||
path('logout/', user_logout, name='logout'), | ||
path('register/', user_register, name='register'), | ||
# path('register/', RegisterView.as_view(), name='register'), | ||
|
||
path('delete/<int:id>/', user_delete, name='delete'), | ||
path('edit/<int:id>/', profile_edit, name='edit'), | ||
] |
Oops, something went wrong.