Skip to content

Commit

Permalink
First deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
yaozeliangtest committed Apr 27, 2020
1 parent 6e57a78 commit 1a855b5
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 57 deletions.
4 changes: 1 addition & 3 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@
path('article-detail/<str:pk>/', views.articleDetail, name="api_article_detail"),
path('article-update/<str:pk>/', views.articleUpdate, name="api_article_update"),
path('article-delete/<str:pk>/', views.articleDelete, name="api_article_delete"),
]


]
Binary file modified db.sqlite3
Binary file not shown.
15 changes: 0 additions & 15 deletions demo.py

This file was deleted.

21 changes: 13 additions & 8 deletions my_blog/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
'allauth',
'allauth.account',
'allauth.socialaccount',
# 可添加需要的第三方登录
'allauth.socialaccount.providers.github',
'rest_framework',
'django.contrib.sites',
Expand All @@ -55,7 +54,7 @@
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
# 'whitenoise.runserver_nostatic', # new!
'whitenoise.runserver_nostatic', # new!
'django.contrib.staticfiles',
]

Expand All @@ -71,7 +70,7 @@
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
# 'whitenoise.middleware.WhiteNoiseMiddleware', # new!
'whitenoise.middleware.WhiteNoiseMiddleware', # new!
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
Expand Down Expand Up @@ -231,13 +230,19 @@



STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
# STATIC_URL = '/static/'
# STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]


# """Deploy setting
# STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') # new
# STATIC_URL = '/static/'
# STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
# STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
# """


"""Deploy setting
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') # new
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
"""
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
23 changes: 23 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
asgiref==3.2.7
Django==3.0.5
django-appconf==1.0.4
django-ckeditor==5.9.0
django-crispy-forms==1.9.0
django-imagekit==4.0.2
django-js-asset==1.2.2
django-model-utils==4.0.0
django-notifications-hq==1.6.0
django-password-reset==2.0
django-simpleui==3.9.1
django-taggit==1.2.0
gunicorn==20.0.4
jsonfield==3.1.0
Markdown==3.2.1
pilkit==2.0
Pillow==7.1.1
Pygments==2.6.1
pytz==2019.3
six==1.14.0
sqlparse==0.3.1
swapper==1.1.2.post1
whitenoise==5.0.1
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.8.2
37 changes: 9 additions & 28 deletions templates/article/inclusions/_notification.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
<!-- <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 ">
Expand All @@ -27,25 +19,14 @@

</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 class="row notification">
<div class="card col-10 ml-md-2 mb-3">
<div class="card-body">
<p class="card-text">
<i class="fas fa-bullhorn"></i><span> 开发进度: 生成Rest API</span>
</p>
</div>
</div>
</div> -->
</div>

20 changes: 17 additions & 3 deletions templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,34 @@
<!-- 导航栏商标 -->
<!-- <a class="navbar-brand" href="#"></a> -->

<a class="navbar-brand" href="#">
<a class="navbar-brand" href="/">
<span><img src="{% static 'images/self.jpg' %}" width="30" height="30" class="d-inline-block align-top">
YAO Zeliang</span>
YAO ZELIANG</span>
</a>

<!-- 导航入口 -->
<div>
<ul class="navbar-nav">
<!-- 条目 -->

<li class="nav-item ">
<a class="nav-link " href="{% url 'article:article_list' %}">文章</a>
<a class="nav-link " href="{% url 'api:api_overview' %}">API</a>
</li>


<li class="nav-item ">
<a class="nav-link " href="#">Resume</a>
</li>


<li class="nav-item ">
<a class="nav-link " href="#">Covid-19</a>
</li>


<li class="nav-item ">
<a class="nav-link " href="{% url 'article:article_list' %}">文章</a>
</li>

{% if user.is_authenticated %}
<!-- 如果用户已经登录,则显示用户名下拉框 -->
Expand Down

0 comments on commit 1a855b5

Please sign in to comment.