From f426199d3de44386997abc7b50dbb96e3df30c57 Mon Sep 17 00:00:00 2001 From: blog <2429194235@qq.com> Date: Mon, 27 May 2024 19:49:54 +0800 Subject: [PATCH] first commit --- 4_blog/.idea/.gitignore | 8 + 4_blog/.idea/blog.iml | 29 + 4_blog/.idea/misc.xml | 7 + 4_blog/.idea/modules.xml | 8 + 4_blog/blog/__init__.py | 0 4_blog/blog/__init__.pyc | Bin 0 -> 138 bytes 4_blog/blog/settings.py | 134 ++ 4_blog/blog/settings.pyc | Bin 0 -> 2851 bytes 4_blog/blog/urls.py | 22 + 4_blog/blog/urls.pyc | Bin 0 -> 1042 bytes 4_blog/blog/wsgi.py | 16 + 4_blog/blog/wsgi.pyc | Bin 0 -> 590 bytes 4_blog/db.sqlite3 | Bin 0 -> 3072 bytes 4_blog/manage.py | 22 + 4_blog/post/__init__.py | 17 + 4_blog/post/__init__.pyc | Bin 0 -> 838 bytes .../post/__pycache__/models.cpython-312.pyc | Bin 0 -> 2710 bytes 4_blog/post/admin.py | 13 + 4_blog/post/admin.pyc | Bin 0 -> 697 bytes 4_blog/post/apps.py | 8 + 4_blog/post/migrations/0001_initial.py | 56 + 4_blog/post/migrations/0001_initial.pyc | Bin 0 -> 1723 bytes 4_blog/post/migrations/__init__.py | 0 4_blog/post/migrations/__init__.pyc | Bin 0 -> 149 bytes 4_blog/post/models.py | 42 + 4_blog/post/models.pyc | Bin 0 -> 2579 bytes 4_blog/post/templates/detail.html | 39 + 4_blog/post/templates/index.html | 111 ++ 4_blog/post/templatetags/__init__.py | 0 4_blog/post/templatetags/__init__.pyc | Bin 0 -> 151 bytes 4_blog/post/templatetags/myfilter.py | 10 + 4_blog/post/templatetags/myfilter.pyc | Bin 0 -> 469 bytes 4_blog/post/tests.py | 6 + 4_blog/post/urls.py | 10 + 4_blog/post/urls.pyc | Bin 0 -> 356 bytes 4_blog/post/views.py | 56 + 4_blog/post/views.pyc | Bin 0 -> 1400 bytes 4_blog/static/css/style.css | 1492 +++++++++++++++++ 4_blog/templates/base.html | 57 + 4_blog/templates/footer.html | 9 + 4_blog/templates/header.html | 17 + 4_blog/templates/right.html | 109 ++ 42 files changed, 2298 insertions(+) create mode 100644 4_blog/.idea/.gitignore create mode 100644 4_blog/.idea/blog.iml create mode 100644 4_blog/.idea/misc.xml create mode 100644 4_blog/.idea/modules.xml create mode 100644 4_blog/blog/__init__.py create mode 100644 4_blog/blog/__init__.pyc create mode 100644 4_blog/blog/settings.py create mode 100644 4_blog/blog/settings.pyc create mode 100644 4_blog/blog/urls.py create mode 100644 4_blog/blog/urls.pyc create mode 100644 4_blog/blog/wsgi.py create mode 100644 4_blog/blog/wsgi.pyc create mode 100644 4_blog/db.sqlite3 create mode 100644 4_blog/manage.py create mode 100644 4_blog/post/__init__.py create mode 100644 4_blog/post/__init__.pyc create mode 100644 4_blog/post/__pycache__/models.cpython-312.pyc create mode 100644 4_blog/post/admin.py create mode 100644 4_blog/post/admin.pyc create mode 100644 4_blog/post/apps.py create mode 100644 4_blog/post/migrations/0001_initial.py create mode 100644 4_blog/post/migrations/0001_initial.pyc create mode 100644 4_blog/post/migrations/__init__.py create mode 100644 4_blog/post/migrations/__init__.pyc create mode 100644 4_blog/post/models.py create mode 100644 4_blog/post/models.pyc create mode 100644 4_blog/post/templates/detail.html create mode 100644 4_blog/post/templates/index.html create mode 100644 4_blog/post/templatetags/__init__.py create mode 100644 4_blog/post/templatetags/__init__.pyc create mode 100644 4_blog/post/templatetags/myfilter.py create mode 100644 4_blog/post/templatetags/myfilter.pyc create mode 100644 4_blog/post/tests.py create mode 100644 4_blog/post/urls.py create mode 100644 4_blog/post/urls.pyc create mode 100644 4_blog/post/views.py create mode 100644 4_blog/post/views.pyc create mode 100644 4_blog/static/css/style.css create mode 100644 4_blog/templates/base.html create mode 100644 4_blog/templates/footer.html create mode 100644 4_blog/templates/header.html create mode 100644 4_blog/templates/right.html diff --git a/4_blog/.idea/.gitignore b/4_blog/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/4_blog/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/4_blog/.idea/blog.iml b/4_blog/.idea/blog.iml new file mode 100644 index 0000000..a737045 --- /dev/null +++ b/4_blog/.idea/blog.iml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/4_blog/.idea/misc.xml b/4_blog/.idea/misc.xml new file mode 100644 index 0000000..db8786c --- /dev/null +++ b/4_blog/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/4_blog/.idea/modules.xml b/4_blog/.idea/modules.xml new file mode 100644 index 0000000..e81aaae --- /dev/null +++ b/4_blog/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/4_blog/blog/__init__.py b/4_blog/blog/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/4_blog/blog/__init__.pyc b/4_blog/blog/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b14bfeb6c8c3937836b6deac165c55cb7897a512 GIT binary patch literal 138 zcmZSn%*z#}n;V_X00oRd+5w1*S%5?e14FO|NW@PANHCxg#l}D}7ps_p%94!yyyX0p z)Z&F4F DSRfp4 literal 0 HcmV?d00001 diff --git a/4_blog/blog/settings.py b/4_blog/blog/settings.py new file mode 100644 index 0000000..1070fc2 --- /dev/null +++ b/4_blog/blog/settings.py @@ -0,0 +1,134 @@ +""" +Django settings for blog project. + +Generated by 'django-admin startproject' using Django 1.11.6. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.11/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +from django.conf import global_settings + +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'ry!upfimxiq7+559yq3skd%xc6+7dml(+lmy_n#ylw8!#ub-ld' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'post' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'blog.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'templates')] + , + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'blog.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': '180810db', + 'USER': 'root', + 'PASSWORD': '123456', + 'HOST': '127.0.0.1', + 'PORT': '3306' + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'zh-Hans' + +TIME_ZONE = 'Asia/Shanghai' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + +STATIC_URL = '/static/' + +STATICFILES_DIRS = [ + os.path.join(BASE_DIR,'static','css') +] + +# global_settings diff --git a/4_blog/blog/settings.pyc b/4_blog/blog/settings.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63cef39bc9af8d14e8fb2a85c386c37fb5e5e4ca GIT binary patch literal 2851 zcmb7Fdvn@G5MRK7n8b;j_p7baG>sF-!q_o(Go7>w$TkxU9)#mo&5TCq4md{-tUKz^ zfAbCc3Hu%T0ouJ2Sfut$8zk=b_VL@j-P=>{uZ7~Dwcu9|CcgsCKjEMMkpUn8HjWt} zS@1JpBY|%Y{44}Huyc^18917QqYLnFA`i3xA2XBJz6fLv?0KL?urEO$aW4b803;8j z00gD;K#D+6Q~-Mc2ug9h0^}-?MIc`Qxu!(OxeoSKU~@oj0J#a3iQ`3}h;j=)W}%NU z-bMl9-GK_j)mfZPZ20QzY7B~-{)P(eK#fxia(8lV=#STrCHQTPpzM>u^8VCqx;nxFleq#)TV;iRKe+#1TT9AeQxVS+Ah^HX;U5Of?oFc;E^a zg&MwMz|bA@>2vf>ivuBs{AH;`B9H5dlW7QE6qIOKl87Y{4VlMF(|Ah>z8FxgH}ZYW zXIyAeFWrwD67)n_to`QtBg#L^SxkE~p4i{`Yc65dKwQP4??+wNcc!86HRQ$PhofPS z1s~Y)=JLkI_v7Pr{+>Mk;8m74N#HLn`@z@=AC3K!t%r|B-4&nk8)%m7SNEb&#H_2U zPT^8<2r(Oe^!$p`EckXG7C8&f4!Kshu&DjW;QFaGD?8^O^Vl z$o1Z1|L8w&$8JDdL)j;M#&jM{WoPQ6*yp^I0tp%nee6%YiwHC%)ArGmPV7v?T*zDb zwNZUzHfutnO%0RU*6M9bTtv39zwgKeUpmK!I%yw-gT3kD?xGmI(e9|vpZ!1Om>y#n z3cj4Gf0F%k@MTr_`dR(cjGtpOm5FO;cUG=a(c16STTP4KL=~0T6W(XKI~-y)RKfY3 z)G6tv=?%vG*cW*en$4Yh(^Oe2Z>?^XS4mg(Nz>Rf6%j{~P{e^{wv|bFZT-bYMVagy zmUY-_*SIW3d2Lf)#iy*)cUx9R5$o%#6-Df~+8q@(p*?rx3%;8M_elnaF6SpvOdP!M z7*QM14>*ktA@7!vpcV_5@5)|%n`mGWUwsDH9t&A83K}%*i$MzU<7Yr5t-C*oG{yMo zGccN?fX2)_3nGvC?}L?H7w@|Tqz%s8k~P5Z+`wgAp70WWx3H^Asvrq1a>(~MUwVME z%CqC(r^sx>GkcWM0DVV)_ zt=2FPjkYN+qei>c>Np4OMzz)4R=7tI3su8+%)R}F(J?KthQzH_f>Nm& z9Ye-w33>R9gU+rqJ*LiEqftkB3-1XTTf=DX92h&MQ*G7E1i!v#I(BQ)5qRXCdU>m< z_AM8U@@iA1TrN6xl7bHUuF7y#Ot?2(Zr2;8rS705^aJUju7TRicf+w5M4=ZE%HJhL zSzE;h++16KCp$SArXOYzqvxQ79n@Dct6N>`!ljq7j>Y#M`U$}^<$%Cr@0J)+lFaQ7m literal 0 HcmV?d00001 diff --git a/4_blog/blog/urls.py b/4_blog/blog/urls.py new file mode 100644 index 0000000..acf12b5 --- /dev/null +++ b/4_blog/blog/urls.py @@ -0,0 +1,22 @@ +"""blog URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.11/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url, include +from django.contrib import admin + +urlpatterns = [ + url(r'^admin/', admin.site.urls), + url(r'^', include('post.urls')), +] diff --git a/4_blog/blog/urls.pyc b/4_blog/blog/urls.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a7d542edd843ce675844b6a6403110d41cabeef GIT binary patch literal 1042 zcma)5-*3|}5WY11F@k`J2cG?a)Kn_TTBLz0K%l|IB*a63mr}J$W4BEe+mY=u_Pjrt zKLGCBMwCfNis{WC)WG z0*Z!EHbJ&v(t- z)JA#;R+S>Nf>|L(5yNloTxCaT%5`oNzRA=|S4M9{?vh-~RH$^23%FNnl3+#;_;Qo(?c57jXO5(Mu34KH?&;QPR zXh)LSIl;ueTbwRbUT%4zRw#t8NbTi#qP0dBUL1yG@Qf%|#67m$%Q@OfwmTC%47E&1 z`I;;G{d(8kIn%{TQOCMmmjWKQ+v`QeZ~S7sf8atiSi*I1tdj#;ptq25Stv_OGw-I3 zmS*-I+DcpJ0YAqy^#JoZUa$Gw9b@2jKVyu+*h4@3XW5xzG4@=V7`KHJjvUg!-QPL& zGl+2te~nFX`hGO6uH9OzTytTkyRyTR!ON2u!{<|KduIqQ!AyF4ucYSNQoMPDzNJ7r KcoH0kkApuULMeFw literal 0 HcmV?d00001 diff --git a/4_blog/blog/wsgi.py b/4_blog/blog/wsgi.py new file mode 100644 index 0000000..bae86cb --- /dev/null +++ b/4_blog/blog/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for blog project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blog.settings") + +application = get_wsgi_application() diff --git a/4_blog/blog/wsgi.pyc b/4_blog/blog/wsgi.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ed5d0a9ff281ede4643b8175248f8de174874c6 GIT binary patch literal 590 zcmYjOU2oGc6m^oVpunU_AfEl$2Ntj60W={5sG}-^PNG9drBdp}x2Y?~H;V5%_PpQ7 zFX0Ek^#Wp6a(sP1&N)u9UkCZ(sQF%rzboVYEx+MCgAroEm!mxu)i{A9wVqRGS} z6A2_@yC=5$!t4pNFK$y#W#X3S261RU97L|44EeYDWGXB4Yg@}TcJk6;E!z&aP*IWR zQJ>$ao+3Ll5UC=RC0i;>N;$?rhrIRnii&SlM3pa`>zl#vY=@q5PB4{$wZ3vhkN9}c z$uRc+hoJa4K3%pqv_W5?fw1f)PL4;fj$fXM7@GLAM(uW{!hG#afmQTAE$@u Glk^W8a-%8$ literal 0 HcmV?d00001 diff --git a/4_blog/db.sqlite3 b/4_blog/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..b9d314acd01dc5ca021266878904748451f75f42 GIT binary patch literal 3072 zcmWFz^vNtqRY=P(%1ta$FlJz3U}R))P*7lCU|`;40x zsEUc{5(BdekQfD{Awbg*2w-9p*Vbl?EJ;ktNi8nS0VePG;?%;@)VySLF0*rxt7C|( zLWrZ2kE;TjT8+HK+*BQ)PR+(hMs{(1ea5Clu$d`YiFxVy@wu7lMTsSu`FX_{0!%38 zDq+YgDQGBVrYI?7=9Q$Trxq#r`G+X@h5Gm?1O$2dItE25c)La_IEIG!d-?%Q@^$qK z(NR!JEGSS?C`&9#&PXiMFfujOglhvzg4~K*7N|8RGZkoIN@7WBNoH;;T&pH1Z=&RC fn#Rqj;iDli8UlkU1V;1!V2X`Vw~U4WeM0~MK7nft literal 0 HcmV?d00001 diff --git a/4_blog/manage.py b/4_blog/manage.py new file mode 100644 index 0000000..0ea0e80 --- /dev/null +++ b/4_blog/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blog.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv) diff --git a/4_blog/post/__init__.py b/4_blog/post/__init__.py new file mode 100644 index 0000000..e10a4d0 --- /dev/null +++ b/4_blog/post/__init__.py @@ -0,0 +1,17 @@ +# coding:utf-8 + +from django.apps import AppConfig +import os + +default_app_config = 'post.PrimaryBlogConfig' + +VERBOSE_APP_NAME = u"博客管理" + + +def get_current_app_name(_file): + return os.path.split(os.path.dirname(_file))[-1] + + +class PrimaryBlogConfig(AppConfig): + name = get_current_app_name(__file__) + verbose_name = VERBOSE_APP_NAME \ No newline at end of file diff --git a/4_blog/post/__init__.pyc b/4_blog/post/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0200ba624ddfcd3aa71ab3e94892771e212d180d GIT binary patch literal 838 zcmb_aO=}cE5UrlsotU^{B0K26HE8U0>9-bXO=0#4x(R1lSd zVnKpqj|z`skCacbPpU_8k5r#N5XF5`0ck-CL284)yeE1S2fSw<-oknLPpnV?*-f}n z(;U~;B419;eS}SI>~PlRW!hehi+b7R)&r!jK7YNs{C<7;?fT2djQ6uK)nk}>1ZRm> zf>z!i;L|(w7yMv^2lLQF(X=Db<9d$Kka3gRGusC+O_5u>0i^P_N=w~w<&<3Hg$@D8 zIdcGX@+@gC>{(r9wbCY0tF&6y`+JX{?mgK*NKP?A!ZRgO=2dQ`9HM#``<;{2I%J&V#YJP7c?hQ=yCCh6_IXtN3*9G39?d(hJd0)NrRyT4 z-Eu)$t97BJjDnj2o)87B2s5(V0Iw&}_|<$ON3)rnj$TeI|BZ9qp4LXY6K^E>CtV^Y zdKYH6eIN!RbktdvPS+unG7&Dq7Q*oG+>@$DU`nV#U+Bvyw;8Ntwlp1Pd#VGU3H0uLV97&p1E`G zJ?EbLo$u@)O-+6RBQl)*>IWAgf8tARxc8KupFp`!RHAYk$#O}KL!H<7tdJBq!jsEH z6>bsLMTK#(ws`+{NpSR}+qQIrrRNQn9^29jmf{;My#-&)zl{!JoYkDqjiq&!%G#Jo znW7mm=gGo^W~BGyA*6n=5tzMCC`ocEN%A~-y)%_lc~w|;z3w1Oyt8rAqe8ezZ$XUt zEOAgVX+~#-?GE^w$Ol1gJ^8g-TB_c?z4d5iQLy}3WlGj)E@R%XJP`KHJhg(8l#S{J zm2*m#9txOqoRFPXQ1$~>xul@-NmoILxn4EZoc3O®U`IlUJ}-c$D`Bg8{wx62wq{s(SnW^LxK+ zt``6L?rHVmkEtO&ozK#oX{4$TA8oGAZmxcxnkbkz^jvDBFnB{@S&2?%Cp4PslSef@ zlbX;CGv(YjrKuv3EgQ0a>mgOP+46t?E56 z8wNAu1c)N3gwH-u=f~&9%i*3ivBwTJ9urwJd}V0DPNINfBbE=dF+4^!m7T#!JQF*M z;vE$BIWYo;H)snlC`LC3$Vf0!8r}#-%E8Fb{K~oCzgQ0@ikDt`cz4%71jLTWxns^A zxcm^H{_hG95=w?)tPc2}FMPZ8_%{dq3@PGJFttlO4&5Sb=m6Vo0x~l;rk!o$471;u zF*}u=@BuSf$IuzTP)GM$#E=K#+JldY@L}!fZXY}LZBB58VyI6vs{k&a}@w$5G|7 zP$xxT{G%up=ydPilfd?16>=OMluLUrNzt~zBQ*?_Uv}5`@!M8dG!26WVSg;JhOz9a zM;fx%VuBk6ZLaTsV!tcZ*PT>-K>IBPe=K0RMu5k*RoEaACO&|*mP@5Z+VUmn zlxb6{8xV)tT3G2@4}Mg@15mP=Zb4R^dZcIrPAa^SSp95g|?O9r|~E8_3&Wv zvx;9Tb#3^ivR_(gdFGE62VWj4@NTETF)HXr*!r*M%{+r<&jgsWeCoK8%jmu8sMDI< zSMh(7(|9B>u+P&#vaiGe=l{c}>=Q7-dNw`=@wdQnT$OZJNo3dK<6@=BJ2SI0y9CtT hQzF+@>bi4&_WUjZb+@&N>n>fmGcY^wf`DpA`7abVJXp_Gy|g{~TclT8$XP&^Z5%t$ht(L&uiKiY5T z2ekK&LJfs(GKkSVb06oP6aG4ke}1d)*LXQ0{m&7={-8k8Ct!eDAQKRb1DF7Hh%6)= zLQY^NxRq0=5Su9;1!RP0Uk4ofTqrHlg^1=|E7}) zid;fh-{^HKRbjMKU1{u?nNp^dwQe*Qj&B^jcSm$zx7K~9CUe0he^myQ`ob!?MuEkV zuq?ppCS?bDp6awSs-ID`?o{cNOu6kpDeiK-bWt>At%}0M9@MSu4a2ttjkd0k+HOrb zq=d1*?1JFekNI|RPi@0GZ7w%uQ?<**$=Tw=@-%-iZIy3HQ10~}Z-*7LGO6XwB5{>6 z%M0^k@A{6ISM&sL#yIbI-8Qb%4=ZnML`m9F8SC5jUisN>LTO8Wdug4jNPy}*xFkoa owi_Jpa9dWslh&X%~CL$4k084U|j{pDw literal 0 HcmV?d00001 diff --git a/4_blog/post/apps.py b/4_blog/post/apps.py new file mode 100644 index 0000000..75d673e --- /dev/null +++ b/4_blog/post/apps.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import AppConfig + + +class PostConfig(AppConfig): + name = 'post' diff --git a/4_blog/post/migrations/0001_initial.py b/4_blog/post/migrations/0001_initial.py new file mode 100644 index 0000000..8af59b5 --- /dev/null +++ b/4_blog/post/migrations/0001_initial.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.6 on 2018-08-10 07:51 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Category', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cname', models.CharField(max_length=30, unique=True)), + ], + options={ + 'db_table': 't_category', + }, + ), + migrations.CreateModel( + name='Post', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=100, unique=True)), + ('desc', models.CharField(max_length=100)), + ('content', models.TextField()), + ('created', models.DateTimeField(auto_now_add=True)), + ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='post.Category')), + ], + options={ + 'db_table': 't_post', + }, + ), + migrations.CreateModel( + name='Tag', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('tname', models.CharField(max_length=30, unique=True)), + ], + options={ + 'db_table': 't_tag', + }, + ), + migrations.AddField( + model_name='post', + name='tag', + field=models.ManyToManyField(to='post.Tag'), + ), + ] diff --git a/4_blog/post/migrations/0001_initial.pyc b/4_blog/post/migrations/0001_initial.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2b71a4fa88a1879c9839de6f64140341df44c48 GIT binary patch literal 1723 zcmb_cZI9DN5FXn}?s6~Wcsb}np-_;>7oq?XoT{qok#JH~U0dbyg*1}oWGB82wl~;o zApLs$z5bg1fOcj!FNY8kNX^T7cV;~MJkQK-@Xzkn?QZ(#7#5#^o%q51{G%wAgRKj2C4!Wz;pv99;hmO05}JDHP`?Zz-hBaIrYEv zX?irXdo+}p9vg*WqAli8QZ#+`Y|)VFIFGD0Sz-CTl%kU2H(RIq$kgd6 z+z{g~sBZu-!L-2zneM^#GN=PkH+2WxwKD#xsDS37fSeB%txlcP||anU%F+L9%DARPK@4%31+c9 z(|5=r+fv`YDba4w+RUU&OKw^lju+qrsTzeg8YNgV{y$7%C9~BwK~3EVVpmv~IKW z=4uIM?6~qVb6POw)jRCxNReAW$QG2Uxz7o>E}^^^hLR`@>BN=^(vlPP^MzVE)0Wg1 z=@rf}Q<#l47CpHVxLh5fe!@U{LWz(35f$~AOD!ml>83zo-#LqNXXmIszPE10B6O(~ zeVwASaCweRjyleMrAA;))HKRsBf6=PP!J{Q&XK})j!rvA-IwAxQp%-i(0eCQHt!oA z*Qw2n?k{PCCPlz{C|=OA`@?WHw`V5f%dQx@ji0n1AGV)Ac{&^=CLXe$!}X;%Y`5Ew z!-ZO{*}TVmAY5+AA0xvz}pJk{Fb-xHR%87f^FsZYF?A;w5ZRdv}I29 z>5&OUOb4r_Mp6tX{sB2x_LjSaTT7XGd>#bZny<|MC(pQ4zkrzlXQu=gnTsOMAQ^WG=x({YIo6-6a_N;D*T5=>DvHE~cL zACxJoOdM3l2NjB@>7X{lcXt2aPffApmiUn;-F6yT6L+2MhjCV%l=-B`>Ns;%7VDw2 zowPp~dr@KK192`W1jR7fAxrrC@Gx?Xr{ zVw-f_QFk3W0AYyV{}O(VZuv+ z`2hREJ_57TxpDeG=^i7$CkH8cnqauZ3JWtw^l!iTZMNb9hcA7YwIEMn+}^Vg9oJ ch;*|iBvJaj_>J%dLYM*ClDFiq&92S72Q1q6>i_@% literal 0 HcmV?d00001 diff --git a/4_blog/post/templates/detail.html b/4_blog/post/templates/detail.html new file mode 100644 index 0000000..31a8fec --- /dev/null +++ b/4_blog/post/templates/detail.html @@ -0,0 +1,39 @@ +{% extends 'base.html' %} +{% load myfilter %} + +{% block title %} + 详情页面 +{% endblock %} + +{% block left %} + +
+ +
+ +
+ + +{% endblock %} \ No newline at end of file diff --git a/4_blog/post/templates/index.html b/4_blog/post/templates/index.html new file mode 100644 index 0000000..55c1f80 --- /dev/null +++ b/4_blog/post/templates/index.html @@ -0,0 +1,111 @@ +{% extends 'base.html' %} + +{% block title %}首页{% endblock %} + + + +{% block left %} +
+ + {% for post in postList %} + + {% endfor %} + + + + + + +
+ + +{% endblock %} + + + + + + + + + + + + + + + diff --git a/4_blog/post/templatetags/__init__.py b/4_blog/post/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/4_blog/post/templatetags/__init__.pyc b/4_blog/post/templatetags/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e156558578785538a6e366afa2c0efb96e6ab87f GIT binary patch literal 151 zcmZSn%*(akA}>0b0SXv_v;zCa`RJ4b5iXPhJFwI~Cu;8FMR0${!?*JRT8-Pk+ zo({04{KSzm%;FBpeYy0~w>cdUo8lHDoS+~aEs+1lV9lTcSa-a6O3!A0P`kLd(myNr zT6dRm3r}98S?P?>DMl}0irL*nG;Mrxb?%f7LRGRZ+<0_$Il361i=}aeXk3UQYTFnY zb(BRAwtXy3)P9Jiw_xKk<{c4>6 literal 0 HcmV?d00001 diff --git a/4_blog/post/tests.py b/4_blog/post/tests.py new file mode 100644 index 0000000..5982e6b --- /dev/null +++ b/4_blog/post/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/4_blog/post/urls.py b/4_blog/post/urls.py new file mode 100644 index 0000000..0d4c789 --- /dev/null +++ b/4_blog/post/urls.py @@ -0,0 +1,10 @@ +#coding=utf-8 + +from django.conf.urls import url +import views + +urlpatterns=[ + url(r'^$',views.queryAll), + url(r'^page/(\d+)$',views.queryAll), + url(r'^post/(\d+)$',views.detail), +] diff --git a/4_blog/post/urls.pyc b/4_blog/post/urls.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89fd1f06e99b4c60ba47205b900d8cf6abdcbcc9 GIT binary patch literal 356 zcmY*U!Ab)$5S=7lDOzbi!owC}TPvuDhy~9c>}?Igx{2$SG+B3Mm7e`5Kg$-G2;9qxag`G*pAk#N1?jSEhOmjDN_5|9fJkxOtAatT&|QD7x36?|-I?>|j8 zv=>h+1$h$hF48@oTYqz;f)OcBUF+^pGI%_~K`c#C*-5I+@%UE=NIPLOfJWSAmW8iE zRtEo^@d&(U4Jdx#t+ww-eMYaHZP#<>DB2oJMeXQ-A@?^0k!?MuOyMu#gz4?2Zr1b? vd>M>Iy>*&RPcEkCvs3-#LZusil8&|+cSftLRWO~i*YQUfg^?Jjp%{uEkjG3z literal 0 HcmV?d00001 diff --git a/4_blog/post/views.py b/4_blog/post/views.py new file mode 100644 index 0000000..890fecf --- /dev/null +++ b/4_blog/post/views.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.shortcuts import render + +# Create your views here. +#渲染主页面 +# from post.models import Post +from templates.models import Post + +from django.core.paginator import Paginator +import math + +def queryAll(request,num=1): + + num = int(num) + + #获取所有帖子信息 + postList = Post.objects.all().order_by('-created') + + #创建分页器对象 + pageObj = Paginator(postList,1) + + #获取当前页的数据 + perPageList = pageObj.page(num) + + + #生成页码数列表 + # 每页开始页码 + begin = (num - int(math.ceil(10.0 / 2))) + if begin < 1: + begin = 1 + + # 每页结束页码 + end = begin + 9 + if end > pageObj.num_pages: + end = pageObj.num_pages + + if end <= 10: + begin = 1 + else: + begin = end - 9 + + pageList = range(begin, end + 1) + + + return render(request,'index.html',{'postList':perPageList,'pageList':pageList,'currentNum':num}) + +#阅读全文功能 +def detail(request,postid): + postid = int(postid) + + #根据postid查询帖子的详情信息 + post = Post.objects.get(id=postid) + + return render(request,'detail.html',{'post':post}) \ No newline at end of file diff --git a/4_blog/post/views.pyc b/4_blog/post/views.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b841a9b3abfb6ca6cf37771ebe2f9b5ca3cc19b GIT binary patch literal 1400 zcmbtUO>fgc5PfUM`D&_0LRBjyxWFM7LMc+I5JE+8M5Qvf5Giu(C2_iri@gRarKj{y z@F%$Pw~+V&@MfLDgM+rol#`A8br zWg6f8E9M1~cg|L=7~EO%LT(1wyJ8W(tk%JK1I4$E&3y?XL`|G46yI+$yKXaZg)JSH zXOM?I>8l01g%vqzA!Uzjzm20+3rUAx3P~47Yo7pbap==ZaCj6KIvC>Cgki^OKGL&d5JYKM-GqT9eoe}HQSZQimWfM6rNeWSomNOj+y924@t|;`U zipTB>M!PF+I(7k){%*P;T)asal!+U_6`X2n#-&nPb?WALz-YLoJfQXF`S{|}&hw>6 zvm7T2c9I_+JUKpicKCEWHTi5TmySQD`b#-vsPxCiipy8V2sY(?E>Jyx-{0|ff_ti` zI(}E}sGdj5>w0&5r&s~yuVRns{8zEms>m2h literal 0 HcmV?d00001 diff --git a/4_blog/static/css/style.css b/4_blog/static/css/style.css new file mode 100644 index 0000000..710fc50 --- /dev/null +++ b/4_blog/static/css/style.css @@ -0,0 +1,1492 @@ + +body { + zoom: 1; + width: 100%; +} +body:before, +body:after { + content: ""; + display: table; +} +body:after { + clear: both; +} +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-family: inherit; + font-size: 100%; + vertical-align: baseline; +} +body { + line-height: 1; + color: #000; + background: #fff; +} +ol, +ul { + list-style: none; +} +table { + border-collapse: separate; + border-spacing: 0; + vertical-align: middle; +} +caption, +th, +td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +a img { + border: none; +} +input, +button { + margin: 0; + padding: 0; +} +input::-moz-focus-inner, +button::-moz-focus-inner { + border: 0; + padding: 0; +} +@font-face { + font-family: FontAwesome; + font-style: normal; + font-weight: normal; + } +html, +body, +#container { + height: 100%; +} +body { + background: #eee; + font: 14px/1.6em "寰蒋闆呴粦", "Microsoft Yahei", "Droid Sans", Helvetica Neue, Helvetica, Arial, sans-serif; + -webkit-text-size-adjust: 100%; +} +.outer { + zoom: 1; + max-width: 1220px; + margin: 0 auto; + padding: 0 10px; +} +.outer:before, +.outer:after { + content: ""; + display: table; +} +.outer:after { + clear: both; +} +.inner { + display: inline; + float: left; + width: 98.3333333333333%; + margin: 0 0.8333333333333%; +} +.left, +.alignleft { + float: left; +} +.right, +.alignright { + float: right; +} +.clear { + clear: both; +} +#container { + position: relative; +} +.mobile-nav-on { + overflow: hidden; +} +#wrap { + height: 100%; + width: 100%; + position: absolute; + top: 0; + left: 0; + -webkit-transition: 0.2s ease-out; + -moz-transition: 0.2s ease-out; + -o-transition: 0.2s ease-out; + -ms-transition: 0.2s ease-out; + transition: 0.2s ease-out; + z-index: 1; + background: #eee; +} +.mobile-nav-on #wrap { + left: 280px; +} +@media screen and (min-width: 768px) { + #main { + display: inline; + float: left; + width: 73.3333333333333%; + margin: 0 0.8333333333333%; + } +} +.article-date, +.article-category-link, +.archive-year, +.widget-title { + text-decoration: none; + text-transform: uppercase; + letter-spacing: 2px; + color: #999; + margin-bottom: 1em; + margin-left: 5px; + line-height: 1em; + text-shadow: 0 1px #fff; + font-weight: bold; +} +.article-inner, +.archive-article-inner { + background: #fff; + -webkit-box-shadow: 1px 2px 3px #ddd; + box-shadow: 1px 2px 3px #ddd; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.article-entry h1, +.widget h1, +.article-entry h2, +.widget h2, +.article-entry h3, +.widget h3, +.article-entry h4, +.widget h4, +.article-entry h5, +.widget h5, +.article-entry h6, +.widget h6 { + font-weight: bold; + color: #000; + font-family: "Droid Serif", Georgia, Serif; +} +.article-entry h1 a, +.widget h1 a, +.article-entry h2 a, +.widget h2 a, +.article-entry h3 a, +.widget h3 a, +.article-entry h4 a, +.widget h4 a, +.article-entry h5 a, +.widget h5 a, +.article-entry h6 a, +.widget h6 a { + color: #000; + text-decoration: none; +} +.article-entry h1 a:hover, +.widget h1 a:hover, +.article-entry h2 a:hover, +.widget h2 a:hover, +.article-entry h3 a:hover, +.widget h3 a:hover, +.article-entry h4 a:hover, +.widget h4 a:hover, +.article-entry h5 a:hover, +.widget h5 a:hover, +.article-entry h6 a:hover, +.widget h6 a:hover { + color: #e32d40; +} +.article-entry h2, +.widget h2, +.article-entry h3, +.widget h3, +.article-entry h4, +.widget h4, +.article-entry h5, +.widget h5, +.article-entry h6, +.widget h6 { + font-weight: 600; + margin-bottom: 10px; +} +.article-entry h1, +.widget h1 { + font-size: 2em; +} +.article-entry h2, +.widget h2 { + font-size: 1.5em; +} +.article-entry h3, +.widget h3 { + font-size: 1.3em; +} +.article-entry h4, +.widget h4 { + font-size: 1.2em; +} +.article-entry h5, +.widget h5 { + font-size: 1em; +} +.article-entry h6, +.widget h6 { + font-size: 1em; + color: #999; +} +.article-entry hr, +.widget hr { + border: 1px dashed #ddd; +} +.article-entry strong, +.widget strong { + font-weight: bold; +} +.article-entry em, +.widget em, +.article-entry cite, +.widget cite { + font-style: italic; +} +.article-entry sup, +.widget sup, +.article-entry sub, +.widget sub { + font-size: 0.75em; + line-height: 0; + position: relative; + vertical-align: baseline; +} +.article-entry sup, +.widget sup { + top: -0.5em; +} +.article-entry sub, +.widget sub { + bottom: -0.2em; +} +.article-entry small, +.widget small { + font-size: 0.85em; +} +.article-entry acronym, +.widget acronym, +.article-entry abbr, +.widget abbr { + border-bottom: 1px dotted; +} +.article-entry ul, +.widget ul, +.article-entry ol, +.widget ol, +.article-entry dl, +.widget dl { + margin: 0 20px; + line-height: 1.6em; +} +.article-entry ul ul, +.widget ul ul, +.article-entry ol ul, +.widget ol ul, +.article-entry ul ol, +.widget ul ol, +.article-entry ol ol, +.widget ol ol { + margin-top: 0; + margin-bottom: 0; +} +.article-entry ul, +.widget ul { + list-style: disc; +} +.article-entry ol, +.widget ol { + list-style: decimal; +} +.article-entry dt, +.widget dt { + font-weight: bold; +} +#header { + height: 67px; + position: relative; + border-bottom: 1px solid #ddd; +} +#header:before, +#header:after { + content: ""; + position: absolute; + left: 0; + right: 0; + height: 40px; +} +#header:before { + top: 0; + background: -webkit-linear-gradient(rgba(0,0,0,0.2), transparent); + background: -moz-linear-gradient(rgba(0,0,0,0.2), transparent); + background: -o-linear-gradient(rgba(0,0,0,0.2), transparent); + background: -ms-linear-gradient(rgba(0,0,0,0.2), transparent); + background: linear-gradient(rgba(0,0,0,0.2), transparent); +} +#header:after { + bottom: 0; + background: -webkit-linear-gradient(transparent, rgba(0,0,0,0.2)); + background: -moz-linear-gradient(transparent, rgba(0,0,0,0.2)); + background: -o-linear-gradient(transparent, rgba(0,0,0,0.2)); + background: -ms-linear-gradient(transparent, rgba(0,0,0,0.2)); + background: linear-gradient(transparent, rgba(0,0,0,0.2)); +} +#header-outer { + height: 100%; + position: relative; +} +#header-inner { + position: relative; + overflow: hidden; +} +#banner { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #21282e; + -webkit-background-size: cover; + -moz-background-size: cover; + background-size: cover; + z-index: -1; +} +#header-title { + text-align: center; + height: 40px; + position: absolute; + top: 50%; + left: 0; + margin-top: -20px; +} +#logo, +#subtitle { + text-decoration: none; + color: #fff; + font-weight: 300; + text-shadow: 0 1px 4px rgba(0,0,0,0.3); +} +#logo { + font-size: 40px; + line-height: 40px; + letter-spacing: 2px; + background: #e32d40; + padding: 5px 10px; + -webkit-border-radius: 5px; + border-radius: 5px; +} +#subtitle { + font-size: 16px; + line-height: 16px; + letter-spacing: 1px; + color: #687e91; +} +#subtitle-wrap { + margin-top: 16px; +} +#main-nav { + float: left; + margin-left: -15px; +} +.nav-icon, +.main-nav-link { + float: left; + color: #fff; + opacity: 0.6; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; + filter: alpha(opacity=60); + text-decoration: none; + text-shadow: 0 1px rgba(0,0,0,0.2); + -webkit-transition: opacity 0.2s; + -moz-transition: opacity 0.2s; + -o-transition: opacity 0.2s; + -ms-transition: opacity 0.2s; + transition: opacity 0.2s; + display: block; + padding: 20px 15px; +} +.nav-icon:hover, +.main-nav-link:hover { + opacity: 1; + -ms-filter: none; + filter: none; +} +.nav-icon { + font-family: FontAwesome; + text-align: center; + font-size: 14px; + width: 14px; + height: 14px; + padding: 20px 15px; + position: relative; + cursor: pointer; +} +.main-nav-link { + font-weight: 300; + letter-spacing: 1px; +} +@media screen and (max-width: 479px) { + .main-nav-link { + display: none; + } +} +#main-nav-toggle { + display: none; +} +#main-nav-toggle:before { + content: "\f0c9"; +} +@media screen and (max-width: 479px) { + #main-nav-toggle { + display: block; + } +} +#sub-nav { + float: right; + margin-right: -15px; +} +#nav-rss-link:before { + content: "\f09e"; +} +#nav-search-btn:before { + content: "\f002"; +} +#search-form-wrap { + position: absolute; + top: 15px; + width: 150px; + height: 30px; + right: -150px; + opacity: 0; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); + -webkit-transition: 0.2s ease-out; + -moz-transition: 0.2s ease-out; + -o-transition: 0.2s ease-out; + -ms-transition: 0.2s ease-out; + transition: 0.2s ease-out; +} +#search-form-wrap.on { + opacity: 1; + -ms-filter: none; + filter: none; + right: 0; +} +@media screen and (max-width: 479px) { + #search-form-wrap { + width: 100%; + right: -100%; + } +} +.search-form { + position: absolute; + top: 0; + left: 0; + right: 0; + background: #fff; + padding: 5px 15px; + -webkit-border-radius: 15px; + border-radius: 15px; + -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.3); + box-shadow: 0 0 10px rgba(0,0,0,0.3); +} +.search-form-input { + border: none; + background: none; + color: #000; + width: 100%; + font: 13px "寰蒋闆呴粦", "Microsoft Yahei", "Droid Sans", Helvetica Neue, Helvetica, Arial, sans-serif; + outline: none; +} +.search-form-input::-webkit-search-results-decoration, +.search-form-input::-webkit-search-cancel-button { + -webkit-appearance: none; +} +.search-form-submit { + position: absolute; + top: 50%; + right: 10px; + margin-top: -7px; + font: 13px FontAwesome; + border: none; + background: none; + color: #bbb; + cursor: pointer; +} +.search-form-submit:hover, +.search-form-submit:focus { + color: #777; +} +.article { + margin: 50px 0; +} +.article-inner { + overflow: hidden; +} +.article-meta { + zoom: 1; +} +.article-meta:before, +.article-meta:after { + content: ""; + display: table; +} +.article-meta:after { + clear: both; +} +.article-date { + float: left; +} +.article-category { + float: left; + line-height: 1em; + color: #ccc; + text-shadow: 0 1px #fff; + margin-left: 8px; +} +.article-category:before { + content: "\2022"; +} +.article-category-link { + margin: 0 12px 1em; +} +.article-header { + padding: 20px 20px 0; +} +.article-title { + text-decoration: none; + font-size: 2em; + font-weight: bold; + color: #000; + line-height: 1.1em; + -webkit-transition: color 0.2s; + -moz-transition: color 0.2s; + -o-transition: color 0.2s; + -ms-transition: color 0.2s; + transition: color 0.2s; +} +a.article-title:hover { + color: #e32d40; +} +.article-entry { + zoom: 1; + color: #000; + padding: 0 20px; +} +.article-entry:before, +.article-entry:after { + content: ""; + display: table; +} +.article-entry:after { + clear: both; +} +.article-entry p, +.article-entry table { + line-height: 1.6em; + margin: 1.6em 0; +} +.article-entry h1, +.article-entry h2, +.article-entry h3, +.article-entry h4, +.article-entry h5, +.article-entry h6 { + font-weight: bold; +} +.article-entry h1, +.article-entry h2, +.article-entry h3, +.article-entry h4, +.article-entry h5, +.article-entry h6 { + line-height: 1.1em; + margin: 1.1em 0; +} +.article-entry a { + color: #e32d40; + text-decoration: none; +} +.article-entry a:hover { + text-decoration: underline; +} +.article-entry ul, +.article-entry ol, +.article-entry dl { + margin-top: 1.6em; + margin-bottom: 1.6em; +} +.article-entry img, +.article-entry video { + max-width: 100%; + height: auto; + display: block; + margin: auto; +} +.article-entry iframe { + border: none; +} +.article-entry table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; +} +.article-entry th { + font-weight: bold; + border-bottom: 3px solid #ddd; + padding-bottom: 0.5em; +} +.article-entry td { + border-bottom: 1px solid #ddd; + padding: 10px 0; +} +.article-entry blockquote { + font-family: "Droid Serif", Georgia, Serif; + margin: 1.6em 0; + padding: 0 0.8em; + border-left: 4px solid #ddd; + color: #777; +} +.article-entry blockquote footer { + font-size: 14px; + margin: 1.6em 0; + font-family: "寰蒋闆呴粦", "Microsoft Yahei", "Droid Sans", Helvetica Neue, Helvetica, Arial, sans-serif; +} +.article-entry blockquote footer cite:before { + content: "鈥�"; + padding: 0 0.5em; +} +.article-entry .pullquote { + text-align: left; + width: 45%; + margin: 0; +} +.article-entry .pullquote.left { + margin-left: 0.5em; + margin-right: 1em; +} +.article-entry .pullquote.right { + margin-right: 0.5em; + margin-left: 1em; +} +.article-entry .caption { + color: #999; + display: block; + font-size: 0.9em; + margin-top: 0.5em; + position: relative; + text-align: center; +} +.article-entry .video-container { + position: relative; + padding-top: 56.25%; + height: 0; + overflow: hidden; +} +.article-entry .video-container iframe, +.article-entry .video-container object, +.article-entry .video-container embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + margin-top: 0; +} +.article-more-link a { + display: inline-block; + line-height: 1em; + padding: 6px 15px; + -webkit-border-radius: 15px; + border-radius: 15px; + background: #eee; + color: #999; + text-shadow: 0 1px #fff; + text-decoration: none; +} +.article-more-link a:hover { + background: #e32d40; + color: #fff; + text-decoration: none; + text-shadow: 0 1px #c01a2b; +} +.article-footer { + zoom: 1; + font-size: 0.85em; + line-height: 1.6em; + border-top: 2px solid #ddd; + padding-top: 1.6em; + margin: 0 20px 20px; +} +.article-footer:before, +.article-footer:after { + content: ""; + display: table; +} +.article-footer:after { + clear: both; +} +.article-footer a { + color: #999; + text-decoration: none; +} +.article-footer a:hover { + color: #000; +} +.article-tag-list-item { + float: left; + margin-right: 10px; +} +.article-tag-list-link:before { + content: "#"; +} +.article-comment-link { + float: right; +} +.article-comment-link:before { + content: "\f075"; + font-family: FontAwesome; + padding-right: 8px; +} +.article-share-link { + cursor: pointer; + float: right; + margin-left: 20px; +} +.article-share-link:before { + content: "\f064"; + font-family: FontAwesome; + padding-right: 6px; +} +#article-nav { + zoom: 1; + position: relative; +} +#article-nav:before, +#article-nav:after { + content: ""; + display: table; +} +#article-nav:after { + clear: both; +} +@media screen and (min-width: 768px) { + #article-nav { + margin: 50px 0; + } + #article-nav:before { + width: 8px; + height: 8px; + position: absolute; + top: 50%; + left: 50%; + margin-top: -4px; + margin-left: -4px; + content: ""; + -webkit-border-radius: 50%; + border-radius: 50%; + background: #ddd; + -webkit-box-shadow: 0 1px 2px #fff; + box-shadow: 0 1px 2px #fff; + } +} +.article-nav-link-wrap { + text-decoration: none; + text-shadow: 0 1px #fff; + color: #999; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin-top: 50px; + text-align: center; + display: block; +} +.article-nav-link-wrap:hover { + color: #000; +} +@media screen and (min-width: 768px) { + .article-nav-link-wrap { + width: 50%; + margin-top: 0; + } +} +@media screen and (min-width: 768px) { + #article-nav-newer { + float: left; + text-align: right; + padding-right: 20px; + } +} +@media screen and (min-width: 768px) { + #article-nav-older { + float: right; + text-align: left; + padding-left: 20px; + } +} +.article-nav-caption { + text-transform: uppercase; + letter-spacing: 2px; + color: #ddd; + line-height: 1em; + font-weight: bold; +} +#article-nav-newer .article-nav-caption { + margin-right: -2px; +} +.article-nav-title { + font-size: 0.85em; + line-height: 1.6em; + margin-top: 0.5em; +} +.article-share-box { + position: absolute; + display: none; + background: #fff; + -webkit-box-shadow: 1px 2px 10px rgba(0,0,0,0.2); + box-shadow: 1px 2px 10px rgba(0,0,0,0.2); + -webkit-border-radius: 3px; + border-radius: 3px; + margin-left: -145px; + overflow: hidden; + z-index: 1; +} +.article-share-box.on { + display: block; +} +.article-share-input { + width: 100%; + background: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + font: 14px "寰蒋闆呴粦", "Microsoft Yahei", "Droid Sans", Helvetica Neue, Helvetica, Arial, sans-serif; + padding: 0 15px; + color: #000; + outline: none; + border: 1px solid #ddd; + -webkit-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; + height: 36px; + line-height: 36px; +} +.article-share-links { + zoom: 1; + background: #eee; +} +.article-share-links:before, +.article-share-links:after { + content: ""; + display: table; +} +.article-share-links:after { + clear: both; +} +.article-share-twitter, +.article-share-facebook, +.article-share-pinterest, +.article-share-google { + width: 50px; + height: 36px; + display: block; + float: left; + position: relative; + color: #999; + text-shadow: 0 1px #fff; +} +.article-share-twitter:before, +.article-share-facebook:before, +.article-share-pinterest:before, +.article-share-google:before { + font-size: 20px; + font-family: FontAwesome; + width: 20px; + height: 20px; + position: absolute; + top: 50%; + left: 50%; + margin-top: -10px; + margin-left: -10px; + text-align: center; +} +.article-share-twitter:hover, +.article-share-facebook:hover, +.article-share-pinterest:hover, +.article-share-google:hover { + color: #fff; +} +.article-share-twitter:before { + content: "\f099"; +} +.article-share-twitter:hover { + background: #00aced; + text-shadow: 0 1px #008abe; +} +.article-share-facebook:before { + content: "\f09a"; +} +.article-share-facebook:hover { + background: #3b5998; + text-shadow: 0 1px #2f477a; +} +.article-share-pinterest:before { + content: "\f0d2"; +} +.article-share-pinterest:hover { + background: #cb2027; + text-shadow: 0 1px #a21a1f; +} +.article-share-google:before { + content: "\f0d5"; +} +.article-share-google:hover { + background: #dd4b39; + text-shadow: 0 1px #be3221; +} +.article-gallery { + background: #000; + position: relative; +} +.article-gallery-photos { + position: relative; + overflow: hidden; +} +.article-gallery-img { + display: none; + max-width: 100%; +} +.article-gallery-img:first-child { + display: block; +} +.article-gallery-img.loaded { + position: absolute; + display: block; +} +.article-gallery-img img { + display: block; + max-width: 100%; + margin: 0 auto; +} +.copyright { + display: block; + padding: 10px 20px; + margin: auto; + line-height: 24px; + font-size: 14px; +} +.copyright a { + color: #e32d40; + text-decoration: none; +} +.copyright a:hover { + text-decoration: underline; +} +#comments { + background: #fff; + -webkit-box-shadow: 1px 2px 3px #ddd; + box-shadow: 1px 2px 3px #ddd; + padding: 20px; + border: 1px solid #ddd; + -webkit-border-radius: 3px; + border-radius: 3px; + margin: 50px 0; +} +#comments a { + color: #e32d40; +} +.archives-wrap { + margin: 50px 0; +} +.archives { + zoom: 1; +} +.archives:before, +.archives:after { + content: ""; + display: table; +} +.archives:after { + clear: both; +} +.archive-year-wrap { + margin-bottom: 1em; + line-height: 1em; +} +.archives { + -webkit-column-gap: 10px; + -moz-column-gap: 10px; + column-gap: 10px; +} +@media screen and (min-width: 480px) and (max-width: 767px) { + .archives { + -webkit-column-count: 2; + -moz-column-count: 2; + column-count: 2; + } +} +@media screen and (min-width: 768px) { + .archives { + -webkit-column-count: 3; + -moz-column-count: 3; + column-count: 3; + } +} +.archive-article { + -webkit-column-break-inside: avoid; + page-break-inside: avoid; + overflow: hidden; + break-inside: avoid-column; +} +.archive-article-inner { + padding: 10px; + margin-bottom: 15px; +} +.archive-article-title { + text-decoration: none; + font-weight: bold; + color: #000; + -webkit-transition: color 0.2s; + -moz-transition: color 0.2s; + -o-transition: color 0.2s; + -ms-transition: color 0.2s; + transition: color 0.2s; + line-height: 1.6em; +} +.archive-article-title:hover { + color: #e32d40; +} +.archive-article-footer { + margin-top: 1em; +} +.archive-article-date { + color: #999; + text-decoration: none; + font-size: 0.85em; + line-height: 1em; + margin-bottom: 0.5em; + display: block; +} +#page-nav { + zoom: 1; + margin: 50px auto; + background: #fff; + -webkit-box-shadow: 1px 2px 3px #ddd; + box-shadow: 1px 2px 3px #ddd; + border: 1px solid #ddd; + -webkit-border-radius: 3px; + border-radius: 3px; + text-align: center; + color: #999; + overflow: hidden; +} +#page-nav:before, +#page-nav:after { + content: ""; + display: table; +} +#page-nav:after { + clear: both; +} +#page-nav a, +#page-nav span { + padding: 10px 20px; +} +#page-nav a { + color: #999; + text-decoration: none; +} +#page-nav a:hover { + background: #999; + color: #fff; +} +#page-nav .prev { + float: left; +} +#page-nav .next { + float: right; +} +#page-nav .page-number { + display: inline-block; +} +@media screen and (max-width: 479px) { + #page-nav .page-number { + display: none; + } +} +#page-nav .current { + color: #000; + font-weight: bold; +} +#page-nav .space { + color: #ddd; +} +#footer { + background: #262a30; + padding: 50px 0; + border-top: 1px solid #ddd; + color: #999; +} +#footer a { + color: #e32d40; + text-decoration: none; +} +#footer a:hover { + text-decoration: underline; +} +#footer-info { + line-height: 1.6em; + font-size: 0.85em; +} +.article-entry pre, +.article-entry .highlight { + background: #272822; + margin: 0 -20px; + padding: 15px 20px; + border-style: solid; + border-color: #ddd; + border-width: 1px 0; + overflow: auto; + color: #f8f8f2; + line-height: 22.400000000000002px; +} +.article-entry .highlight .gutter pre, +.article-entry .gist .gist-file .gist-data .line-numbers { + color: #666; + font-size: 0.85em; +} +.article-entry pre, +.article-entry code { + font-family: "Source Code Pro", Consolas, Monaco, Menlo, Consolas, monospace; +} +.article-entry code { + background: #f0f0f0; + text-shadow: 0 1px #fff; + font-size: 0.85em; + padding: 0 0.3em; + border: 1px solid #dcdcdc; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.article-entry pre code { + background: none; + text-shadow: none; + padding: 0; + border: none; +} +.article-entry .highlight pre { + border: none; + margin: 0; + padding: 0; +} +.article-entry .highlight table { + margin: 0; + width: auto; +} +.article-entry .highlight td { + border: none; + padding: 0; +} +.article-entry .highlight figcaption { + zoom: 1; + font-size: 0.85em; + color: #75715e; + line-height: 1em; + margin-bottom: 1em; +} +.article-entry .highlight figcaption:before, +.article-entry .highlight figcaption:after { + content: ""; + display: table; +} +.article-entry .highlight figcaption:after { + clear: both; +} +.article-entry .highlight figcaption a { + float: right; +} +.article-entry .highlight .gutter pre { + text-align: right; + padding-right: 20px; +} +.article-entry .highlight .line { + height: 22.400000000000002px; +} +.article-entry .gist { + margin: 0 -20px; + border-style: solid; + border-color: #ddd; + border-width: 1px 0; + background: #272822; + padding: 15px 20px 15px 0; +} +.article-entry .gist .gist-file { + border: none; + font-family: "Source Code Pro", Consolas, Monaco, Menlo, Consolas, monospace; + margin: 0; +} +.article-entry .gist .gist-file .gist-data { + background: none; + border: none; +} +.article-entry .gist .gist-file .gist-data .line-numbers { + background: none; + border: none; + padding: 0 20px 0 0; +} +.article-entry .gist .gist-file .gist-data .line-data { + padding: 0 !important; +} +.article-entry .gist .gist-file .highlight { + margin: 0; + padding: 0; + border: none; +} +.article-entry .gist .gist-file .gist-meta { + background: #272822; + color: #75715e; + font: 0.85em "寰蒋闆呴粦", "Microsoft Yahei", "Droid Sans", Helvetica Neue, Helvetica, Arial, sans-serif; + text-shadow: 0 0; + padding: 0; + margin-top: 1em; + margin-left: 20px; +} +.article-entry .gist .gist-file .gist-meta a { + color: #e32d40; + font-weight: normal; +} +.article-entry .gist .gist-file .gist-meta a:hover { + text-decoration: underline; +} +pre .comment, +pre .preprocessor { + color: #75715e; +} +pre .tag { + color: #f8f8f2; +} +pre .title, +pre .variable, +pre .regexp, +pre .ruby .constant, +pre .xml .tag .title, +pre .xml .pi, +pre .xml .doctype, +pre .html .doctype, +pre .css .id, +pre .css .class, +pre .css .pseudo { + color: #f92672; +} +pre .number, +pre .built_in, +pre .literal, +pre .constant { + color: #ae81ff; +} +pre .params { + color: #fd971f; +} +pre .class, +pre .ruby .class .title, +pre .css .rules .attribute, +pre .attribute { + color: #a6e22e; +} +pre .string, +pre .value, +pre .inheritance, +pre .header, +pre .ruby .symbol, +pre .xml .cdata { + color: #e6db74; +} +pre .css .hexcolor { + color: #a1efe4; +} +pre .function, +pre .python .decorator, +pre .python .title, +pre .ruby .function .title, +pre .ruby .title .keyword, +pre .perl .sub, +pre .javascript .title, +pre .coffeescript .title { + color: #66d9ef; +} +pre .keyword, +pre .javascript .function { + color: #66d9ef; +} +@media screen and (max-width: 479px) { + #mobile-nav { + position: absolute; + top: 0; + left: 0; + width: 280px; + height: 100%; + background: #191919; + border-right: 1px solid #fff; + } +} +@media screen and (max-width: 479px) { + .mobile-nav-link { + display: block; + color: #999; + text-decoration: none; + padding: 15px 20px; + font-weight: bold; + } + .mobile-nav-link:hover { + color: #fff; + } +} +@media screen and (min-width: 768px) { + #sidebar { + display: inline; + float: left; + width: 23.3333333333333%; + margin: 0 0.8333333333333%; + } +} +.widget-wrap { + margin: 50px 0; +} +.widget { + color: #777; + text-shadow: 0 1px #fff; + background: #fff; + -webkit-box-shadow: 1px 2px 3px #ddd; + box-shadow: 1px 2px 3px #ddd; + padding: 15px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.widget a { + color: #999; + text-decoration: none; +} +.widget a:hover { + text-decoration: underline; + color: #e32d40; +} +.widget ul ul, +.widget ol ul, +.widget dl ul, +.widget ul ol, +.widget ol ol, +.widget dl ol, +.widget ul dl, +.widget ol dl, +.widget dl dl { + margin-left: 15px; + list-style: disc; +} +.widget { + line-height: 1.6em; + word-wrap: break-word; + font-size: 0.9em; +} +.widget ul, +.widget ol { + list-style: none; + margin: 0; +} +.widget ul ul, +.widget ol ul, +.widget ul ol, +.widget ol ol { + margin: 0 20px; +} +.widget ul ul, +.widget ol ul { + list-style: disc; +} +.widget ul ol, +.widget ol ol { + list-style: decimal; +} +.category-list-count, +.tag-list-count, +.archive-list-count { + padding-left: 5px; + color: #999; + font-size: 0.85em; +} +.category-list-count:before, +.tag-list-count:before, +.archive-list-count:before { + content: "("; +} +.category-list-count:after, +.tag-list-count:after, +.archive-list-count:after { + content: ")"; +} +.tagcloud a { + margin-right: 5px; +} \ No newline at end of file diff --git a/4_blog/templates/base.html b/4_blog/templates/base.html new file mode 100644 index 0000000..191f52b --- /dev/null +++ b/4_blog/templates/base.html @@ -0,0 +1,57 @@ + + + + + + + {% block title %}{% endblock %} + + + + + {% block headerjs %} + + {% endblock %} + + +
+
+ {% include 'header.html' %} + +
+ {% block left %} + + {% endblock %} + + {% include 'right.html' %} + +
+ + {% include 'footer.html' %} + +
+
+ + + + \ No newline at end of file diff --git a/4_blog/templates/footer.html b/4_blog/templates/footer.html new file mode 100644 index 0000000..6cb7efd --- /dev/null +++ b/4_blog/templates/footer.html @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/4_blog/templates/header.html b/4_blog/templates/header.html new file mode 100644 index 0000000..84de0fe --- /dev/null +++ b/4_blog/templates/header.html @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/4_blog/templates/right.html b/4_blog/templates/right.html new file mode 100644 index 0000000..0290aeb --- /dev/null +++ b/4_blog/templates/right.html @@ -0,0 +1,109 @@ + \ No newline at end of file