├── .gitattributes ├── .gitignore ├── MyBlog ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py ├── README.md ├── apps ├── __init__.py ├── articles │ ├── __init__.py │ ├── admin.py │ ├── adminx.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20180921_1157.py │ │ ├── 0003_category_is_tab.py │ │ ├── 0004_category_title.py │ │ ├── 0005_category_path_name.py │ │ ├── 0006_articleinfo_is_recommend.py │ │ ├── 0007_auto_20180922_0123.py │ │ ├── 0008_auto_20180922_0124.py │ │ ├── 0009_auto_20180922_0125.py │ │ ├── 0010_taginfo_category.py │ │ ├── 0011_auto_20181213_1921.py │ │ ├── 0012_auto_20190825_1730.py │ │ ├── 0013_auto_20190825_1746.py │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── operations │ ├── __init__.py │ ├── admin.py │ ├── adminx.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ └── views.py └── users │ ├── __init__.py │ ├── admin.py │ ├── adminx.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ ├── 0001_initial.py │ ├── 0002_verifycodeemail.py │ ├── 0003_userprofile_is_start.py │ └── __init__.py │ ├── models.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── config ├── default5.jpg ├── default6.jpg ├── default7.jpg ├── default8.jpg ├── default9.jpg ├── guli_nginx.conf └── uwsgi.ini ├── extra_apps ├── DjangoUeditor │ ├── __init__.py │ ├── adminx.py │ ├── commands.py │ ├── forms.py │ ├── models.py │ ├── settings.py │ ├── templates │ │ ├── ueditor.html │ │ └── ueditor_old.html │ ├── urls.py │ ├── utils.py │ ├── views.py │ └── widgets.py ├── __init__.py └── xadmin │ ├── .tx │ └── config │ ├── __init__.py │ ├── adminx.py │ ├── apps.py │ ├── filters.py │ ├── forms.py │ ├── layout.py │ ├── locale │ ├── de_DE │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── en │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── es_MX │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── eu │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── id_ID │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── ja │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── lt │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── nl_NL │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── pl │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── pt_BR │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ ├── ru_RU │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ ├── django.po │ │ │ ├── djangojs.mo │ │ │ └── djangojs.po │ └── zh_Hans │ │ └── LC_MESSAGES │ │ ├── django.mo │ │ ├── django.po │ │ ├── djangojs.mo │ │ └── djangojs.po │ ├── migrations │ ├── 0001_initial.py │ ├── 0002_log.py │ ├── 0003_auto_20160715_0100.py │ └── __init__.py │ ├── models.py │ ├── plugins │ ├── __init__.py │ ├── actions.py │ ├── aggregation.py │ ├── ajax.py │ ├── auth.py │ ├── batch.py │ ├── bookmark.py │ ├── chart.py │ ├── comments.py │ ├── details.py │ ├── editable.py │ ├── export.py │ ├── filters.py │ ├── images.py │ ├── importexport.py │ ├── inline.py │ ├── language.py │ ├── layout.py │ ├── mobile.py │ ├── multiselect.py │ ├── passwords.py │ ├── portal.py │ ├── quickfilter.py │ ├── quickform.py │ ├── refresh.py │ ├── relate.py │ ├── relfield.py │ ├── sitemenu.py │ ├── sortablelist.py │ ├── themes.py │ ├── topnav.py │ ├── ueditor.py │ ├── utils.py │ ├── wizard.py │ └── xversion.py │ ├── sites.py │ ├── templates │ └── xadmin │ │ ├── 404.html │ │ ├── 500.html │ │ ├── auth │ │ ├── password_reset │ │ │ ├── complete.html │ │ │ ├── confirm.html │ │ │ ├── done.html │ │ │ ├── email.html │ │ │ └── form.html │ │ └── user │ │ │ ├── add_form.html │ │ │ └── change_password.html │ │ ├── base.html │ │ ├── base_site.html │ │ ├── blocks │ │ ├── comm.top.setlang.html │ │ ├── comm.top.theme.html │ │ ├── comm.top.topnav.html │ │ ├── modal_list.left_navbar.quickfilter.html │ │ ├── model_form.before_fieldsets.wizard.html │ │ ├── model_form.submit_line.wizard.html │ │ ├── model_list.nav_form.search_form.html │ │ ├── model_list.nav_menu.bookmarks.html │ │ ├── model_list.nav_menu.filters.html │ │ ├── model_list.results_bottom.actions.html │ │ ├── model_list.results_top.charts.html │ │ ├── model_list.results_top.date_hierarchy.html │ │ ├── model_list.top_toolbar.exports.html │ │ ├── model_list.top_toolbar.importexport.export.html │ │ ├── model_list.top_toolbar.importexport.import.html │ │ ├── model_list.top_toolbar.layouts.html │ │ ├── model_list.top_toolbar.refresh.html │ │ └── model_list.top_toolbar.saveorder.html │ │ ├── edit_inline │ │ ├── accordion.html │ │ ├── base.html │ │ ├── blank.html │ │ ├── one.html │ │ ├── stacked.html │ │ ├── tab.html │ │ └── tabular.html │ │ ├── filters │ │ ├── char.html │ │ ├── checklist.html │ │ ├── date.html │ │ ├── fk_search.html │ │ ├── list.html │ │ ├── number.html │ │ ├── quickfilter.html │ │ └── rel.html │ │ ├── forms │ │ └── transfer.html │ │ ├── grids │ │ └── thumbnails.html │ │ ├── import_export │ │ ├── export_action.html │ │ └── import.html │ │ ├── includes │ │ ├── box.html │ │ ├── pagination.html │ │ ├── sitemenu_accordion.html │ │ ├── sitemenu_default.html │ │ ├── submit_line.html │ │ ├── toggle_back.html │ │ └── toggle_menu.html │ │ ├── layout │ │ ├── field_value.html │ │ ├── field_value_td.html │ │ ├── fieldset.html │ │ ├── input_group.html │ │ └── td-field.html │ │ ├── views │ │ ├── app_index.html │ │ ├── batch_change_form.html │ │ ├── dashboard.html │ │ ├── form.html │ │ ├── invalid_setup.html │ │ ├── logged_out.html │ │ ├── login.html │ │ ├── model_dashboard.html │ │ ├── model_delete_confirm.html │ │ ├── model_delete_selected_confirm.html │ │ ├── model_detail.html │ │ ├── model_form.html │ │ ├── model_history.html │ │ ├── model_list.html │ │ ├── quick_detail.html │ │ ├── quick_form.html │ │ ├── recover_form.html │ │ ├── recover_list.html │ │ ├── revision_diff.html │ │ └── revision_form.html │ │ └── widgets │ │ ├── addform.html │ │ ├── base.html │ │ ├── chart.html │ │ ├── list.html │ │ └── qbutton.html │ ├── templatetags │ ├── __init__.py │ └── xadmin_tags.py │ ├── util.py │ ├── vendors.py │ ├── views │ ├── __init__.py │ ├── base.py │ ├── dashboard.py │ ├── delete.py │ ├── detail.py │ ├── edit.py │ ├── form.py │ ├── list.py │ └── website.py │ └── widgets.py ├── help_tools ├── Helper.py ├── __init__.py ├── format_time.py └── send_mail_tools.py ├── manage.py ├── requirement.txt ├── static ├── css │ ├── bootstrap.min.css │ ├── font-awesome.min.css │ ├── normalize.css │ ├── nprogress.css │ ├── reglogin.css │ ├── style.css │ └── test │ │ ├── animate.css │ │ ├── cityLayout.css │ │ ├── dig_close.png │ │ ├── error-img.png │ │ ├── laydate(1).css │ │ ├── laydate.css │ │ ├── layer.css │ │ ├── layer.ext.css │ │ ├── lq.datetimepick.css │ │ ├── reset.css │ │ ├── saved_resource.html │ │ ├── share_style0_16.css │ │ ├── style.css │ │ └── top_down.png ├── fonts │ ├── FontAwesome.otf │ ├── TaurusNormal.svg │ ├── TaurusNormal.ttf │ ├── TaurusNormal.woff │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── images │ ├── 201610181557196870.jpg │ ├── 201610241224221511.jpg │ ├── 201610241227558789.jpg │ ├── Thumbs.db │ ├── ad.jpg │ ├── backtop.png │ ├── default.jpg │ ├── favicon.ico │ ├── loading.gif │ ├── logo.png │ ├── news-icon.png │ ├── occupying.png │ └── timg.jpg ├── js │ ├── bootstrap.min.js │ ├── html5shiv.min.js │ ├── jquery-1.11.1.min.js │ ├── jquery-2.1.4.min.js │ ├── jquery.ias.js │ ├── jquery.lazyload.min.js │ ├── nprogress.js │ ├── respond.min.js │ ├── scripts.js │ └── selectivizr-min.js └── media │ └── article │ ├── default.jpg │ ├── default1.jpg │ ├── default2.jpg │ ├── default3.jpg │ ├── default4.jpg │ └── default5.jpg ├── t.py └── templates ├── .base.html.swp ├── 404.html ├── abc.html ├── base.html ├── center.html ├── detail.html ├── index.html ├── list.html ├── none.html ├── pagenation.html ├── search_list.html ├── te.html ├── user_center.html ├── user_login.html ├── user_register.html └── wait_start.html /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=python 2 | *.css linguist-language=python 3 | *.html linguist-language=python -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.txt 2 | *.pyc 3 | .idea/ 4 | static/ 5 | artfile/ 6 | .doc 7 | MyBlog/settings.py -------------------------------------------------------------------------------- /MyBlog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/MyBlog/__init__.py -------------------------------------------------------------------------------- /MyBlog/urls.py: -------------------------------------------------------------------------------- 1 | """MyBlog URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.11/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.conf.urls import url, include 14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 15 | """ 16 | from django.conf.urls import url,include 17 | from users.views import index,search,user_active,page_not_found 18 | from articles.views import list_detail,article_detail 19 | from operations.views import user_comment,add_Marticle 20 | import xadmin 21 | urlpatterns = [ 22 | url(r'^$',index,name='index'), 23 | url(r'^ueditor/',include('DjangoUeditor.urls')), 24 | url(r'^mysite/',xadmin.site.urls), 25 | url(r'^user/',include('users.urls')), 26 | url(r'^list/(\w+)/$',list_detail,name='list'), 27 | url(r'^detail/(\d+)/$',article_detail,name='detail'), 28 | url(r'^search/$',search,name='search'), 29 | url(r'^user_active/(\w+)/$',user_active,name='user_active'), 30 | url(r'^user_comment/(\d+)/$',user_comment,name='user_comment'), 31 | # url(r'^add_article/$', add_Marticle, name='add_article') 32 | ] 33 | handler404 = page_not_found #改动2 -------------------------------------------------------------------------------- /MyBlog/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for MyBlog project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MyBlog.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DjangoBlog 2 | 3 | ## 注意点: 4 | ### 1、搭建请加我微信告知 wx:wu_wron。 5 | ### 2、搭建请保留页面友情链接及版权。 6 | ### 3、搭建请点击右上角star,谢谢! 7 | ### 4、如不遵守,你会涉及侵权哦! 8 | ## 主要功能: 9 | 10 | 1、博客文章自动定时发布! 11 | 2、博客文章详情页,实现实时聊天! 12 | 3、博客各模块,不断完善中,谢谢star! 13 | - 详见博客 14 | 15 | 博客地址:http://www.debug5.com 16 | -------------------------------------------------------------------------------- /apps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/apps/__init__.py -------------------------------------------------------------------------------- /apps/articles/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/apps/articles/__init__.py -------------------------------------------------------------------------------- /apps/articles/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /apps/articles/adminx.py: -------------------------------------------------------------------------------- 1 | import xadmin 2 | from articles.models import TagInfo, ArticleInfo 3 | 4 | 5 | class TagInfoXadmin(object): 6 | list_display = ['name', 'category','add_time'] 7 | list_filter = ['category'] 8 | 9 | # class ArtTagXadmin(object): 10 | # list_display = ['articleinfo', 'taginfo', 'add_time'] 11 | 12 | 13 | class ArticleInfoXadmin(object): 14 | list_display = ['title', 'click_num', 'cont_num', 'author', 'category','taginfo','image', 'add_time'] 15 | style_fields = {'content': 'ueditor'} 16 | search_fields = ['title'] 17 | list_editable = ['taginfo','category','image'] 18 | # 添加附加选项表 19 | # class ArtTagInlines(object): 20 | # model = ArtTag 21 | # style = 'tab' 22 | # # exclude=['add_time'] 23 | # extra = 2 24 | # 25 | # inlines = [ArtTagInlines] 26 | 27 | 28 | xadmin.site.register(TagInfo, TagInfoXadmin) 29 | # xadmin.site.register(ArtTag, ArtTagXadmin) 30 | xadmin.site.register(ArticleInfo, ArticleInfoXadmin) 31 | -------------------------------------------------------------------------------- /apps/articles/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ArticlesConfig(AppConfig): 5 | name = 'articles' 6 | verbose_name='文章模块' -------------------------------------------------------------------------------- /apps/articles/migrations/0002_auto_20180921_1157.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-21 11:57 3 | from __future__ import unicode_literals 4 | 5 | from django.conf import settings 6 | from django.db import migrations, models 7 | import django.db.models.deletion 8 | 9 | 10 | class Migration(migrations.Migration): 11 | 12 | initial = True 13 | 14 | dependencies = [ 15 | ('articles', '0001_initial'), 16 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 17 | ] 18 | 19 | operations = [ 20 | migrations.AddField( 21 | model_name='commentinfo', 22 | name='comment_man', 23 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='评论者'), 24 | ), 25 | migrations.AddField( 26 | model_name='arttag', 27 | name='articleinfo', 28 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='articles.ArticleInfo', verbose_name='所属文章'), 29 | ), 30 | migrations.AddField( 31 | model_name='arttag', 32 | name='taginfo', 33 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='articles.TagInfo', verbose_name='所属标签'), 34 | ), 35 | migrations.AddField( 36 | model_name='articleinfo', 37 | name='author', 38 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='文章作者'), 39 | ), 40 | migrations.AddField( 41 | model_name='articleinfo', 42 | name='category', 43 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='articles.Category', verbose_name='所属类别'), 44 | ), 45 | migrations.AlterUniqueTogether( 46 | name='arttag', 47 | unique_together=set([('articleinfo', 'taginfo')]), 48 | ), 49 | ] 50 | -------------------------------------------------------------------------------- /apps/articles/migrations/0003_category_is_tab.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-21 14:46 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('articles', '0002_auto_20180921_1157'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='category', 17 | name='is_tab', 18 | field=models.BooleanField(default=True, verbose_name='是否导航'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/articles/migrations/0004_category_title.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-21 15:29 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('articles', '0003_category_is_tab'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='category', 17 | name='title', 18 | field=models.CharField(blank=True, max_length=50, null=True, verbose_name='类别标题'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/articles/migrations/0005_category_path_name.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-21 16:21 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('articles', '0004_category_title'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='category', 17 | name='path_name', 18 | field=models.CharField(blank=True, max_length=15, null=True, verbose_name='路径别名'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/articles/migrations/0006_articleinfo_is_recommend.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-21 18:38 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('articles', '0005_category_path_name'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='articleinfo', 17 | name='is_recommend', 18 | field=models.BooleanField(default=False, verbose_name='首页推荐'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/articles/migrations/0007_auto_20180922_0123.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-22 01:23 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('articles', '0006_articleinfo_is_recommend'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='articleinfo', 17 | name='image', 18 | field=models.ImageField(default='article/default.jpg', max_length=200, upload_to='article/%y/%m/%d', verbose_name='封面'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/articles/migrations/0008_auto_20180922_0124.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-22 01:24 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('articles', '0007_auto_20180922_0123'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='articleinfo', 17 | name='image', 18 | field=models.ImageField(max_length=200, upload_to='article/%y/%m/%d', verbose_name='封面'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/articles/migrations/0009_auto_20180922_0125.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-22 01:25 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('articles', '0008_auto_20180922_0124'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='articleinfo', 17 | name='image', 18 | field=models.ImageField(blank=True, max_length=200, null=True, upload_to='article/%y/%m/%d', verbose_name='封面'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/articles/migrations/0010_taginfo_category.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-22 10:47 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('articles', '0009_auto_20180922_0125'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AddField( 17 | model_name='taginfo', 18 | name='category', 19 | field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='articles.Category', verbose_name='所属类别'), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /apps/articles/migrations/0011_auto_20181213_1921.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-12-13 19:21 3 | from __future__ import unicode_literals 4 | 5 | import DjangoUeditor.models 6 | from django.db import migrations 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('articles', '0010_taginfo_category'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name='articleinfo', 18 | name='content', 19 | field=DjangoUeditor.models.UEditorField(default='', verbose_name='文章内容'), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /apps/articles/migrations/0012_auto_20190825_1730.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2019-08-25 17:30 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('articles', '0011_auto_20181213_1921'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AddField( 17 | model_name='articleinfo', 18 | name='taginfo', 19 | field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='articles.TagInfo', verbose_name='所属标签'), 20 | ), 21 | migrations.AlterField( 22 | model_name='articleinfo', 23 | name='image', 24 | field=models.ImageField(blank=True, default='article/default1.jpg', max_length=200, null=True, upload_to='article/%y/%m/%d', verbose_name='封面'), 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /apps/articles/migrations/0013_auto_20190825_1746.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2019-08-25 17:46 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('articles', '0012_auto_20190825_1730'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterUniqueTogether( 16 | name='arttag', 17 | unique_together=set([]), 18 | ), 19 | migrations.RemoveField( 20 | model_name='arttag', 21 | name='articleinfo', 22 | ), 23 | migrations.RemoveField( 24 | model_name='arttag', 25 | name='taginfo', 26 | ), 27 | migrations.AlterField( 28 | model_name='articleinfo', 29 | name='image', 30 | field=models.ImageField(blank=True, default='article/default5.jpg', max_length=200, null=True, upload_to='article/%y/%m/%d', verbose_name='封面'), 31 | ), 32 | migrations.DeleteModel( 33 | name='ArtTag', 34 | ), 35 | ] 36 | -------------------------------------------------------------------------------- /apps/articles/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/apps/articles/migrations/__init__.py -------------------------------------------------------------------------------- /apps/articles/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /apps/articles/urls.py: -------------------------------------------------------------------------------- 1 | """MyBlog URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.11/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.conf.urls import url, include 14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 15 | """ 16 | from django.conf.urls import url 17 | urlpatterns = [ 18 | 19 | ] 20 | -------------------------------------------------------------------------------- /apps/operations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/apps/operations/__init__.py -------------------------------------------------------------------------------- /apps/operations/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /apps/operations/adminx.py: -------------------------------------------------------------------------------- 1 | import xadmin 2 | from operations.models import UserComment 3 | 4 | 5 | class UserCommentXadmin(object): 6 | list_display = ['comment_man', 'comment_article', 'add_time'] 7 | 8 | 9 | xadmin.site.register(UserComment, UserCommentXadmin) 10 | -------------------------------------------------------------------------------- /apps/operations/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class OperationsConfig(AppConfig): 5 | name = 'operations' 6 | verbose_name='用户操作' -------------------------------------------------------------------------------- /apps/operations/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | 4 | class UserCommentForm(forms.Form): 5 | # nick_name = forms.CharField(required=True, error_messages={ 6 | # 'required': '内容必填', 7 | # }) 8 | content = forms.CharField(required=True, min_length=5, max_length=200, error_messages={ 9 | 'required': '内容必填', 10 | 'min_length': '最小5个字符', 11 | 'max_length': '内容过长' 12 | }) 13 | -------------------------------------------------------------------------------- /apps/operations/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-22 14:06 3 | from __future__ import unicode_literals 4 | 5 | import datetime 6 | from django.conf import settings 7 | from django.db import migrations, models 8 | import django.db.models.deletion 9 | 10 | 11 | class Migration(migrations.Migration): 12 | 13 | initial = True 14 | 15 | dependencies = [ 16 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 17 | ('articles', '0010_taginfo_category'), 18 | ] 19 | 20 | operations = [ 21 | migrations.CreateModel( 22 | name='UserComment', 23 | fields=[ 24 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 25 | ('content', models.CharField(max_length=300, verbose_name='评论内容')), 26 | ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='评论时间')), 27 | ('comment_article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='articles.ArticleInfo', verbose_name='评论课程')), 28 | ('comment_man', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='评论人')), 29 | ], 30 | options={ 31 | 'verbose_name': '用户评论信息表', 32 | 'verbose_name_plural': '用户评论信息表', 33 | }, 34 | ), 35 | ] 36 | -------------------------------------------------------------------------------- /apps/operations/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/apps/operations/migrations/__init__.py -------------------------------------------------------------------------------- /apps/operations/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from datetime import datetime 3 | # Create your models here. 4 | from articles.models import ArticleInfo 5 | from users.models import UserProfile 6 | 7 | 8 | class UserComment(models.Model): 9 | comment_man = models.ForeignKey(UserProfile, verbose_name="评论人") 10 | comment_article = models.ForeignKey(ArticleInfo, verbose_name="评论课程") 11 | content = models.CharField(max_length=300, verbose_name="评论内容") 12 | add_time = models.DateTimeField(default=datetime.now, verbose_name="评论时间") 13 | 14 | def __str__(self): 15 | return self.comment_man.email 16 | 17 | class Meta: 18 | verbose_name = '用户评论信息表' 19 | verbose_name_plural = verbose_name 20 | -------------------------------------------------------------------------------- /apps/operations/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /apps/users/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/apps/users/__init__.py -------------------------------------------------------------------------------- /apps/users/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /apps/users/adminx.py: -------------------------------------------------------------------------------- 1 | from articles.models import Category 2 | from xadmin.views import BaseAdminView, CommAdminView 3 | import xadmin 4 | 5 | 6 | # class BaseSetting(BaseAdminView): 7 | # pass 8 | 9 | 10 | class ComSetting(object): 11 | site_footer = '博客系统' 12 | site_title = '博客管理系统' 13 | 14 | 15 | xadmin.site.register(CommAdminView, ComSetting) 16 | 17 | 18 | class CategoryXadmin(object): 19 | list_display = ['name', 'add_time'] 20 | 21 | 22 | 23 | 24 | xadmin.site.register(Category, CategoryXadmin) 25 | 26 | -------------------------------------------------------------------------------- /apps/users/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UsersConfig(AppConfig): 5 | name = 'users' 6 | -------------------------------------------------------------------------------- /apps/users/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | 4 | class RegisterForm(forms.Form): 5 | email = forms.EmailField(required=True, error_messages={ 6 | 'required': '邮箱必填' 7 | }) 8 | password = forms.CharField(required=True, error_messages={ 9 | 'required': '密码必填' 10 | }) 11 | nick_name = forms.CharField(required=True, error_messages={ 12 | 'required': '昵称必填' 13 | }) 14 | 15 | 16 | class UserLoginForm(forms.Form): 17 | email = forms.EmailField(required=True, error_messages={ 18 | 'required': '邮箱必须填写', 19 | }) 20 | password = forms.CharField(required=True, error_messages={ 21 | 'required': '密码必须填写', 22 | }) 23 | -------------------------------------------------------------------------------- /apps/users/migrations/0002_verifycodeemail.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-21 23:07 3 | from __future__ import unicode_literals 4 | 5 | import datetime 6 | from django.db import migrations, models 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('users', '0001_initial'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='VerifyCodeEmail', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('email', models.EmailField(max_length=30, verbose_name='用户邮箱')), 21 | ('code', models.CharField(max_length=20, verbose_name='验证码')), 22 | ('code_type', models.CharField(choices=[('1', 'register'), ('2', 'reset'), ('3', 'changeemail'), ('4', 'sendpwd')], max_length=100, verbose_name='验证码类型')), 23 | ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')), 24 | ], 25 | options={ 26 | 'verbose_name': '验证码信息表', 27 | 'verbose_name_plural': '验证码信息表', 28 | }, 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /apps/users/migrations/0003_userprofile_is_start.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11 on 2018-09-21 23:18 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('users', '0002_verifycodeemail'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='userprofile', 17 | name='is_start', 18 | field=models.BooleanField(default=False, verbose_name='是否激活'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/users/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/apps/users/migrations/__init__.py -------------------------------------------------------------------------------- /apps/users/models.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.models import AbstractUser 2 | from datetime import datetime 3 | from django.db import models 4 | 5 | 6 | # Create your models here. 7 | class UserProfile(AbstractUser): 8 | nick_name = models.CharField(max_length=20, verbose_name='用户昵称', null=True, blank=True) 9 | image = models.ImageField(upload_to='user/%y/%m/%d', verbose_name='头像', max_length=200, null=True, blank=True) 10 | add_time = models.DateTimeField(default=datetime.now, verbose_name='添加时间') 11 | is_start = models.BooleanField(default=False, verbose_name='是否激活') 12 | 13 | def __str__(self): 14 | return self.username 15 | 16 | class Meta: 17 | verbose_name = '用户表' 18 | verbose_name_plural = verbose_name 19 | 20 | 21 | class VerifyCodeEmail(models.Model): 22 | email = models.EmailField(max_length=30, verbose_name='用户邮箱') 23 | code = models.CharField(max_length=20, verbose_name='验证码') 24 | code_type = models.CharField(max_length=100, 25 | choices=(('1', 'register'), ('2', 'reset'), ('3', 'changeemail'), ('4', 'sendpwd')), 26 | verbose_name='验证码类型') 27 | add_time = models.DateTimeField(default=datetime.now, verbose_name='添加时间') 28 | 29 | def __str__(self): 30 | return self.code 31 | 32 | class Meta: 33 | verbose_name = '验证码信息表' 34 | verbose_name_plural = verbose_name 35 | -------------------------------------------------------------------------------- /apps/users/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /apps/users/urls.py: -------------------------------------------------------------------------------- 1 | """MyBlog URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.11/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.conf.urls import url, include 14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 15 | """ 16 | from django.conf.urls import url 17 | from .views import user_register,user_login,user_logout,user_center 18 | urlpatterns = [ 19 | url(r'^user_register/$',user_register,name='user_register'), 20 | url(r'^user_login/$',user_login,name='user_login'), 21 | url(r'^user_logout/$',user_logout,name='user_logout'), 22 | url('^user_center/$',user_center,name='user_center') 23 | ] 24 | -------------------------------------------------------------------------------- /config/default5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/config/default5.jpg -------------------------------------------------------------------------------- /config/default6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/config/default6.jpg -------------------------------------------------------------------------------- /config/default7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/config/default7.jpg -------------------------------------------------------------------------------- /config/default8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/config/default8.jpg -------------------------------------------------------------------------------- /config/default9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/config/default9.jpg -------------------------------------------------------------------------------- /config/guli_nginx.conf: -------------------------------------------------------------------------------- 1 | # the upstream component nginx needs to connect to 2 | #user=root; 3 | upstream django { 4 | # server unix:///path/to/your/mysite/mysite.sock; # for a file socket 5 | server 127.0.0.1:8000; # for a web port socket (we'll use this first) 6 | } 7 | # configuration of the server 8 | server { 9 | # the port your site will be served on 10 | listen 80; 11 | # the domain name it will serve for 12 | server_name www.debug5.com debug5.com; # substitute your machine's IP address or FQDN 13 | charset utf-8; 14 | 15 | # max upload size 16 | client_max_body_size 75M; # adjust to taste 17 | 18 | # Django media 19 | location /media { 20 | alias /home/myblog/static/media; # your Django project's media files - amend as required 21 | } 22 | 23 | location /static { 24 | alias /home/myblog/static; # your Django project's static files - amend as required 25 | } 26 | 27 | # Finally, send all non-media requests to the Django server. 28 | location / { 29 | uwsgi_pass django; 30 | include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed 31 | } 32 | } -------------------------------------------------------------------------------- /config/uwsgi.ini: -------------------------------------------------------------------------------- 1 | # mysite_uwsgi.ini file 2 | [uwsgi] 3 | 4 | # Django-related settings 5 | # the base directory (full path) 6 | chdir =/home/myblog/ 7 | # Django's wsgi file 8 | module = MyBlog.wsgi 9 | # the virtualenv (full path) 10 | 11 | # process-related settings 12 | # master 13 | master = true 14 | # maximum number of worker processes 15 | processes = 10 16 | # the socket (use the full path to be safe 17 | socket = :8000 18 | # ... with appropriate permissions - may be needed 19 | # chmod-socket = 664 20 | # clear environment on exit 21 | vacuum = true 22 | virtualenv = /root/Envs/debug 23 | 24 | logto = /tmp/mylog.log 25 | -------------------------------------------------------------------------------- /extra_apps/DjangoUeditor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/DjangoUeditor/__init__.py -------------------------------------------------------------------------------- /extra_apps/DjangoUeditor/adminx.py: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | #__author__ = 'sai' 3 | #DjangoUeditor Xadmin plugin 4 | 5 | import xadmin 6 | from django.db.models import TextField 7 | from xadmin.views import BaseAdminPlugin, ModelFormAdminView, DetailAdminView 8 | from DjangoUeditor.models import UEditorField 9 | from DjangoUeditor.widgets import UEditorWidget 10 | from django.conf import settings 11 | 12 | class XadminUEditorWidget(UEditorWidget): 13 | def __init__(self,**kwargs): 14 | self.ueditor_settings=kwargs 15 | self.Media.js = None 16 | super(XadminUEditorWidget, self).__init__(kwargs) 17 | 18 | class UeditorPlugin(BaseAdminPlugin): 19 | 20 | def get_field_style(self, attrs, db_field, style, **kwargs): 21 | if style == 'ueditor': 22 | if isinstance(db_field, UEditorField): 23 | return {'widget': XadminUEditorWidget(**db_field.formfield().widget.attrs)} 24 | if isinstance(db_field, TextField): 25 | return {'widget': XadminUEditorWidget} 26 | return attrs 27 | 28 | def block_extrahead(self, context, nodes): 29 | js = '' % (settings.STATIC_URL + "ueditor/ueditor.config.js") 30 | js += '' % (settings.STATIC_URL + "ueditor/ueditor.all.min.js") 31 | nodes.append(js) 32 | 33 | xadmin.site.register_plugin(UeditorPlugin, DetailAdminView) 34 | xadmin.site.register_plugin(UeditorPlugin, ModelFormAdminView) 35 | -------------------------------------------------------------------------------- /extra_apps/DjangoUeditor/forms.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from django import forms 3 | from widgets import UEditorWidget 4 | from DjangoUeditor.models import UEditorField as ModelUEditorField 5 | 6 | 7 | class UEditorField(forms.CharField): 8 | def __init__(self, label, width=600, height=300, toolbars="full", 9 | imagePath="", filePath="", upload_settings={}, 10 | settings={}, command=None, event_handler=None, *args, 11 | **kwargs): 12 | uSettings = locals().copy() 13 | del uSettings["self"], uSettings[ 14 | "label"], uSettings["args"], uSettings["kwargs"] 15 | kwargs["widget"] = UEditorWidget(attrs=uSettings) 16 | kwargs["label"] = label 17 | super(UEditorField, self).__init__(*args, **kwargs) 18 | 19 | 20 | def UpdateUploadPath(model_form, model_inst=None): 21 | """ 遍历model字段,如果是UEditorField则需要重新计算路径 """ 22 | if model_inst is not None: 23 | try: 24 | for field in model_inst._meta.fields: 25 | if isinstance(field, ModelUEditorField): 26 | model_form.__getitem__( 27 | field.name).field.widget.recalc_path(model_inst) 28 | except: 29 | pass 30 | 31 | 32 | class UEditorModelForm(forms.ModelForm): 33 | 34 | def __init__(self, *args, **kwargs): 35 | super(UEditorModelForm, self).__init__(*args, **kwargs) 36 | try: 37 | if 'instance' in kwargs: 38 | UpdateUploadPath(self, kwargs["instance"]) 39 | else: 40 | UpdateUploadPath(self, None) 41 | except Exception: 42 | pass 43 | -------------------------------------------------------------------------------- /extra_apps/DjangoUeditor/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from django.db import models 3 | from django.contrib.admin import widgets as admin_widgets 4 | from .widgets import UEditorWidget, AdminUEditorWidget 5 | 6 | 7 | class UEditorField(models.TextField): 8 | """ 9 | 百度HTML编辑器字段,初始化时,可以提供以下参数 10 | initial:初始内容 11 | toolbars:提供工具按钮列表,取值为列表,如['bold', 'italic'],取值为:mini,normal,full,代表小,一般,全部 12 | imagePath:图片上传的路径,如"images/",实现上传到"{{MEDIA_ROOT}}/images"文件夹 13 | filePath:附件上传的路径,如"files/",实现上传到"{{MEDIA_ROOT}}/files"文件夹 14 | """ 15 | 16 | def __init__(self, verbose_name=None, width=600, height=300, 17 | toolbars="full", imagePath="", filePath="", 18 | upload_settings={}, settings={}, command=None, 19 | event_handler=None, **kwargs): 20 | self.ueditor_settings = locals().copy() 21 | kwargs["verbose_name"] = verbose_name 22 | del self.ueditor_settings["self"], self.ueditor_settings[ 23 | "kwargs"], self.ueditor_settings["verbose_name"] 24 | super(UEditorField, self).__init__(**kwargs) 25 | 26 | def formfield(self, **kwargs): 27 | defaults = {'widget': UEditorWidget(attrs=self.ueditor_settings)} 28 | defaults.update(kwargs) 29 | if defaults['widget'] == admin_widgets.AdminTextareaWidget: 30 | defaults['widget'] = AdminUEditorWidget( 31 | attrs=self.ueditor_settings) 32 | return super(UEditorField, self).formfield(**defaults) 33 | 34 | 35 | # 以下支持south 36 | try: 37 | from south.modelsinspector import add_introspection_rules 38 | add_introspection_rules([], ["^DjangoUeditor\.models\.UEditorField"]) 39 | except: 40 | pass 41 | -------------------------------------------------------------------------------- /extra_apps/DjangoUeditor/templates/ueditor.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /extra_apps/DjangoUeditor/templates/ueditor_old.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /extra_apps/DjangoUeditor/urls.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import django 3 | from .views import get_ueditor_controller 4 | 5 | DJANGO_VERSION = django.VERSION[:2] 6 | 7 | 8 | if DJANGO_VERSION >= (1, 8): 9 | from django.conf.urls import url 10 | urlpatterns = [ 11 | url(r'^controller/$', get_ueditor_controller) 12 | ] 13 | 14 | else: 15 | try: 16 | from django.conf.urls import patterns, url 17 | except ImportError: 18 | from django.conf.urls.defaults import patterns, url 19 | 20 | urlpatterns = patterns('', 21 | url(r'^controller/$', get_ueditor_controller) 22 | ) 23 | -------------------------------------------------------------------------------- /extra_apps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/__init__.py -------------------------------------------------------------------------------- /extra_apps/xadmin/.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [xadmin-core.django] 5 | file_filter = locale//LC_MESSAGES/django.po 6 | source_file = locale/en/LC_MESSAGES/django.po 7 | source_lang = en 8 | type = PO 9 | 10 | [xadmin-core.djangojs] 11 | file_filter = locale//LC_MESSAGES/djangojs.po 12 | source_file = locale/en/LC_MESSAGES/djangojs.po 13 | source_lang = en 14 | type = PO -------------------------------------------------------------------------------- /extra_apps/xadmin/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | VERSION = (0,6,0) 3 | 4 | from xadmin.sites import AdminSite, site 5 | 6 | class Settings(object): 7 | pass 8 | 9 | 10 | def autodiscover(): 11 | """ 12 | Auto-discover INSTALLED_APPS admin.py modules and fail silently when 13 | not present. This forces an import on them to register any admin bits they 14 | may want. 15 | """ 16 | 17 | from importlib import import_module 18 | from django.conf import settings 19 | from django.utils.module_loading import module_has_submodule 20 | from django.apps import apps 21 | 22 | setattr(settings, 'CRISPY_TEMPLATE_PACK', 'bootstrap3') 23 | setattr(settings, 'CRISPY_CLASS_CONVERTERS', { 24 | "textinput": "textinput textInput form-control", 25 | "fileinput": "fileinput fileUpload form-control", 26 | "passwordinput": "textinput textInput form-control", 27 | }) 28 | 29 | from xadmin.views import register_builtin_views 30 | register_builtin_views(site) 31 | 32 | # load xadmin settings from XADMIN_CONF module 33 | try: 34 | xadmin_conf = getattr(settings, 'XADMIN_CONF', 'xadmin_conf.py') 35 | conf_mod = import_module(xadmin_conf) 36 | except Exception: 37 | conf_mod = None 38 | 39 | if conf_mod: 40 | for key in dir(conf_mod): 41 | setting = getattr(conf_mod, key) 42 | try: 43 | if issubclass(setting, Settings): 44 | site.register_settings(setting.__name__, setting) 45 | except Exception: 46 | pass 47 | 48 | from xadmin.plugins import register_builtin_plugins 49 | register_builtin_plugins(site) 50 | 51 | for app_config in apps.get_app_configs(): 52 | mod = import_module(app_config.name) 53 | # Attempt to import the app's admin module. 54 | try: 55 | before_import_registry = site.copy_registry() 56 | import_module('%s.adminx' % app_config.name) 57 | except: 58 | # Reset the model registry to the state before the last import as 59 | # this import will have to reoccur on the next request and this 60 | # could raise NotRegistered and AlreadyRegistered exceptions 61 | # (see #8245). 62 | site.restore_registry(before_import_registry) 63 | 64 | # Decide whether to bubble up this error. If the app just 65 | # doesn't have an admin module, we can ignore the error 66 | # attempting to import it, otherwise we want it to bubble up. 67 | if module_has_submodule(mod, 'adminx'): 68 | raise 69 | 70 | default_app_config = 'xadmin.apps.XAdminConfig' 71 | -------------------------------------------------------------------------------- /extra_apps/xadmin/adminx.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | import xadmin 3 | from .models import UserSettings, Log 4 | from xadmin.layout import * 5 | 6 | from django.utils.translation import ugettext_lazy as _, ugettext 7 | 8 | class UserSettingsAdmin(object): 9 | model_icon = 'fa fa-cog' 10 | hidden_menu = True 11 | 12 | xadmin.site.register(UserSettings, UserSettingsAdmin) 13 | 14 | class LogAdmin(object): 15 | 16 | def link(self, instance): 17 | if instance.content_type and instance.object_id and instance.action_flag != 'delete': 18 | admin_url = self.get_admin_url('%s_%s_change' % (instance.content_type.app_label, instance.content_type.model), 19 | instance.object_id) 20 | return "%s" % (admin_url, _('Admin Object')) 21 | else: 22 | return '' 23 | link.short_description = "" 24 | link.allow_tags = True 25 | link.is_column = False 26 | 27 | list_display = ('action_time', 'user', 'ip_addr', '__str__', 'link') 28 | list_filter = ['user', 'action_time'] 29 | search_fields = ['ip_addr', 'message'] 30 | model_icon = 'fa fa-cog' 31 | 32 | xadmin.site.register(Log, LogAdmin) 33 | -------------------------------------------------------------------------------- /extra_apps/xadmin/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | from django.core import checks 3 | from django.utils.translation import ugettext_lazy as _ 4 | import xadmin 5 | 6 | 7 | class XAdminConfig(AppConfig): 8 | """Simple AppConfig which does not do automatic discovery.""" 9 | 10 | name = 'xadmin' 11 | verbose_name = _("Administration") 12 | 13 | def ready(self): 14 | self.module.autodiscover() 15 | setattr(xadmin,'site',xadmin.site) 16 | -------------------------------------------------------------------------------- /extra_apps/xadmin/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | from django.contrib.auth import authenticate 4 | from django.contrib.auth.forms import AuthenticationForm 5 | 6 | from django.utils.translation import ugettext_lazy, ugettext as _ 7 | 8 | from django.contrib.auth import get_user_model 9 | 10 | ERROR_MESSAGE = ugettext_lazy("Please enter the correct username and password " 11 | "for a staff account. Note that both fields are case-sensitive.") 12 | 13 | 14 | class AdminAuthenticationForm(AuthenticationForm): 15 | """ 16 | A custom authentication form used in the admin app. 17 | 18 | """ 19 | this_is_the_login_form = forms.BooleanField( 20 | widget=forms.HiddenInput, initial=1, 21 | error_messages={'required': ugettext_lazy("Please log in again, because your session has expired.")}) 22 | 23 | def clean(self): 24 | username = self.cleaned_data.get('username') 25 | password = self.cleaned_data.get('password') 26 | message = ERROR_MESSAGE 27 | 28 | if username and password: 29 | self.user_cache = authenticate( 30 | username=username, password=password) 31 | if self.user_cache is None: 32 | if u'@' in username: 33 | User = get_user_model() 34 | # Mistakenly entered e-mail address instead of username? Look it up. 35 | try: 36 | user = User.objects.get(email=username) 37 | except (User.DoesNotExist, User.MultipleObjectsReturned): 38 | # Nothing to do here, moving along. 39 | pass 40 | else: 41 | if user.check_password(password): 42 | message = _("Your e-mail address is not your username." 43 | " Try '%s' instead.") % user.username 44 | raise forms.ValidationError(message) 45 | elif not self.user_cache.is_active or not self.user_cache.is_staff: 46 | raise forms.ValidationError(message) 47 | return self.cleaned_data 48 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/de_DE/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/de_DE/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/de_DE/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/de_DE/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/de_DE/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # Azd325 , 2013 7 | # Azd325 , 2013 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: xadmin-core\n" 11 | "Report-Msgid-Bugs-To: \n" 12 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 13 | "PO-Revision-Date: 2013-11-20 12:41+0000\n" 14 | "Last-Translator: Azd325 \n" 15 | "Language-Team: German (Germany) (http://www.transifex.com/projects/p/xadmin/language/de_DE/)\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Language: de_DE\n" 20 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 21 | 22 | #: static/xadmin/js/xadmin.plugin.actions.js:20 23 | msgid "%(sel)s of %(cnt)s selected" 24 | msgid_plural "%(sel)s of %(cnt)s selected" 25 | msgstr[0] "%(sel)s von %(cnt)s markiert" 26 | msgstr[1] "%(sel)s von %(cnt)s markiert" 27 | 28 | #: static/xadmin/js/xadmin.plugin.revision.js:25 29 | msgid "New Item" 30 | msgstr "Neues Element" 31 | 32 | #: static/xadmin/js/xadmin.widget.datetime.js:32 33 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 34 | msgstr "Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag Sonntag" 35 | 36 | #: static/xadmin/js/xadmin.widget.datetime.js:33 37 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 38 | msgstr "So Mo Di Mi Do Fr Sa So" 39 | 40 | #: static/xadmin/js/xadmin.widget.datetime.js:34 41 | msgid "Su Mo Tu We Th Fr Sa Su" 42 | msgstr "So Mo Di Mi Do Fr Sa So" 43 | 44 | #: static/xadmin/js/xadmin.widget.datetime.js:35 45 | msgid "" 46 | "January February March April May June July August September October November" 47 | " December" 48 | msgstr "Januar Februar März April Mai Juni Juli August September Oktober November Dezember" 49 | 50 | #: static/xadmin/js/xadmin.widget.datetime.js:36 51 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 52 | msgstr "Jan Feb Mär Apr Mai Jun Jul Aug Sep Okt Nov Dez" 53 | 54 | #: static/xadmin/js/xadmin.widget.datetime.js:37 55 | msgid "Today" 56 | msgstr "Heute" 57 | 58 | #: static/xadmin/js/xadmin.widget.datetime.js:38 59 | msgid "%a %d %b %Y %T %Z" 60 | msgstr "%a %d %b %Y %T %Z" 61 | 62 | #: static/xadmin/js/xadmin.widget.datetime.js:39 63 | msgid "AM PM" 64 | msgstr "vorm nachm" 65 | 66 | #: static/xadmin/js/xadmin.widget.datetime.js:40 67 | msgid "am pm" 68 | msgstr "vorm nachm" 69 | 70 | #: static/xadmin/js/xadmin.widget.datetime.js:43 71 | msgid "%T" 72 | msgstr "%T" 73 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/en/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/en/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/en/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language: \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: static/xadmin/js/xadmin.plugin.actions.js:20 20 | msgid "%(sel)s of %(cnt)s selected" 21 | msgid_plural "%(sel)s of %(cnt)s selected" 22 | msgstr[0] "" 23 | msgstr[1] "" 24 | 25 | #: static/xadmin/js/xadmin.plugin.revision.js:25 26 | msgid "New Item" 27 | msgstr "" 28 | 29 | #: static/xadmin/js/xadmin.widget.datetime.js:32 30 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 31 | msgstr "" 32 | 33 | #: static/xadmin/js/xadmin.widget.datetime.js:33 34 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 35 | msgstr "" 36 | 37 | #: static/xadmin/js/xadmin.widget.datetime.js:34 38 | msgid "Su Mo Tu We Th Fr Sa Su" 39 | msgstr "" 40 | 41 | #: static/xadmin/js/xadmin.widget.datetime.js:35 42 | msgid "" 43 | "January February March April May June July August September October November " 44 | "December" 45 | msgstr "" 46 | 47 | #: static/xadmin/js/xadmin.widget.datetime.js:36 48 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 49 | msgstr "" 50 | 51 | #: static/xadmin/js/xadmin.widget.datetime.js:37 52 | msgid "Today" 53 | msgstr "" 54 | 55 | #: static/xadmin/js/xadmin.widget.datetime.js:38 56 | msgid "%a %d %b %Y %T %Z" 57 | msgstr "" 58 | 59 | #: static/xadmin/js/xadmin.widget.datetime.js:39 60 | msgid "AM PM" 61 | msgstr "" 62 | 63 | #: static/xadmin/js/xadmin.widget.datetime.js:40 64 | msgid "am pm" 65 | msgstr "" 66 | 67 | #: static/xadmin/js/xadmin.widget.datetime.js:43 68 | msgid "%T" 69 | msgstr "" 70 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/es_MX/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/es_MX/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/es_MX/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/es_MX/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/eu/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/eu/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/eu/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/eu/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/eu/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # unaizalakain , 2013 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: xadmin-core\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 12 | "PO-Revision-Date: 2013-11-20 12:41+0000\n" 13 | "Last-Translator: unaizalakain \n" 14 | "Language-Team: Basque (http://www.transifex.com/projects/p/xadmin/language/eu/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: eu\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: static/xadmin/js/xadmin.plugin.actions.js:20 22 | msgid "%(sel)s of %(cnt)s selected" 23 | msgid_plural "%(sel)s of %(cnt)s selected" 24 | msgstr[0] "%(cnt)stik %(sel)s aukeratua" 25 | msgstr[1] "%(cnt)stik %(sel)s aukeratuak" 26 | 27 | #: static/xadmin/js/xadmin.plugin.revision.js:25 28 | msgid "New Item" 29 | msgstr "Elementu Berria" 30 | 31 | #: static/xadmin/js/xadmin.widget.datetime.js:32 32 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 33 | msgstr "Igandea Astelehena Asteartea Asteazkena Osteguna Ostirala Larunbata Igandea" 34 | 35 | #: static/xadmin/js/xadmin.widget.datetime.js:33 36 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 37 | msgstr "Iga Atl Atr Atz Otg Otr Lar Iga" 38 | 39 | #: static/xadmin/js/xadmin.widget.datetime.js:34 40 | msgid "Su Mo Tu We Th Fr Sa Su" 41 | msgstr "Ig At Ar Az Og Or La Ig" 42 | 43 | #: static/xadmin/js/xadmin.widget.datetime.js:35 44 | msgid "" 45 | "January February March April May June July August September October November" 46 | " December" 47 | msgstr "Urtarrila Otsaila Martxoa Apirila Maiatza Ekaina Uztaila Abuztua Iraila Urria Azaroa Abendua" 48 | 49 | #: static/xadmin/js/xadmin.widget.datetime.js:36 50 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 51 | msgstr "Urt Ots Mar Api Mai Eka Uzt Abu Ira Urr Aza Abe" 52 | 53 | #: static/xadmin/js/xadmin.widget.datetime.js:37 54 | msgid "Today" 55 | msgstr "Gaur" 56 | 57 | #: static/xadmin/js/xadmin.widget.datetime.js:38 58 | msgid "%a %d %b %Y %T %Z" 59 | msgstr "%a %d %b %Y %T %Z" 60 | 61 | #: static/xadmin/js/xadmin.widget.datetime.js:39 62 | msgid "AM PM" 63 | msgstr "AM PM" 64 | 65 | #: static/xadmin/js/xadmin.widget.datetime.js:40 66 | msgid "am pm" 67 | msgstr "am pm" 68 | 69 | #: static/xadmin/js/xadmin.widget.datetime.js:43 70 | msgid "%T" 71 | msgstr "%T" 72 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/id_ID/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/id_ID/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/id_ID/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/id_ID/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/id_ID/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: xadmin-core\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 11 | "PO-Revision-Date: 2013-11-20 12:41+0000\n" 12 | "Last-Translator: sshwsfc \n" 13 | "Language-Team: Indonesian (Indonesia) (http://www.transifex.com/projects/p/xadmin/language/id_ID/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: id_ID\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #: static/xadmin/js/xadmin.plugin.actions.js:20 21 | msgid "%(sel)s of %(cnt)s selected" 22 | msgid_plural "%(sel)s of %(cnt)s selected" 23 | msgstr[0] "" 24 | 25 | #: static/xadmin/js/xadmin.plugin.revision.js:25 26 | msgid "New Item" 27 | msgstr "" 28 | 29 | #: static/xadmin/js/xadmin.widget.datetime.js:32 30 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 31 | msgstr "" 32 | 33 | #: static/xadmin/js/xadmin.widget.datetime.js:33 34 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 35 | msgstr "" 36 | 37 | #: static/xadmin/js/xadmin.widget.datetime.js:34 38 | msgid "Su Mo Tu We Th Fr Sa Su" 39 | msgstr "" 40 | 41 | #: static/xadmin/js/xadmin.widget.datetime.js:35 42 | msgid "" 43 | "January February March April May June July August September October November" 44 | " December" 45 | msgstr "" 46 | 47 | #: static/xadmin/js/xadmin.widget.datetime.js:36 48 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 49 | msgstr "" 50 | 51 | #: static/xadmin/js/xadmin.widget.datetime.js:37 52 | msgid "Today" 53 | msgstr "" 54 | 55 | #: static/xadmin/js/xadmin.widget.datetime.js:38 56 | msgid "%a %d %b %Y %T %Z" 57 | msgstr "" 58 | 59 | #: static/xadmin/js/xadmin.widget.datetime.js:39 60 | msgid "AM PM" 61 | msgstr "" 62 | 63 | #: static/xadmin/js/xadmin.widget.datetime.js:40 64 | msgid "am pm" 65 | msgstr "" 66 | 67 | #: static/xadmin/js/xadmin.widget.datetime.js:43 68 | msgid "%T" 69 | msgstr "" 70 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/ja/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/ja/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/ja/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/ja/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/ja/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: xadmin-core\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 11 | "PO-Revision-Date: 2013-11-20 12:41+0000\n" 12 | "Last-Translator: sshwsfc \n" 13 | "Language-Team: Japanese (http://www.transifex.com/projects/p/xadmin/language/ja/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: ja\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #: static/xadmin/js/xadmin.plugin.actions.js:20 21 | msgid "%(sel)s of %(cnt)s selected" 22 | msgid_plural "%(sel)s of %(cnt)s selected" 23 | msgstr[0] "" 24 | 25 | #: static/xadmin/js/xadmin.plugin.revision.js:25 26 | msgid "New Item" 27 | msgstr "" 28 | 29 | #: static/xadmin/js/xadmin.widget.datetime.js:32 30 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 31 | msgstr "" 32 | 33 | #: static/xadmin/js/xadmin.widget.datetime.js:33 34 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 35 | msgstr "" 36 | 37 | #: static/xadmin/js/xadmin.widget.datetime.js:34 38 | msgid "Su Mo Tu We Th Fr Sa Su" 39 | msgstr "" 40 | 41 | #: static/xadmin/js/xadmin.widget.datetime.js:35 42 | msgid "" 43 | "January February March April May June July August September October November" 44 | " December" 45 | msgstr "" 46 | 47 | #: static/xadmin/js/xadmin.widget.datetime.js:36 48 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 49 | msgstr "" 50 | 51 | #: static/xadmin/js/xadmin.widget.datetime.js:37 52 | msgid "Today" 53 | msgstr "" 54 | 55 | #: static/xadmin/js/xadmin.widget.datetime.js:38 56 | msgid "%a %d %b %Y %T %Z" 57 | msgstr "" 58 | 59 | #: static/xadmin/js/xadmin.widget.datetime.js:39 60 | msgid "AM PM" 61 | msgstr "" 62 | 63 | #: static/xadmin/js/xadmin.widget.datetime.js:40 64 | msgid "am pm" 65 | msgstr "" 66 | 67 | #: static/xadmin/js/xadmin.widget.datetime.js:43 68 | msgid "%T" 69 | msgstr "" 70 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/lt/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/lt/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/lt/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/lt/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/lt/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: xadmin-core\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 11 | "PO-Revision-Date: 2013-11-20 12:41+0000\n" 12 | "Last-Translator: sshwsfc \n" 13 | "Language-Team: Lithuanian (http://www.transifex.com/projects/p/xadmin/language/lt/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: lt\n" 18 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n" 19 | 20 | #: static/xadmin/js/xadmin.plugin.actions.js:20 21 | msgid "%(sel)s of %(cnt)s selected" 22 | msgid_plural "%(sel)s of %(cnt)s selected" 23 | msgstr[0] "" 24 | msgstr[1] "" 25 | msgstr[2] "" 26 | 27 | #: static/xadmin/js/xadmin.plugin.revision.js:25 28 | msgid "New Item" 29 | msgstr "" 30 | 31 | #: static/xadmin/js/xadmin.widget.datetime.js:32 32 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 33 | msgstr "" 34 | 35 | #: static/xadmin/js/xadmin.widget.datetime.js:33 36 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 37 | msgstr "" 38 | 39 | #: static/xadmin/js/xadmin.widget.datetime.js:34 40 | msgid "Su Mo Tu We Th Fr Sa Su" 41 | msgstr "" 42 | 43 | #: static/xadmin/js/xadmin.widget.datetime.js:35 44 | msgid "" 45 | "January February March April May June July August September October November" 46 | " December" 47 | msgstr "" 48 | 49 | #: static/xadmin/js/xadmin.widget.datetime.js:36 50 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 51 | msgstr "" 52 | 53 | #: static/xadmin/js/xadmin.widget.datetime.js:37 54 | msgid "Today" 55 | msgstr "" 56 | 57 | #: static/xadmin/js/xadmin.widget.datetime.js:38 58 | msgid "%a %d %b %Y %T %Z" 59 | msgstr "" 60 | 61 | #: static/xadmin/js/xadmin.widget.datetime.js:39 62 | msgid "AM PM" 63 | msgstr "" 64 | 65 | #: static/xadmin/js/xadmin.widget.datetime.js:40 66 | msgid "am pm" 67 | msgstr "" 68 | 69 | #: static/xadmin/js/xadmin.widget.datetime.js:43 70 | msgid "%T" 71 | msgstr "" 72 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/nl_NL/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/nl_NL/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/nl_NL/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/nl_NL/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/nl_NL/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: xadmin-core\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 11 | "PO-Revision-Date: 2013-11-20 12:41+0000\n" 12 | "Last-Translator: sshwsfc \n" 13 | "Language-Team: Dutch (Netherlands) (http://www.transifex.com/projects/p/xadmin/language/nl_NL/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: nl_NL\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: static/xadmin/js/xadmin.plugin.actions.js:20 21 | msgid "%(sel)s of %(cnt)s selected" 22 | msgid_plural "%(sel)s of %(cnt)s selected" 23 | msgstr[0] "" 24 | msgstr[1] "" 25 | 26 | #: static/xadmin/js/xadmin.plugin.revision.js:25 27 | msgid "New Item" 28 | msgstr "" 29 | 30 | #: static/xadmin/js/xadmin.widget.datetime.js:32 31 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 32 | msgstr "" 33 | 34 | #: static/xadmin/js/xadmin.widget.datetime.js:33 35 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 36 | msgstr "" 37 | 38 | #: static/xadmin/js/xadmin.widget.datetime.js:34 39 | msgid "Su Mo Tu We Th Fr Sa Su" 40 | msgstr "" 41 | 42 | #: static/xadmin/js/xadmin.widget.datetime.js:35 43 | msgid "" 44 | "January February March April May June July August September October November" 45 | " December" 46 | msgstr "" 47 | 48 | #: static/xadmin/js/xadmin.widget.datetime.js:36 49 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 50 | msgstr "" 51 | 52 | #: static/xadmin/js/xadmin.widget.datetime.js:37 53 | msgid "Today" 54 | msgstr "" 55 | 56 | #: static/xadmin/js/xadmin.widget.datetime.js:38 57 | msgid "%a %d %b %Y %T %Z" 58 | msgstr "" 59 | 60 | #: static/xadmin/js/xadmin.widget.datetime.js:39 61 | msgid "AM PM" 62 | msgstr "" 63 | 64 | #: static/xadmin/js/xadmin.widget.datetime.js:40 65 | msgid "am pm" 66 | msgstr "" 67 | 68 | #: static/xadmin/js/xadmin.widget.datetime.js:43 69 | msgid "%T" 70 | msgstr "" 71 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/pl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/pl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/pl/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/pl/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/pt_BR/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/pt_BR/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | # korndorfer , 2013 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: xadmin-core\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 12 | "PO-Revision-Date: 2013-11-20 12:41+0000\n" 13 | "Last-Translator: korndorfer \n" 14 | "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/xadmin/language/pt_BR/)\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Language: pt_BR\n" 19 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 20 | 21 | #: static/xadmin/js/xadmin.plugin.actions.js:20 22 | msgid "%(sel)s of %(cnt)s selected" 23 | msgid_plural "%(sel)s of %(cnt)s selected" 24 | msgstr[0] "%(sel)s de %(cnt)s selecionado" 25 | msgstr[1] "%(sel)s de %(cnt)s selecionados" 26 | 27 | #: static/xadmin/js/xadmin.plugin.revision.js:25 28 | msgid "New Item" 29 | msgstr "Novo Item" 30 | 31 | #: static/xadmin/js/xadmin.widget.datetime.js:32 32 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 33 | msgstr "Domingo Segunda Terça Quarta Quinta Sexta Sábado Domingo" 34 | 35 | #: static/xadmin/js/xadmin.widget.datetime.js:33 36 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 37 | msgstr "Dom Seg Ter Qua Qui Sex Sáb Dom" 38 | 39 | #: static/xadmin/js/xadmin.widget.datetime.js:34 40 | msgid "Su Mo Tu We Th Fr Sa Su" 41 | msgstr "Do Sg Te Qa Qi Sx Sa Do" 42 | 43 | #: static/xadmin/js/xadmin.widget.datetime.js:35 44 | msgid "" 45 | "January February March April May June July August September October November" 46 | " December" 47 | msgstr "Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro" 48 | 49 | #: static/xadmin/js/xadmin.widget.datetime.js:36 50 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 51 | msgstr "Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez" 52 | 53 | #: static/xadmin/js/xadmin.widget.datetime.js:37 54 | msgid "Today" 55 | msgstr "Hoje" 56 | 57 | #: static/xadmin/js/xadmin.widget.datetime.js:38 58 | msgid "%a %d %b %Y %T %Z" 59 | msgstr "%a %d %b %Y %T %Z" 60 | 61 | #: static/xadmin/js/xadmin.widget.datetime.js:39 62 | msgid "AM PM" 63 | msgstr "AM PM" 64 | 65 | #: static/xadmin/js/xadmin.widget.datetime.js:40 66 | msgid "am pm" 67 | msgstr "am pm" 68 | 69 | #: static/xadmin/js/xadmin.widget.datetime.js:43 70 | msgid "%T" 71 | msgstr "%T" 72 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/ru_RU/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/ru_RU/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/ru_RU/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/ru_RU/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/ru_RU/LC_MESSAGES/djangojs.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # 5 | # Translators: 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: xadmin-core\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2013-04-30 23:11+0800\n" 11 | "PO-Revision-Date: 2013-11-20 12:41+0000\n" 12 | "Last-Translator: sshwsfc \n" 13 | "Language-Team: Russian (Russia) (http://www.transifex.com/projects/p/xadmin/language/ru_RU/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: ru_RU\n" 18 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" 19 | 20 | #: static/xadmin/js/xadmin.plugin.actions.js:20 21 | msgid "%(sel)s of %(cnt)s selected" 22 | msgid_plural "%(sel)s of %(cnt)s selected" 23 | msgstr[0] "" 24 | msgstr[1] "" 25 | msgstr[2] "" 26 | 27 | #: static/xadmin/js/xadmin.plugin.revision.js:25 28 | msgid "New Item" 29 | msgstr "" 30 | 31 | #: static/xadmin/js/xadmin.widget.datetime.js:32 32 | msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" 33 | msgstr "" 34 | 35 | #: static/xadmin/js/xadmin.widget.datetime.js:33 36 | msgid "Sun Mon Tue Wed Thu Fri Sat Sun" 37 | msgstr "" 38 | 39 | #: static/xadmin/js/xadmin.widget.datetime.js:34 40 | msgid "Su Mo Tu We Th Fr Sa Su" 41 | msgstr "" 42 | 43 | #: static/xadmin/js/xadmin.widget.datetime.js:35 44 | msgid "" 45 | "January February March April May June July August September October November" 46 | " December" 47 | msgstr "" 48 | 49 | #: static/xadmin/js/xadmin.widget.datetime.js:36 50 | msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" 51 | msgstr "" 52 | 53 | #: static/xadmin/js/xadmin.widget.datetime.js:37 54 | msgid "Today" 55 | msgstr "" 56 | 57 | #: static/xadmin/js/xadmin.widget.datetime.js:38 58 | msgid "%a %d %b %Y %T %Z" 59 | msgstr "" 60 | 61 | #: static/xadmin/js/xadmin.widget.datetime.js:39 62 | msgid "AM PM" 63 | msgstr "" 64 | 65 | #: static/xadmin/js/xadmin.widget.datetime.js:40 66 | msgid "am pm" 67 | msgstr "" 68 | 69 | #: static/xadmin/js/xadmin.widget.datetime.js:43 70 | msgid "%T" 71 | msgstr "" 72 | -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/zh_Hans/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/zh_Hans/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/locale/zh_Hans/LC_MESSAGES/djangojs.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/locale/zh_Hans/LC_MESSAGES/djangojs.mo -------------------------------------------------------------------------------- /extra_apps/xadmin/migrations/0002_log.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.7 on 2016-07-15 05:50 3 | from __future__ import unicode_literals 4 | 5 | from django.conf import settings 6 | from django.db import migrations, models 7 | import django.db.models.deletion 8 | import django.utils.timezone 9 | 10 | 11 | class Migration(migrations.Migration): 12 | 13 | dependencies = [ 14 | ('contenttypes', '0002_remove_content_type_name'), 15 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 16 | ('xadmin', '0001_initial'), 17 | ] 18 | 19 | operations = [ 20 | migrations.CreateModel( 21 | name='Log', 22 | fields=[ 23 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 24 | ('action_time', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='action time')), 25 | ('ip_addr', models.GenericIPAddressField(blank=True, null=True, verbose_name='action ip')), 26 | ('object_id', models.TextField(blank=True, null=True, verbose_name='object id')), 27 | ('object_repr', models.CharField(max_length=200, verbose_name='object repr')), 28 | ('action_flag', models.PositiveSmallIntegerField(verbose_name='action flag')), 29 | ('message', models.TextField(blank=True, verbose_name='change message')), 30 | ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='contenttypes.ContentType', verbose_name='content type')), 31 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='user')), 32 | ], 33 | options={ 34 | 'ordering': ('-action_time',), 35 | 'verbose_name': 'log entry', 36 | 'verbose_name_plural': 'log entries', 37 | }, 38 | ), 39 | ] 40 | -------------------------------------------------------------------------------- /extra_apps/xadmin/migrations/0003_auto_20160715_0100.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.7 on 2016-07-15 06:00 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('xadmin', '0002_log'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='log', 17 | name='action_flag', 18 | field=models.CharField(max_length=32, verbose_name='action flag'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /extra_apps/xadmin/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/migrations/__init__.py -------------------------------------------------------------------------------- /extra_apps/xadmin/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | PLUGINS = ( 3 | 'actions', 4 | 'filters', 5 | 'bookmark', 6 | 'export', 7 | 'layout', 8 | 'refresh', 9 | 'details', 10 | 'editable', 11 | 'relate', 12 | 'chart', 13 | 'ajax', 14 | 'relfield', 15 | 'inline', 16 | 'topnav', 17 | 'portal', 18 | 'quickform', 19 | 'wizard', 20 | 'images', 21 | 'auth', 22 | 'multiselect', 23 | 'themes', 24 | 'aggregation', 25 | 'mobile', 26 | 'passwords', 27 | 'sitemenu', 28 | 'language', 29 | 'quickfilter', 30 | 'sortablelist', 31 | 'importexport', 32 | 'ueditor' 33 | ) 34 | 35 | 36 | def register_builtin_plugins(site): 37 | from importlib import import_module 38 | from django.conf import settings 39 | 40 | exclude_plugins = getattr(settings, 'XADMIN_EXCLUDE_PLUGINS', []) 41 | 42 | [import_module('xadmin.plugins.%s' % plugin) for plugin in PLUGINS if plugin not in exclude_plugins] 43 | -------------------------------------------------------------------------------- /extra_apps/xadmin/plugins/aggregation.py: -------------------------------------------------------------------------------- 1 | from django.db.models import FieldDoesNotExist, Avg, Max, Min, Count, Sum 2 | from django.utils.translation import ugettext as _ 3 | 4 | from xadmin.sites import site 5 | from xadmin.views import BaseAdminPlugin, ListAdminView 6 | 7 | from xadmin.views.list import ResultRow, ResultItem 8 | from xadmin.util import display_for_field 9 | 10 | AGGREGATE_METHODS = { 11 | 'min': Min, 'max': Max, 'avg': Avg, 'sum': Sum, 'count': Count 12 | } 13 | AGGREGATE_TITLE = { 14 | 'min': _('Min'), 'max': _('Max'), 'avg': _('Avg'), 'sum': _('Sum'), 'count': _('Count') 15 | } 16 | 17 | 18 | class AggregationPlugin(BaseAdminPlugin): 19 | 20 | aggregate_fields = {} 21 | 22 | def init_request(self, *args, **kwargs): 23 | return bool(self.aggregate_fields) 24 | 25 | def _get_field_aggregate(self, field_name, obj, row): 26 | item = ResultItem(field_name, row) 27 | item.classes = ['aggregate', ] 28 | if field_name not in self.aggregate_fields: 29 | item.text = "" 30 | else: 31 | try: 32 | f = self.opts.get_field(field_name) 33 | agg_method = self.aggregate_fields[field_name] 34 | key = '%s__%s' % (field_name, agg_method) 35 | if key not in obj: 36 | item.text = "" 37 | else: 38 | item.text = display_for_field(obj[key], f) 39 | item.wraps.append('%%s%s' % AGGREGATE_TITLE[agg_method]) 40 | item.classes.append(agg_method) 41 | except FieldDoesNotExist: 42 | item.text = "" 43 | 44 | return item 45 | 46 | def _get_aggregate_row(self): 47 | queryset = self.admin_view.list_queryset._clone() 48 | obj = queryset.aggregate(*[AGGREGATE_METHODS[method](field_name) for field_name, method in 49 | self.aggregate_fields.items() if method in AGGREGATE_METHODS]) 50 | 51 | row = ResultRow() 52 | row['is_display_first'] = False 53 | row.cells = [self._get_field_aggregate(field_name, obj, row) for field_name in self.admin_view.list_display] 54 | row.css_class = 'info aggregate' 55 | return row 56 | 57 | def results(self, rows): 58 | if rows: 59 | rows.append(self._get_aggregate_row()) 60 | return rows 61 | 62 | # Media 63 | def get_media(self, media): 64 | media.add_css({'screen': [self.static( 65 | 'xadmin/css/xadmin.plugin.aggregation.css'), ]}) 66 | return media 67 | 68 | 69 | site.register_plugin(AggregationPlugin, ListAdminView) 70 | -------------------------------------------------------------------------------- /extra_apps/xadmin/plugins/language.py: -------------------------------------------------------------------------------- 1 | 2 | from django.conf import settings 3 | from django.template import loader 4 | from django.views.i18n import set_language 5 | from xadmin.plugins.utils import get_context_dict 6 | from xadmin.sites import site 7 | from xadmin.views import BaseAdminPlugin, CommAdminView, BaseAdminView 8 | 9 | 10 | class SetLangNavPlugin(BaseAdminPlugin): 11 | 12 | def block_top_navmenu(self, context, nodes): 13 | context = get_context_dict(context) 14 | context['redirect_to'] = self.request.get_full_path() 15 | nodes.append(loader.render_to_string('xadmin/blocks/comm.top.setlang.html', context=context)) 16 | 17 | class SetLangView(BaseAdminView): 18 | 19 | def post(self, request, *args, **kwargs): 20 | if 'nav_menu' in request.session: 21 | del request.session['nav_menu'] 22 | return set_language(request) 23 | 24 | if settings.LANGUAGES and 'django.middleware.locale.LocaleMiddleware' in settings.MIDDLEWARE_CLASSES: 25 | site.register_plugin(SetLangNavPlugin, CommAdminView) 26 | site.register_view(r'^i18n/setlang/$', SetLangView, 'set_language') 27 | -------------------------------------------------------------------------------- /extra_apps/xadmin/plugins/mobile.py: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | from xadmin.sites import site 3 | from xadmin.views import BaseAdminPlugin, CommAdminView 4 | 5 | 6 | class MobilePlugin(BaseAdminPlugin): 7 | 8 | def _test_mobile(self): 9 | try: 10 | return self.request.META['HTTP_USER_AGENT'].find('Android') >= 0 or \ 11 | self.request.META['HTTP_USER_AGENT'].find('iPhone') >= 0 12 | except Exception: 13 | return False 14 | 15 | def init_request(self, *args, **kwargs): 16 | return self._test_mobile() 17 | 18 | def get_context(self, context): 19 | #context['base_template'] = 'xadmin/base_mobile.html' 20 | context['is_mob'] = True 21 | return context 22 | 23 | # Media 24 | # def get_media(self, media): 25 | # return media + self.vendor('xadmin.mobile.css', ) 26 | 27 | def block_extrahead(self, context, nodes): 28 | nodes.append('') 29 | 30 | site.register_plugin(MobilePlugin, CommAdminView) 31 | -------------------------------------------------------------------------------- /extra_apps/xadmin/plugins/refresh.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.template import loader 3 | 4 | from xadmin.plugins.utils import get_context_dict 5 | from xadmin.sites import site 6 | from xadmin.views import BaseAdminPlugin, ListAdminView 7 | 8 | REFRESH_VAR = '_refresh' 9 | 10 | 11 | class RefreshPlugin(BaseAdminPlugin): 12 | 13 | refresh_times = [] 14 | 15 | # Media 16 | def get_media(self, media): 17 | if self.refresh_times and self.request.GET.get(REFRESH_VAR): 18 | media = media + self.vendor('xadmin.plugin.refresh.js') 19 | return media 20 | 21 | # Block Views 22 | def block_top_toolbar(self, context, nodes): 23 | if self.refresh_times: 24 | current_refresh = self.request.GET.get(REFRESH_VAR) 25 | context.update({ 26 | 'has_refresh': bool(current_refresh), 27 | 'clean_refresh_url': self.admin_view.get_query_string(remove=(REFRESH_VAR,)), 28 | 'current_refresh': current_refresh, 29 | 'refresh_times': [{ 30 | 'time': r, 31 | 'url': self.admin_view.get_query_string({REFRESH_VAR: r}), 32 | 'selected': str(r) == current_refresh, 33 | } for r in self.refresh_times], 34 | }) 35 | nodes.append(loader.render_to_string('xadmin/blocks/model_list.top_toolbar.refresh.html', 36 | get_context_dict(context))) 37 | 38 | 39 | site.register_plugin(RefreshPlugin, ListAdminView) 40 | -------------------------------------------------------------------------------- /extra_apps/xadmin/plugins/sitemenu.py: -------------------------------------------------------------------------------- 1 | 2 | from xadmin.sites import site 3 | from xadmin.views import BaseAdminPlugin, CommAdminView 4 | 5 | BUILDIN_STYLES = { 6 | 'default': 'xadmin/includes/sitemenu_default.html', 7 | 'accordion': 'xadmin/includes/sitemenu_accordion.html', 8 | } 9 | 10 | 11 | class SiteMenuStylePlugin(BaseAdminPlugin): 12 | 13 | menu_style = None 14 | 15 | def init_request(self, *args, **kwargs): 16 | return bool(self.menu_style) and self.menu_style in BUILDIN_STYLES 17 | 18 | def get_context(self, context): 19 | context['menu_template'] = BUILDIN_STYLES[self.menu_style] 20 | return context 21 | 22 | site.register_plugin(SiteMenuStylePlugin, CommAdminView) 23 | -------------------------------------------------------------------------------- /extra_apps/xadmin/plugins/ueditor.py: -------------------------------------------------------------------------------- 1 | import xadmin 2 | from xadmin.views import BaseAdminPlugin, CreateAdminView, ModelFormAdminView, UpdateAdminView 3 | from DjangoUeditor.models import UEditorField 4 | from DjangoUeditor.widgets import UEditorWidget 5 | from django.conf import settings 6 | 7 | 8 | class XadminUEditorWidget(UEditorWidget): 9 | def __init__(self, **kwargs): 10 | self.ueditor_options = kwargs 11 | self.Media.js = None 12 | super(XadminUEditorWidget, self).__init__(kwargs) 13 | 14 | 15 | class UeditorPlugin(BaseAdminPlugin): 16 | 17 | def get_field_style(self, attrs, db_field, style, **kwargs): 18 | if style == 'ueditor': 19 | if isinstance(db_field, UEditorField): 20 | widget = db_field.formfield().widget 21 | param = {} 22 | param.update(widget.ueditor_settings) 23 | param.update(widget.attrs) 24 | return {'widget': XadminUEditorWidget(**param)} 25 | return attrs 26 | 27 | def block_extrahead(self, context, nodes): 28 | js = '' % ( 29 | settings.STATIC_URL + "ueditor/ueditor.config.js") # 自己的静态目录 30 | js += '' % ( 31 | settings.STATIC_URL + "ueditor/ueditor.all.min.js") # 自己的静态目录 32 | nodes.append(js) 33 | 34 | 35 | xadmin.site.register_plugin(UeditorPlugin, UpdateAdminView) 36 | xadmin.site.register_plugin(UeditorPlugin, CreateAdminView) -------------------------------------------------------------------------------- /extra_apps/xadmin/plugins/utils.py: -------------------------------------------------------------------------------- 1 | from django.template.context import RequestContext 2 | 3 | 4 | def get_context_dict(context): 5 | """ 6 | Contexts in django version 1.9+ must be dictionaries. As xadmin has a legacy with older versions of django, 7 | the function helps the transition by converting the [RequestContext] object to the dictionary when necessary. 8 | :param context: RequestContext 9 | :return: dict 10 | """ 11 | if isinstance(context, RequestContext): 12 | ctx = context.flatten() 13 | else: 14 | ctx = context 15 | return ctx 16 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/404.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans 'Page not found' %}{% endblock %} 5 | 6 | {% block content %} 7 | 8 |

{% trans 'Page not found' %}

9 | 10 |

{% trans "We're sorry, but the requested page could not be found." %}

11 | 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/500.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | 5 | {% block breadcrumbs %} 6 | 10 | {% endblock %} 11 | 12 | {% block title %}{% trans 'Server error (500)' %}{% endblock %} 13 | 14 | {% block content %} 15 |

{% trans 'Server Error (500)' %}

16 |

{% trans "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience." %}

17 | 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/auth/password_reset/complete.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n xadmin_tags %} 3 | 4 | {% load crispy_forms_tags %} 5 | 6 | {% block body %} 7 |
8 | 9 |
10 |
11 | 12 |
13 |
14 |

{% trans "Your password has been set. You may go ahead and log in now." %}

15 |

{% trans 'Log in' %}

16 |
17 |
18 | 19 |
20 | {% endblock %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/auth/password_reset/confirm.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n xadmin_tags %} 3 | 4 | {% load crispy_forms_tags %} 5 | 6 | {% block body %} 7 |
8 | 9 |
10 | {% if validlink %} 11 |
12 | 13 |
14 |
15 |
16 | {% csrf_token %} 17 |

{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}

18 | {% crispy form %} 19 | 20 |
21 |
22 | {% else %} 23 |
24 | 25 |
26 |
27 |

{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}

28 |
29 | {% endif %} 30 |
31 | 32 |
33 | {% endblock %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/auth/password_reset/done.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n xadmin_tags %} 3 | 4 | {% load crispy_forms_tags %} 5 | 6 | {% block body %} 7 |
8 | 9 |
10 |
11 | 12 |
13 |
14 |

{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}

15 |
16 |
17 | 18 |
19 | {% endblock %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/auth/password_reset/email.html: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | {% blocktrans %}You're receiving this e-mail because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %} 3 | 4 | {% trans "Please go to the following page and choose a new password:" %} 5 | {% block reset_link %} 6 | {{ protocol }}://{{ domain }}{% url 'xadmin:xadmin_password_reset_confirm' uidb36=uid token=token %} 7 | {% endblock %} 8 | {% trans "Your username, in case you've forgotten:" %} {{ user.username }} 9 | 10 | {% trans "Thanks for using our site!" %} 11 | 12 | {% blocktrans %}The {{ site_name }} team{% endblocktrans %} 13 | 14 | {% endautoescape %} 15 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/auth/password_reset/form.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n xadmin_tags %} 3 | 4 | {% load crispy_forms_tags %} 5 | 6 | {% block body %} 7 |
8 | 9 |
10 |
11 | {% csrf_token %} 12 |
13 | 14 |
15 |
16 | 17 |

{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}

18 | 19 | {% include 'bootstrap3/errors.html' %} 20 | 21 |
22 |
23 |
24 | 25 | 26 |
27 | {% for error in form.email.errors %} 28 |

{{ error }}

29 | {% endfor %} 30 |
31 |
32 | 33 | 34 | 35 |
36 |
37 |
38 | 39 |
40 | 41 | 44 | {% endblock %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/auth/user/add_form.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/views/model_form.html" %} 2 | {% load i18n %} 3 | 4 | {% block form_top %} 5 | {% if not is_popup %} 6 |

{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}

7 | {% else %} 8 |

{% trans "Enter a username and password." %}

9 | {% endif %} 10 | {% endblock %} 11 | 12 | {% block after_field_sets %} 13 | 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/auth/user/change_password.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/views/model_form.html" %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | {% load crispy_forms_tags %} 6 | 7 | {% block breadcrumbs %} 8 | {% if account_view %} 9 | 13 | {% else %} 14 | 24 | {% endif %} 25 | {% endblock %} 26 | 27 | {% block content %} 28 |
{% csrf_token %}{% block form_top %}{% endblock %} 29 | {% if errors %} 30 |
31 | {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} 32 |
33 | {{ form.non_field_errors }} 34 | {% endif %} 35 | 36 |
37 | {% if account_view %} 38 | {% trans "Enter your new password." %} 39 | {% else %} 40 | {% blocktrans with username=original.username %}Enter a new password for the user {{ username }}.{% endblocktrans %} 41 | {% endif %} 42 |
43 | 44 |
45 |
46 |
47 |
48 | {% crispy form %} 49 |
50 |
51 |
52 |
53 | 54 |
55 | 56 |
57 |
58 | 59 | {% endblock %} 60 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/base.html: -------------------------------------------------------------------------------- 1 | {% load xadmin_tags %}{% load i18n %} 2 | 3 | 4 | 5 | {% block extrameta %} 6 | 7 | 8 | {% endblock %} 9 | {% block blockbots %}{% endblock %} 10 | {% block title %}{% endblock %} 11 | {% if LANGUAGE_BIDI %}{% endif %} 12 | {% vendor 'bootstrap.css' %} 13 | {% if site_theme %} 14 | 15 | {% else %} 16 | 17 | {% endif %} 18 | {% vendor 'font-awesome.css' 'xadmin.main.css' 'xadmin.plugins.css' 'xadmin.responsive.css' %} 19 | {{ media.css }} 20 | {% block extrastyle %}{% endblock %} 21 | {% vendor 'jquery.js' %} 22 | {% url 'xadmin:index' as indexurl %} 23 | 28 | 29 | {% block extrahead %}{% endblock %} 30 | {% view_block 'extrahead' %} 31 | 32 | 33 | {% block body %} 34 |
35 | {% block content %}{% endblock content %} 36 |
37 | {% endblock body %} 38 | {% vendor 'jquery-ui-sortable.js' 'bootstrap.js' 'xadmin.main.js' 'xadmin.responsive.js' %} 39 | {{ media.js }} 40 | {% block extrabody %}{% endblock %} 41 | {% view_block 'extrabody' %} 42 | 43 | 44 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/comm.top.setlang.html: -------------------------------------------------------------------------------- 1 | {% load i18n xadmin_tags %} 2 | 3 | 20 | 32 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/comm.top.theme.html: -------------------------------------------------------------------------------- 1 | {% load i18n xadmin_tags %} 2 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/comm.top.topnav.html: -------------------------------------------------------------------------------- 1 | {% load i18n xadmin_tags %} 2 | {% autoescape off %} 3 | {% if search_models %} 4 | 19 | {% endif %} 20 | {% if add_models %} 21 | 30 | {% endif %} 31 | {% endautoescape %} 32 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/modal_list.left_navbar.quickfilter.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_form.before_fieldsets.wizard.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {{ wizard.management_form }} 3 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_form.submit_line.wizard.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 |
3 | 10 | 11 |
12 | {% if wizard.steps.last != wizard.steps.current %} 13 | 14 | {% else %} 15 | 16 | {% endif %} 17 |
18 |
19 |
20 | 27 | 28 | {% if wizard.steps.last != wizard.steps.current %} 29 | 30 | {% else %} 31 | 32 | {% endif %} 33 |
-------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.nav_form.search_form.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% if cl.search_fields %} 3 | 13 | {% endif %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.nav_menu.bookmarks.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 41 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.nav_menu.filters.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.results_bottom.actions.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 |
3 | 4 | 5 |
6 | 7 | 8 | {{ selection_note }} 9 | 10 | 11 | 16 |
17 | {% if actions_selection_counter %} 18 | {% if cl.result_count != cl.result_list|length %} 19 | 20 | 21 | {% endif %} 22 | {% endif %} 23 | 24 |
25 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.results_top.charts.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/includes/box.html" %} 2 | {% load i18n xadmin_tags %} 3 | {% block box_title %} 4 | {% trans "Charts" %} 5 | {% endblock box_title %} 6 | 7 | {% block box_content_class %}nopadding{% endblock box_content_class %} 8 | {% block box_content %} 9 | 14 |
15 | {% for c in charts %} 16 |
18 | {% endfor %} 19 |
20 | {% endblock box_content %} 21 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.results_top.date_hierarchy.html: -------------------------------------------------------------------------------- 1 | {% if show %} 2 |
3 |
9 |
10 | {% endif %} 11 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.top_toolbar.importexport.import.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.top_toolbar.layouts.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 |
3 | 4 | {% trans "Layout" %} 5 | 6 | 12 |
-------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.top_toolbar.refresh.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 |
3 | 4 | {% if has_refresh %} {{current_refresh}}{% endif %} 5 | 6 | 17 |
-------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/blocks/model_list.top_toolbar.saveorder.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 7 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/edit_inline/accordion.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/edit_inline/base.html" %} 2 | {% load i18n xadmin_tags crispy_forms_tags %} 3 | 4 | {% block box_content_class %}{{ block.super }} panel-group{% endblock box_content_class %} 5 | 6 | {% block formset_form %} 7 |
8 | 15 |
16 |
17 | {% crispy fs formset.formset.helper %} 18 |
19 |
20 |
21 | {% endblock formset_form %} 22 | {% block formset_empty %} 23 |
24 | 32 |
33 |
34 | {% crispy formset.formset.empty_form formset.formset.helper %} 35 |
36 |
37 |
38 | {% endblock formset_empty %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/edit_inline/base.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/includes/box.html" %} 2 | {% load i18n xadmin_tags crispy_forms_tags %} 3 | 4 | {% block box_class %}formset fieldset{% if formset.css_class or inline_style %} {{ formset.css_class }} {{ inline_style }}{% endif %}{% endblock box_class %} 5 | {% block box_attrs %}id="{{ formset.css_id }}" {{ formset.flat_attrs|safe }}{% endblock box_attrs %} 6 | 7 | {% block box_title %} 8 | {% if not formset.formset.detail_page %} 9 | {% if has_add_permission %} 10 | 11 | {% endif %} 12 | {% endif %} 13 | {{ formset.opts.verbose_name_plural|title }} 14 | {% endblock box_title %} 15 | 16 | {% block box_content_class %}{{inline_style}} formset-content{% endblock box_content_class %} 17 | {% block box_content_attrs %}id="{{ formset.css_id }}-{{inline_style}}" data-prefix="{{ prefix }}" data-style="{{inline_style}}"{% endblock box_content_attrs %} 18 | 19 | {% block box_content %} 20 | {% if not formset.formset.detail_page %} 21 | {{ formset.formset.management_form }} 22 | {{ formset.formset.non_form_errors }} 23 | {% endif %} 24 | {% block formset_content %} 25 | {% for fs in formset.formset %} 26 | {% block formset_form %}{% endblock formset_form %} 27 | {% endfor %} 28 | {% endblock formset_content %} 29 | {% endblock box_content %} 30 | 31 | {% block box_extra %} 32 | {% if not formset.formset.detail_page %} 33 | 37 | {% endif %} 38 | {% endblock box_extra %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/edit_inline/blank.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/edit_inline/base.html" %} 2 | {% load i18n xadmin_tags crispy_forms_tags %} 3 | 4 | {% block box_content_class %}formset-content{% endblock box_content_class %} 5 | {% block box_content %}

{% trans "Null" %}

{% endblock box_content %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/edit_inline/one.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/edit_inline/base.html" %} 2 | {% load i18n xadmin_tags crispy_forms_tags %} 3 | 4 | {% block box_title %}{{ formset.opts.verbose_name_plural|title }}{% endblock box_title %} 5 | {% block box_content %} 6 | {{ formset.formset.management_form }} 7 | {{ formset.formset.non_form_errors }} 8 | {% crispy formset.formset.0 formset.formset.helper %} 9 | {% endblock box_content %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/edit_inline/stacked.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/edit_inline/base.html" %} 2 | {% load i18n xadmin_tags crispy_forms_tags %} 3 | 4 | {% block box_content_class %}{{ block.super }} panel-group{% endblock box_content_class %} 5 | 6 | {% block formset_form %} 7 |
8 |
9 | {% if formset.formset.can_delete %} 10 | 11 | {% endif %} 12 | {{ formset.opts.verbose_name|title }}: {% if fs.instance.pk %}{{ fs.instance }}{% else %}#{{ forloop.counter }}{% endif %} 13 |
14 |
15 | {% crispy fs formset.formset.helper %} 16 |
17 |
18 | {% endblock formset_form %} 19 | 20 | {% block formset_empty %} 21 |
22 |
23 | {% if formset.formset.can_delete %} 24 | 25 | {% endif %} 26 | {{ formset.opts.verbose_name|title }}: # 27 |
28 |
29 | {% crispy formset.formset.empty_form formset.formset.helper %} 30 |
31 |
32 | {% endblock formset_empty %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/edit_inline/tab.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/edit_inline/base.html" %} 2 | {% load i18n xadmin_tags crispy_forms_tags %} 3 | 4 | {% block box_content_class %}tabs{% endblock box_content_class %} 5 | {% block box_content_attrs %}id="{{ formset.css_id }}-tabs"{% endblock box_content_attrs %} 6 | 7 | {% block formset_content %} 8 | 16 |
17 | {% for fs in formset.formset %} 18 |
19 | {% if formset.formset.can_delete %} 20 | 21 | {% endif %} 22 | {% crispy fs formset.formset.helper %} 23 |
24 | {% endfor %} 25 |
26 | {% endblock formset_content %} 27 | 28 | {% block formset_empty %} 29 |
30 | {% if formset.formset.can_delete %} 31 | 32 | {% endif %} 33 | {% crispy formset.formset.empty_form formset.formset.helper %} 34 |
35 | {% endblock formset_empty %} 36 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/edit_inline/tabular.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/edit_inline/base.html" %} 2 | {% load i18n xadmin_tags crispy_forms_tags %} 3 | 4 | {% block box_content_class %}nopadding{% endblock box_content_class %} 5 | {% block box_content_attrs %}{% endblock box_content_attrs %} 6 | 7 | {% block formset_content %} 8 | 9 | 10 | {% for field in fields %} 11 | {% if not field.widget.is_hidden %} 12 | {{ field.label|capfirst }} 13 | {% if field.help_text %} {% endif %} 14 | 15 | {% endif %} 16 | {% endfor %} 17 | {% for field in readonly_fields %} 18 | 19 | {% endfor %} 20 | {% if formset.formset.can_delete %}{% endif %} 21 | 22 | 23 | {% for fs in formset.formset %} 24 | 25 | {% crispy fs formset.formset.helper %} 26 | {% for r_o_f in fs.readonly_fields %} 27 | 28 | {% endfor %} 29 | {% if formset.formset.can_delete %} 30 | 31 | {% endif %} 32 | 33 | {% endfor %} 34 | 35 |
{{ field.label }} 
{{ r_o_f.contents|safe }}
36 | {% endblock formset_content %} 37 | 38 | {% block formset_empty %} 39 | 40 | {% crispy formset.formset.empty_form formset.formset.helper %} 41 | {% if formset.formset.can_delete %} 42 | 43 | {% endif %} 44 | 45 | {% endblock formset_empty %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/filters/char.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/filters/checklist.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/filters/fk_search.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 32 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/filters/list.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/filters/quickfilter.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {% for choice in choices %} 4 |
  • 5 | 6 | 7 | {{ choice.display }} 8 | 9 |
  • 10 | {% endfor %} 11 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/filters/rel.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/forms/transfer.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 |
    3 |
    4 |

    {% trans "Available" %} {{verbose_name}}

    5 |
    6 | 7 | 8 |
    9 | 12 | {% trans "Choose all" %} 13 |
    14 |
      15 |
    • 16 | 17 |
    • 18 |
    • 19 | 20 |
    • 21 |
    22 |
    23 |

    {% trans "Chosen" %} {{verbose_name}}

    24 | 27 | {% trans "Remove all" %} 28 |
    29 |
    30 |
    -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/grids/thumbnails.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/views/model_list.html" %} 2 | 3 | {% block toolbar_layouts %}{% endblock toolbar_layouts %} 4 | {% block results_grid_body %}{% endblock results_grid_body %} 5 | 6 | {% block results_grid %} 7 | {{ block.super }} 8 |
    9 |
    10 |
    11 | {% for obj in results %} 12 | {% block grid_item %} 13 |
    14 |
    15 | {% if obj.thumbnail_img %} 16 | {{obj.thumbnail_img.label}} 17 | {% else %} 18 |

    19 | {% endif %} 20 | {% if obj.thumbnail_label %} 21 |

    {{obj.thumbnail_label.label}}

    22 | {% endif %} 23 |
      24 | {% for o in obj.cells %} 25 | {% if not o.thumbnail_hidden %} 26 |
    • 27 | {% if o.btns %} 28 |
      29 | {% for b in o.btns %} 30 | {{b|safe}} 31 | {% endfor %} 32 |
      33 | {% endif %} 34 | {% if o.field_label %} 35 | {{o.field_label}}: 36 | {% endif %} 37 | {% if o.menus %} 38 | 48 | {% else %} 49 | {{ o.label }} 50 | {% endif %} 51 |
    • {% endif %} 52 | {% endfor %} 53 |
    54 |
    55 |
    56 | {% endblock grid_item %} 57 | {% endfor %} 58 |
    59 |
    60 |
    61 | {% endblock results_grid %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/import_export/export_action.html: -------------------------------------------------------------------------------- 1 | {% extends 'xadmin/base_site.html' %} 2 | {% load i18n %} 3 | {% load admin_urls %} 4 | {% load import_export_tags %} 5 | 6 | {% block breadcrumbs_last %} 7 | {% trans "Export" %} 8 | {% endblock %} 9 | {% load xadmin_tags %} 10 | 11 | {% block breadcrumbs %} 12 | 17 | {% endblock %} 18 | {% block nav_title %} 19 | {{title}} 20 | {% endblock %} 21 | 22 | {% block content %} 23 |
    24 | {% csrf_token %} 25 | 26 |
    27 | {% for field in form %} 28 |
    29 | {{ field.errors }} 30 | 31 | {{ field.label_tag }} 32 | 33 | {{ field }} 34 | 35 | {% if field.field.help_text %} 36 |

    {{ field.field.help_text|safe }}

    37 | {% endif %} 38 |
    39 | {% endfor %} 40 |
    41 | 42 |
    43 | 44 |
    45 |
    46 | {% endblock %} 47 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/includes/box.html: -------------------------------------------------------------------------------- 1 |
    2 |

    {% block box_title %}{% endblock box_title %}

    3 |
    4 | {% block box_content %}{% endblock box_content %} 5 |
    6 | {% block box_extra %}{% endblock box_extra %} 7 |
    8 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/includes/pagination.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 |
  • {{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %}
  • 3 | {% if pagination_required %} 4 | {% for num in page_range %} 5 |
  • {{ num }}
  • 6 | {% endfor %} 7 | {% endif %} 8 | {% if show_all_url %} 9 |
  • {% trans 'Show all' %}
  • 10 | {% endif %} 11 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/includes/sitemenu_accordion.html: -------------------------------------------------------------------------------- 1 | {% extends 'xadmin/includes/sitemenu_default.html' %} 2 | {% load i18n xadmin_tags %} 3 | 4 | 5 | {% block navbar_md %} 6 | 33 | {% endblock navbar_md %} 34 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/includes/sitemenu_default.html: -------------------------------------------------------------------------------- 1 | {% load i18n xadmin_tags %} 2 | 3 | 4 | {% block navbar_md %} 5 | 25 | {% endblock navbar_md %} 26 | 27 | {% block navbar_sm %} 28 | 52 | {% endblock navbar_sm %} 53 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/includes/submit_line.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% load xadmin_tags %} 3 |
    4 | {% if show_delete_link %} 5 | 6 | {% endif %} 7 | 8 | {% if show_save %} 9 | 13 | 14 | {% endif %} 15 | 16 | 22 | 23 | {% if show_delete_link %} 24 | {% trans "Delete" %} 25 | {% endif %} 26 | 27 | {% view_block 'submit_line' %} 28 |
    -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/includes/toggle_back.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/includes/toggle_menu.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/layout/field_value.html: -------------------------------------------------------------------------------- 1 |
    2 |
    {{ result.label|safe }}
    3 |
    4 |

    {{ result.val }}

    5 |
    6 |
    7 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/layout/field_value_td.html: -------------------------------------------------------------------------------- 1 | 2 | {{ result.val }} 3 | 4 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/layout/fieldset.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/includes/box.html" %} 2 | {% block box_class %}fieldset{% if fieldset.css_class %} {{ fieldset.css_class }}{% endif %}{% endblock box_class %} 3 | {% block box_attrs %}{% if fieldset.css_id %}id="{{ fieldset.css_id }}"{% endif %} {{ fieldset.flat_attrs|safe }}{% endblock box_attrs %} 4 | {% block box_title %}{{ legend|safe }}{% if fieldset.description %} {{fieldset.description}}{% endif %}{% endblock box_title %} 5 | {% block box_content %} 6 | {{ fields|safe }} 7 | {% endblock box_content %} 8 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/layout/input_group.html: -------------------------------------------------------------------------------- 1 | {% load crispy_forms_field %} 2 | 3 | {% if field.is_hidden %} 4 | {{ field }} 5 | {% else %} 6 |
    7 | 8 | {% if field.label and form_show_labels %} 9 | 12 | {% endif %} 13 | 14 |
    15 |
    16 | {% for input in inputs %} 17 | {% if input == '@@' %} 18 | {% crispy_field field %} 19 | {% else %} 20 | {{input|safe}} 21 | {% endif %} 22 | {% endfor %} 23 |
    24 | 25 | {% include 'bootstrap3/layout/help_text_and_errors.html' %} 26 |
    27 |
    28 | {% endif %} 29 | 30 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/layout/td-field.html: -------------------------------------------------------------------------------- 1 | {% load crispy_forms_field %} 2 | 3 | {% if field.is_hidden %} 4 | {{ field }} 5 | {% else %} 6 | 7 | {% if field.is_readonly %} 8 |

    {{ field.contents }}

    9 | {% else %} 10 | {% crispy_field field %} 11 | {% if field.errors %} 12 | {% for error in field.errors %} 13 | {{ error }} 14 | {% endfor %} 15 | {% endif %} 16 | {% endif %} 17 | 18 | {% endif %} 19 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/app_index.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/index.html" %} 2 | {% load i18n %} 3 | 4 | 5 | {% if not is_popup %} 6 | {% block breadcrumbs %} 7 | 17 | {% endblock %} 18 | {% endif %} 19 | 20 | {% block sidebar %}{% endblock %} 21 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/batch_change_form.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n l10n %} 3 | 4 | {% load xadmin_tags %} 5 | {% load crispy_forms_tags %} 6 | 7 | {% block breadcrumbs %} 8 | 13 | {% endblock %} 14 | 15 | {% block nav_title %}{% if model_icon %} {% endif %} 16 | {% blocktrans count counter=count %}Change one {{ objects_name }}{% plural %}Batch change {{ counter }} {{ objects_name }}{% endblocktrans %} 17 | {% endblock %} 18 | 19 | {% block content %} 20 |
    {% csrf_token %} 21 | {% if errors %} 22 |
    23 | 24 | {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} 25 |
    26 | {{ form.non_field_errors }} 27 | {% endif %} 28 | 29 | {% for obj in queryset %} 30 | 31 | {% endfor %} 32 | 33 | 34 | 35 | {% crispy form %} 36 | 37 |
    38 | 39 |
    40 |
    41 | {% endblock %} 42 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/dashboard.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n xadmin_tags %} 3 | 4 | 5 | {% block bodyclass %}dashboard{% endblock %} 6 | {% block breadcrumbs %}{% endblock %} 7 | 8 | {% block nav_title %} 9 | {% if icon %}{%endif%} {{ title }} 10 | {% endblock %} 11 | 12 | {% block nav_toggles %} 13 | {% include "xadmin/includes/toggle_menu.html" %} 14 | {% if has_add_widget_permission %} 15 | 16 | 17 | {% endif %} 18 | {% endblock %} 19 | 20 | {% block nav_btns %} 21 | {% if has_add_widget_permission %} 22 | 23 | {% trans "Add Widget" %} 24 | {% endif %} 25 | {% endblock %} 26 | 27 | {% block content %} 28 |
    29 | {% for c in columns %} 30 |
    31 | {% for widget in c.1 %} 32 | {{ widget.widget|safe }} 33 | {% endfor %} 34 |
    35 | {% endfor %} 36 |
    37 | 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/form.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | {% load crispy_forms_tags %} 6 | 7 | {% block nav_title %}{% if model_icon %} {% endif %} 8 | {{ title }}{% endblock %} 9 | 10 | {% block content %} 11 |
    {% csrf_token %} 12 | {% block form_top %}{% endblock %} 13 | {% view_block 'form_top' %} 14 | 15 | {% if errors %} 16 |
    17 | 18 | {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} 19 |
    20 | {{ form.non_field_errors }} 21 | {% endif %} 22 | 23 | {% view_block 'before_fieldsets' %} 24 | 25 | {% crispy form %} 26 | 27 | {% view_block 'after_fieldsets' %} 28 | 29 |
    30 | 31 | 32 |
    33 | 34 |
    35 | {% endblock %} 36 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/invalid_setup.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | 5 | {% block breadcrumbs %} 6 | 10 | {% endblock %} 11 | 12 | {% block content %} 13 |

    {% trans "Something's wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user." %}

    14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/logged_out.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | 5 | {% block extrastyle %}{{ block.super }} 6 | 9 | {% endblock %} 10 | 11 | {% block body %} 12 |
    13 | 14 |
    15 |
    16 |

    {% trans "Logout Success" %}

    17 |

    {% trans "Thanks for spending some quality time with the Web site today." %}

    18 |

    19 | {% trans 'Close Window' %} 20 | {% trans 'Log in again' %} 21 |

    22 |
    23 |
    24 | 25 |
    26 | 27 | {% endblock %} 28 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/model_dashboard.html: -------------------------------------------------------------------------------- 1 | {% extends 'xadmin/views/dashboard.html' %} 2 | {% load i18n xadmin_tags %} 3 | 4 | 5 | {% block breadcrumbs %} 6 | 15 | {% endblock %} 16 | 17 | {% block nav_toggles %} 18 | {% include "xadmin/includes/toggle_back.html" %} 19 | {% if has_change_permission %} 20 | 21 | {% endif %} 22 | {% endblock %} 23 | 24 | {% block nav_btns %} 25 | {% if has_change_permission %} 26 | {% trans "Edit" %} 27 | {% endif %} 28 | {% endblock %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/model_delete_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | 6 | {% block nav_title %}{{title}}{% endblock %} 7 | 8 | {% block content %} 9 | {% if perms_lacking or protected %} 10 | {% if perms_lacking %} 11 |
    {% blocktrans with escaped_object=object %}Deleting the {{ verbose_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}
    12 |
      13 | {% for obj in perms_lacking %} 14 |
    • {{ obj }}
    • 15 | {% endfor %} 16 |
    17 | {% endif %} 18 | {% if protected %} 19 |
    {% blocktrans with escaped_object=object %}Deleting the {{ verbose_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktrans %}
    20 |
      21 | {% for obj in protected %} 22 |
    • {{ obj }}
    • 23 | {% endfor %} 24 |
    25 | {% endif %} 26 | {% else %} 27 |
    {% blocktrans with escaped_object=object %}Are you sure you want to delete the {{ verbose_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktrans %}
    28 |
      {{ deleted_objects|unordered_list }}
    29 |
    {% csrf_token %} 30 |
    31 | 32 | {% view_block 'form_fields' %} 33 |
    34 | 35 | {% trans 'Cancel' %} 36 |
    37 |
    38 |
    39 | {% endif %} 40 | {% endblock %} 41 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/model_delete_selected_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n l10n %} 3 | 4 | {% load xadmin_tags %} 5 | 6 | {% block breadcrumbs %} 7 | 12 | {% endblock %} 13 | {% block nav_title %}{{title}}{% endblock %} 14 | 15 | {% block content %} 16 | {% if perms_lacking or protected %} 17 | {% if perms_lacking %} 18 |
    {% blocktrans %}Deleting the selected {{ objects_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}
    19 |
      20 | {% for obj in perms_lacking %} 21 |
    • {{ obj }}
    • 22 | {% endfor %} 23 |
    24 | {% endif %} 25 | {% if protected %} 26 |
    {% blocktrans %}Deleting the selected {{ objects_name }} would require deleting the following protected related objects:{% endblocktrans %}
    27 |
      28 | {% for obj in protected %} 29 |
    • {{ obj }}
    • 30 | {% endfor %} 31 |
    32 | {% endif %} 33 | {% else %} 34 |
    {% blocktrans %}Are you sure you want to delete the selected {{ objects_name }}? All of the following objects and their related items will be deleted:{% endblocktrans %}
    35 | {% for deletable_object in deletable_objects %} 36 |
      37 | {{ deletable_object|unordered_list }} 38 |
    39 | {% endfor %} 40 |
    {% csrf_token %} 41 |
    42 | {% for obj in queryset %} 43 | 44 | {% endfor %} 45 | 46 | 47 | {% view_block 'form_fields' %} 48 |
    49 | 50 | {% trans 'Cancel' %} 51 |
    52 |
    53 |
    54 | {% endif %} 55 | {% endblock %} 56 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/model_detail.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | {% load crispy_forms_tags %} 6 | 7 | {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} detail{% endblock %} 8 | 9 | {% block nav_title %} 10 | {% if model_icon %} {% endif %}{{ object|truncatewords:"18" }} 11 | {% endblock %} 12 | 13 | {% block nav_toggles %} 14 | {% include "xadmin/includes/toggle_back.html" %} 15 | {% if has_change_permission %} 16 | 17 | {% endif %} 18 | {% if has_delete_permission %} 19 | 20 | {% endif %} 21 | {% endblock %} 22 | 23 | {% block nav_btns %} 24 | {% if has_change_permission %} 25 | {% trans "Edit" %} 26 | {% endif %} 27 | {% if has_delete_permission %} 28 | {% trans "Delete" %} 29 | {% endif %} 30 | {% endblock %} 31 | 32 | {% block content %} 33 | {% view_block 'before_fieldsets' %} 34 | {% crispy form %} 35 | {% view_block 'after_fieldsets' %} 36 | {% endblock %} 37 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/model_form.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | {% load crispy_forms_tags %} 6 | 7 | {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} 8 | 9 | {% block nav_title %}{% if model_icon %} {% endif %} 10 | {{ title }}{% endblock %} 11 | 12 | {% block content %} 13 |
    {% csrf_token %} 14 | {% block form_top %}{% endblock %} 15 | {% view_block 'form_top' %} 16 | 17 | {% if errors %} 18 |
    19 | 20 | {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} 21 |
    22 | {% endif %} 23 | 24 | {% view_block 'before_fieldsets' %} 25 | 26 | {% crispy form %} 27 | 28 | {% view_block 'after_fieldsets' %} 29 | 30 | {% block submit_buttons_bottom %}{% include "xadmin/includes/submit_line.html" %}{% endblock %} 31 |
    32 | {% endblock %} 33 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/model_history.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | 6 | {% block breadcrumbs %} 7 | 13 | {% endblock %} 14 | 15 | {% block nav_title %} 16 | {{title}} 17 | {% endblock %} 18 | 19 | {% block content %} 20 |
    21 | {% if action_list %} 22 |
    {% csrf_token %} 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | {% for action in action_list %} 34 | 35 | 38 | 41 | 42 | 48 | 49 | 50 | {% endfor %} 51 | 52 |
    {% trans 'Diff' %}{% trans 'Date/time' %}{% trans 'User' %}{% trans 'Comment' %}
    36 | 37 | 39 | 40 | {{action.revision.date_created}} 43 | {% if action.revision.user %} 44 | {{action.revision.user.username}} 45 | {% if action.revision.user.first_name %} ({{action.revision.user.first_name}} {{action.revision.user.last_name}}){% endif %} 46 | {% endif %} 47 | {{action.revision.comment|linebreaksbr|default:""}}
    53 |
    54 | 55 |
    56 |
    57 | {% else %} 58 |

    {% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}

    59 | {% endif %} 60 |
    61 | {% endblock %} 62 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/quick_detail.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% load xadmin_tags %} 3 | {% load crispy_forms_tags %} 4 | {% crispy form %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/quick_form.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% load xadmin_tags %} 3 | {% load crispy_forms_tags %} 4 |
    {% csrf_token %} 5 | {% crispy form %} 6 |
    7 | {{ media.css }} 8 | {{ media.js }} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/recover_form.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/views/model_form.html" %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | 6 | {% block breadcrumbs %} 7 | 17 | {% endblock %} 18 | 19 | {% block content %} 20 |
    {% blocktrans %}Press the recover button below to recover this version of the object.{% endblocktrans %}
    21 | {{block.super}} 22 | {% endblock %} 23 | 24 | {% block submit_buttons_bottom %} 25 |
    26 | 27 |
    28 | {% endblock %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/recover_list.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | 6 | {% block breadcrumbs %} 7 | 12 | {% endblock %} 13 | 14 | {% block nav_title %} 15 | {{title}} 16 | {% endblock %} 17 | 18 | {% block content %} 19 |
    {% blocktrans %}Choose a date from the list below to recover a deleted version of an object.{% endblocktrans %}
    20 |
    21 | {% if deleted %} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | {% for deletion in deleted %} 31 | 32 | 33 | 34 | 35 | {% endfor %} 36 | 37 |
    {% trans 'Date/time' %}{{opts.verbose_name|capfirst}}
    {{deletion.revision.date_created}}{{deletion.object_repr}}
    38 | {% else %} 39 |

    {% trans "There are no deleted objects to recover." %}

    40 | {% endif %} 41 |
    42 | {% endblock %} 43 | 44 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/revision_diff.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/views/model_form.html" %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | 6 | {% block breadcrumbs %} 7 | 14 | {% endblock %} 15 | 16 | {% block nav_title %} 17 | {% blocktrans with opts.verbose_name as verbose_name %}Diff {{verbose_name}}{% endblocktrans %} 18 | {% endblock %} 19 | 20 | {% block content %} 21 |
    22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | {% for label, value_a, value_b, diff in diffs %} 32 | 33 | 34 | 35 | 36 | 37 | {% endfor %} 38 | 39 | 40 | 41 | 42 | 43 | 44 |
    {% trans 'Field' %}{% trans 'Version A' %}{% trans 'Version B' %}
    {{ label }}{{value_a}}{{value_b}}
    {% trans "Revert to" %} {% trans 'Revert' %} {% trans 'Revert' %}
    45 |
    46 | {% endblock %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/views/revision_form.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/views/model_form.html" %} 2 | {% load i18n %} 3 | 4 | {% load xadmin_tags %} 5 | 6 | {% block breadcrumbs %} 7 | 18 | {% endblock %} 19 | 20 | {% block content %} 21 |
    {% blocktrans %}Press the revert button below to revert to this version of the object.{% endblocktrans %}
    22 | {{block.super}} 23 | {% endblock %} 24 | 25 | {% block submit_buttons_bottom %} 26 |
    27 | 28 |
    29 | {% endblock %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/widgets/addform.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/widgets/base.html" %} 2 | {% load i18n xadmin_tags %} 3 | {% load crispy_forms_tags %} 4 | 5 | {% block box_class %}{{block.super}} form-horizontal short_label fieldset{% endblock box_class %} 6 | 7 | {% block content %} 8 |
    {% csrf_token %} 9 | {% crispy addform addhelper %} 10 |
    11 |
    12 | 16 | 19 |
    20 |
    21 |
    22 | {% endblock content %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/widgets/base.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/includes/box.html" %} 2 | {% load i18n xadmin_tags %} 3 | {% load crispy_forms_tags %} 4 | 5 | {% block box_attrs %}id="{{ widget_id }}"{% endblock box_attrs %} 6 | {% block box_class %}widget {{widget_type}}{% endblock box_class %} 7 | 8 | {% block box_title %} 9 | {% if widget.dashboard.widget_customiz %} 10 | 11 | {% endif %} 12 | {% block title %} 13 | 14 | {{ widget_title }} 15 | {% endblock title %} 16 | {% endblock box_title %} 17 | 18 | {% block box_content %} 19 | {% block content %} 20 | {{ content|safe }} 21 | {% endblock content %} 22 | {% endblock box_content %} 23 | 24 | {% block box_extra %} 25 | 47 | {% endblock box_extra %} 48 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/widgets/chart.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/widgets/base.html" %} 2 | {% load i18n xadmin_tags %} 3 | 4 | {% block content_css %}tabs{% endblock content_css %} 5 | {% block content %} 6 | {% if not widget.one_chart %} 7 | 12 | {% endif %} 13 |
    14 | {% for c in charts %} 15 |
    17 | {% endfor %} 18 |
    19 | {% endblock content %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/widgets/list.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/widgets/base.html" %} 2 | {% load i18n xadmin_tags %} 3 | 4 | {% block title %} 5 | {{ result_count }} 6 | {{ block.super }} 7 | {% endblock title %} 8 | 9 | {% block box_content_class %}{% if results %}nopadding x-scroll{% endif %}{% endblock box_content_class %} 10 | 11 | {% block content %} 12 | {% if results %} 13 | 14 | 15 | 16 | {% for o in result_headers %} 17 | 18 | {% endfor %} 19 | 20 | 21 | 22 | {% for row in results %} 23 | {% for o in row %} 24 | 27 | {% endfor %} 28 | 29 | {% endfor %} 30 | 31 |
    {{ o.text }}
    25 | {{ o.label }} 26 |
    32 | {% else %} 33 | {% trans "Empty list" %} 34 | {% endif %} 35 | {% endblock content %} -------------------------------------------------------------------------------- /extra_apps/xadmin/templates/xadmin/widgets/qbutton.html: -------------------------------------------------------------------------------- 1 | {% extends "xadmin/widgets/base.html" %} 2 | {% load i18n xadmin_tags %} 3 | 4 | {% block content %} 5 |
    6 | {% for btn in btns %} 7 | 13 | {% endfor %} 14 |
    15 | {% endblock content %} 16 | -------------------------------------------------------------------------------- /extra_apps/xadmin/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/extra_apps/xadmin/templatetags/__init__.py -------------------------------------------------------------------------------- /extra_apps/xadmin/templatetags/xadmin_tags.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | from django.template import Library 3 | from django.utils import six 4 | from django.utils.safestring import mark_safe 5 | 6 | from xadmin.util import static, vendor as util_vendor 7 | 8 | register = Library() 9 | 10 | @register.simple_tag(takes_context=True) 11 | def view_block(context, block_name, *args, **kwargs): 12 | if 'admin_view' not in context: 13 | return "" 14 | 15 | admin_view = context['admin_view'] 16 | nodes = [] 17 | method_name = 'block_%s' % block_name 18 | 19 | cls_str = str if six.PY3 else basestring 20 | for view in [admin_view] + admin_view.plugins: 21 | if hasattr(view, method_name) and callable(getattr(view, method_name)): 22 | block_func = getattr(view, method_name) 23 | result = block_func(context, nodes, *args, **kwargs) 24 | if result and isinstance(result, cls_str): 25 | nodes.append(result) 26 | if nodes: 27 | return mark_safe(''.join(nodes)) 28 | else: 29 | return "" 30 | 31 | @register.filter 32 | def admin_urlname(value, arg): 33 | return 'xadmin:%s_%s_%s' % (value.app_label, value.model_name, arg) 34 | 35 | static = register.simple_tag(static) 36 | 37 | 38 | @register.simple_tag(takes_context=True) 39 | def vendor(context, *tags): 40 | return util_vendor(*tags).render() 41 | 42 | 43 | class BlockcaptureNode(template.Node): 44 | """https://chriskief.com/2013/11/06/conditional-output-of-a-django-block/""" 45 | def __init__(self, nodelist, varname): 46 | self.nodelist = nodelist 47 | self.varname = varname 48 | 49 | def render(self, context): 50 | output = self.nodelist.render(context) 51 | context[self.varname] = str(output) 52 | return '' 53 | 54 | 55 | @register.tag(name='blockcapture') 56 | def do_blockcapture(parser, token): 57 | try: 58 | tag_name, args = token.contents.split(None, 1) 59 | except ValueError: 60 | raise template.TemplateSyntaxError("'blockcapture' node requires a variable name.") 61 | 62 | nodelist = parser.parse(('endblockcapture',)) 63 | parser.delete_first_token() 64 | 65 | return BlockcaptureNode(nodelist, args) 66 | -------------------------------------------------------------------------------- /extra_apps/xadmin/views/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from .base import BaseAdminPlugin, BaseAdminView, CommAdminView, ModelAdminView, filter_hook, csrf_protect_m, BaseAdminObject 4 | 5 | from .list import ListAdminView 6 | from .edit import CreateAdminView, UpdateAdminView, ModelFormAdminView 7 | from .delete import DeleteAdminView 8 | from .detail import DetailAdminView 9 | from .form import FormAdminView 10 | from .dashboard import Dashboard, BaseWidget, widget_manager, ModelDashboard 11 | from .website import IndexView, LoginView, LogoutView, UserSettingView 12 | 13 | __all__ = ( 14 | 'BaseAdminObject', 15 | 'BaseAdminPlugin', 'BaseAdminView', 'CommAdminView', 'ModelAdminView', 'ListAdminView', 16 | 'ModelFormAdminView', 'CreateAdminView', 'UpdateAdminView', 'DeleteAdminView', 'DetailAdminView', 'FormAdminView', 17 | 'Dashboard', 'BaseWidget', 18 | 'IndexView', 'LoginView', 'LogoutView', 19 | 'filter_hook', 'csrf_protect_m' 20 | ) 21 | 22 | # admin site-wide views 23 | def register_builtin_views(site): 24 | site.register_view(r'^$', IndexView, name='index') 25 | site.register_view(r'^login/$', LoginView, name='login') 26 | site.register_view(r'^logout/$', LogoutView, name='logout') 27 | 28 | site.register_view(r'^settings/user$', UserSettingView, name='user_settings') 29 | 30 | site.register_modelview(r'^$', ListAdminView, name='%s_%s_changelist') 31 | site.register_modelview(r'^add/$', CreateAdminView, name='%s_%s_add') 32 | site.register_modelview( 33 | r'^(.+)/delete/$', DeleteAdminView, name='%s_%s_delete') 34 | site.register_modelview( 35 | r'^(.+)/update/$', UpdateAdminView, name='%s_%s_change') 36 | site.register_modelview( 37 | r'^(.+)/detail/$', DetailAdminView, name='%s_%s_detail') 38 | site.register_modelview( 39 | r'^(.+)/dashboard/$', ModelDashboard, name='%s_%s_dashboard') 40 | 41 | site.set_loginview(LoginView) -------------------------------------------------------------------------------- /help_tools/Helper.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import division 3 | import datetime 4 | 5 | ''' 6 | 自定义分页类 7 | ''' 8 | def iPagination( params ): 9 | import math 10 | 11 | ret = { 12 | "is_prev":1, 13 | "is_next":1, 14 | "from" :0 , 15 | "end":0, 16 | "current":0, 17 | "total_pages":0, 18 | "page_size" : 0, 19 | "total" : 0, 20 | "url":params['url'] 21 | } 22 | 23 | total = int( params['total'] ) 24 | page_size = int( params['page_size'] ) 25 | page = int( params['page'] ) 26 | display = int( params['display'] ) 27 | total_pages = int( math.ceil( total / page_size ) ) 28 | total_pages = total_pages if total_pages > 0 else 1 29 | if page <= 1: 30 | ret['is_prev'] = 0 31 | 32 | if page >= total_pages: 33 | ret['is_next'] = 0 34 | 35 | semi = int( math.ceil( display / 2 ) ) 36 | 37 | if page - semi > 0 : 38 | ret['from'] = page - semi 39 | else: 40 | ret['from'] = 1 41 | 42 | if page + semi <= total_pages : 43 | ret['end'] = page + semi 44 | else: 45 | ret['end'] = total_pages 46 | 47 | ret['current'] = page 48 | ret['total_pages'] = total_pages 49 | ret['page_size'] = page_size 50 | ret['total'] = total 51 | ret['range'] = range( ret['from'],ret['end'] + 1 ) 52 | return ret 53 | 54 | -------------------------------------------------------------------------------- /help_tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/help_tools/__init__.py -------------------------------------------------------------------------------- /help_tools/format_time.py: -------------------------------------------------------------------------------- 1 | import time 2 | import datetime 3 | 4 | # 计算两个日期相差天数,自定义函数名,和两个日期的变量名。 5 | def Caltime(date1, date2): 6 | date1 = time.strptime(date1,"%Y-%m-%d") 7 | date2 = time.strptime(date2, "%Y-%m-%d") 8 | date1 = datetime.datetime(date1[0], date1[1], date1[2]) 9 | date2 = datetime.datetime(date2[0], date2[1], date2[2]) 10 | return (date2 - date1).days 11 | # print(Caltime(date1='2018-11-14',date2='2018-12-10')) 12 | # today_time=datetime.datetime.now().strftime("%Y-%m-%d") 13 | # all_day=Caltime('2015-10-15',today_time) 14 | # print(all_day) -------------------------------------------------------------------------------- /help_tools/send_mail_tools.py: -------------------------------------------------------------------------------- 1 | from django.core.mail import send_mail 2 | from random import randint 3 | from users.models import VerifyCodeEmail 4 | from MyBlog.settings import EMAIL_FROM 5 | 6 | 7 | def makecode(length): 8 | code_source = '1234567890QWERTYUIOPASDFGHJKLZXCVBNMzxcvbnmasdfghjklqwertyuiop' 9 | code = '' 10 | for i in range(length): 11 | code += code_source[randint(0, len(code_source) - 1)] 12 | return code 13 | 14 | 15 | def send_email_code(e, type): 16 | code = makecode(8) 17 | new = VerifyCodeEmail() 18 | new.email = e 19 | new.code = code 20 | new.code_type = type 21 | new.save() 22 | 23 | send_title = '' 24 | send_content = '' 25 | send_type = type 26 | if send_type == '1': 27 | send_title = '欢迎注册Debug5' 28 | send_content = '点击链接激活账号\n http://www.debug5.com/user_active/' + code 29 | send_mail(send_title, send_content, EMAIL_FROM, [e]) 30 | if send_type == '2': 31 | send_title = '请重置密码_From Debug5' 32 | send_content = '点击链接重置密码\n http://www.debug5.com/user/user_reset/' + code 33 | send_mail(send_title, send_content, EMAIL_FROM, [e]) 34 | if send_type == '3': 35 | send_title = '请重置邮箱_From Debug5' 36 | send_content = '请复制验证码去验证:' + code 37 | send_mail(send_title, send_content, EMAIL_FROM, [e]) 38 | 39 | 40 | def send_pwd(e, type, pwd): 41 | if type == '4': 42 | send_title = '您已修改密码' 43 | send_content = '您的新密码:' + pwd 44 | send_mail(send_title, send_content, EMAIL_FROM, [e]) 45 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MyBlog.settings") 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError: 10 | # The above import may fail for some other reason. Ensure that the 11 | # issue is really that Django is missing to avoid masking other 12 | # exceptions on Python 2. 13 | try: 14 | import django 15 | except ImportError: 16 | raise ImportError( 17 | "Couldn't import Django. Are you sure it's installed and " 18 | "available on your PYTHONPATH environment variable? Did you " 19 | "forget to activate a virtual environment?" 20 | ) 21 | raise 22 | execute_from_command_line(sys.argv) 23 | -------------------------------------------------------------------------------- /requirement.txt: -------------------------------------------------------------------------------- 1 | asn1crypto==0.24.0 2 | cffi==1.11.5 3 | cryptography==2.4.2 4 | diff-match-patch==20121119 5 | Django==1.11 6 | django-crispy-forms==1.7.2 7 | django-crontab==0.7.1 8 | django-formtools==2.1 9 | django-import-export==1.0.1 10 | django-reversion==3.0.0 11 | et-xmlfile==1.0.1 12 | future==0.15.2 13 | gunicorn==19.9.0 14 | httplib2==0.9.2 15 | idna==2.8 16 | jdcal==1.4 17 | mysqlclient==1.4.6 18 | odfpy==1.3.6 19 | openpyxl==2.5.7 20 | Pillow==5.2.0 21 | pycparser==2.19 22 | PyJWT==1.6.4 23 | PyMySQL==0.9.2 24 | pytz==2018.5 25 | PyYAML==3.13 26 | six==1.10.0 27 | tablib==0.12.1 28 | unicodecsv==0.14.1 29 | uWSGI==2.0.17.1 30 | xlrd==1.1.0 31 | xlwt==1.3.0 32 | -------------------------------------------------------------------------------- /static/css/nprogress.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8";#nprogress{pointer-events:none;}#nprogress .bar{background:#3399CC;position:fixed;z-index:1000;top:0;left:0;width:100%;height:2px;}#nprogress .peg{display:block;position:absolute;right:0px;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1.0;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translate(0px,-4px);}.nprogress-custom-parent{overflow:hidden;position:relative;}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute;}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);}}@keyframes nprogress-spinner{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}@media (min-width:1280px){#nprogress .spinner{display:block;position:fixed;z-index:10000;top:18px;right:15px;}#nprogress .spinner-icon{width:22px;height:22px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#3399CC;border-left-color:#4CC3FF;border-radius:50%;-webkit-animation:nprogress-spinner 400ms linear infinite;animation:nprogress-spinner 400ms linear infinite;}} -------------------------------------------------------------------------------- /static/css/test/dig_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/css/test/dig_close.png -------------------------------------------------------------------------------- /static/css/test/error-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/css/test/error-img.png -------------------------------------------------------------------------------- /static/css/test/saved_resource.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/css/test/top_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/css/test/top_down.png -------------------------------------------------------------------------------- /static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /static/fonts/TaurusNormal.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/TaurusNormal.ttf -------------------------------------------------------------------------------- /static/fonts/TaurusNormal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/TaurusNormal.woff -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /static/images/201610181557196870.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/201610181557196870.jpg -------------------------------------------------------------------------------- /static/images/201610241224221511.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/201610241224221511.jpg -------------------------------------------------------------------------------- /static/images/201610241227558789.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/201610241227558789.jpg -------------------------------------------------------------------------------- /static/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/Thumbs.db -------------------------------------------------------------------------------- /static/images/ad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/ad.jpg -------------------------------------------------------------------------------- /static/images/backtop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/backtop.png -------------------------------------------------------------------------------- /static/images/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/default.jpg -------------------------------------------------------------------------------- /static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/favicon.ico -------------------------------------------------------------------------------- /static/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/loading.gif -------------------------------------------------------------------------------- /static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/logo.png -------------------------------------------------------------------------------- /static/images/news-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/news-icon.png -------------------------------------------------------------------------------- /static/images/occupying.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/occupying.png -------------------------------------------------------------------------------- /static/images/timg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/images/timg.jpg -------------------------------------------------------------------------------- /static/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document); -------------------------------------------------------------------------------- /static/media/article/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/media/article/default.jpg -------------------------------------------------------------------------------- /static/media/article/default1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/media/article/default1.jpg -------------------------------------------------------------------------------- /static/media/article/default2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/media/article/default2.jpg -------------------------------------------------------------------------------- /static/media/article/default3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/media/article/default3.jpg -------------------------------------------------------------------------------- /static/media/article/default4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/media/article/default4.jpg -------------------------------------------------------------------------------- /static/media/article/default5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/static/media/article/default5.jpg -------------------------------------------------------------------------------- /t.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | print("choice([1, 2, 3, 5, 9]) : ", random.choice([1, 2, 3, 5, 9])) 4 | print("choice('A String') : ", random.choice('A String')) -------------------------------------------------------------------------------- /templates/.base.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whisnos/Django_Blog/afc29a8f0422e28936e7eed6324135ba40d3672f/templates/.base.html.swp -------------------------------------------------------------------------------- /templates/404.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %} 3 | 很抱歉,没有相关内容 4 | {% endblock %} 5 | {% block bigcontain %} 6 |
    7 |
    8 |
    9 |

    10 | 很抱歉,没有相关内容 o(╥﹏╥)o 11 |

    12 |
    返回首页 13 | 23 |
    24 | 25 |
    26 |
    27 |
    28 | {% endblock %} 29 | {% block mycss %} 30 | 76 | {% endblock %} 77 | -------------------------------------------------------------------------------- /templates/abc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Title 7 | 8 | 9 |

    Hello World1

    10 | 11 | -------------------------------------------------------------------------------- /templates/list.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}{{ cate_obj.title }}_Debug5_官方网站{% endblock %} 3 | {% block content %} 4 |
    5 |
    6 |

    {{ cate_obj.name }}主题

    7 |
    8 | 9 | {% for art in all_articles %} 10 | 29 | {% endfor %} 30 | 31 | {% include 'pagenation.html' %} 32 |
    33 | {% endblock %} 34 | {% block Tag %} 35 |
    36 |

    标签云

    37 |
    38 | 46 |
    47 |
    48 | {% endblock %} 49 | {% block TongJi %} 50 | {% endblock %} 51 | -------------------------------------------------------------------------------- /templates/none.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %} 3 | 很抱歉,没有相关内容 4 | {% endblock %} 5 | {% block bigcontain %} 6 |
    7 |
    8 |
    9 |

    10 | 很抱歉,没有相关内容 o(╥﹏╥)o 11 |

    12 |
    返回首页 13 | 23 |
    24 | 25 |
    26 |
    27 |
    28 | {% endblock %} 29 | {% block mycss %} 30 | 76 | {% endblock %} 77 | -------------------------------------------------------------------------------- /templates/pagenation.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 |
      5 | {% if pages.is_prev == 1 %} 6 |
    • 7 | 首页 8 |
    • 9 | {% endif %} 10 | 11 | {% for idx in pages.range %} 12 | {% if idx == pages.current %} 13 |
    • {{ idx }}
    • 14 | {% else %} 15 |
    • {{ idx }}
    • 16 | {% endif %} 17 | {% endfor %} 18 | {% if pages.is_next == 1 %} 19 |
    • 20 | 尾页 21 |
    • 22 | {% endif %} 23 |
    24 |
    25 |
    26 | -------------------------------------------------------------------------------- /templates/te.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /templates/user_center.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load staticfiles %} 3 | {% block title %} 4 | 个人中心页面 5 | {% endblock %} 6 | {% block bigcontain %} 7 |
    8 |
    9 | 26 |
    27 |
    28 |
    29 |

    标签云

    30 |
    31 | 33 |
    34 |
    35 | {% endblock %} 36 | {% block js %} 37 | 38 | 39 | {##} 40 | {% endblock %} -------------------------------------------------------------------------------- /templates/user_login.html: -------------------------------------------------------------------------------- 1 | 2 | {% load staticfiles %} 3 | 4 | 5 | 6 | 7 | {# #} 8 | 9 | 10 | 11 | 12 |
    13 |
    14 |

    登录!

    15 |
    16 |

    17 |
    18 | {% csrf_token %} 19 |
      20 |

      登录:

      21 |
    • 22 | 23 | {# #} 24 |
      25 |
    • 26 |
    • 27 | 28 | {# #} 29 |
      30 |
    • 31 | 32 |
      33 |
    34 |
    35 | 36 |
    37 | 38 | {#
    #} 39 | {# {% csrf_token %}#} 40 | {#
    #} 41 | {# #} 42 | {# #} 43 | {#
    #} 44 | {#
    #} 45 | {# #} 46 | {# #} 47 | {#
    #} 48 | {#
    #} 49 | {# 忘记密码?#} 50 | {#
    #} 51 | {# #} 52 | {#
    #} 53 | {{ msg }} 54 | {% for key,err in loginform.errors.items %} 55 | {{ err }} 56 | {% endfor %} 57 |
    58 | 59 | -------------------------------------------------------------------------------- /templates/user_register.html: -------------------------------------------------------------------------------- 1 | 2 | {% load staticfiles %} 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    12 |

    注册一个用户!

    13 |
    14 |

    15 |
    16 | {% csrf_token %} 17 |
      18 |

      注册:

      19 |
    • 20 | 21 |
      22 |
    • 23 |
    • 24 | 25 | {# #} 26 |
      27 |
    • 28 |
    • 29 | 30 | {# #} 31 |
      32 |
    • 33 | 34 |
      35 |
    36 |
    37 | 38 |
    39 | {{ msg }} 40 | {% for key,err in register_form.errors.items %} 41 | {{ err }} 42 | {% endfor %} 43 |
    44 | 45 | --------------------------------------------------------------------------------