From a4d102896cd261ced64316fce45dd264a797a903 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Fri, 18 Apr 2014 21:18:50 +0800 Subject: * updated settings.py, added settings_email.py * created directories 'static' and 'templates' * added app 'account', 'notice' * added app 'demo' --- account/__init__.py | 0 account/admin.py | 3 + account/models.py | 12 ++++ account/tests.py | 3 + account/views.py | 3 + db.sqlite3 | Bin 35840 -> 35840 bytes demo/__init__.py | 0 demo/forms.py | 37 ++++++++++ demo/templates/demo/base.html | 25 +++++++ demo/templates/demo/bootstrap.html | 3 + demo/templates/demo/form.html | 17 +++++ demo/templates/demo/form_horizontal.html | 17 +++++ demo/templates/demo/form_inline.html | 17 +++++ demo/templates/demo/form_with_files.html | 17 +++++ demo/templates/demo/home.html | 7 ++ demo/templates/demo/pagination.html | 25 +++++++ demo/urls.py | 32 +++++++++ demo/views.py | 79 +++++++++++++++++++++ django_skaschool/settings.py | 73 +++++++++++++++++-- django_skaschool/settings_email.py | 13 ++++ django_skaschool/urls.py | 30 ++++++-- notice/__init__.py | 0 notice/admin.py | 3 + notice/models.py | 3 + notice/tests.py | 3 + notice/views.py | 3 + page/__init__.py | 0 page/admin.py | 3 + page/models.py | 3 + page/tests.py | 3 + page/urls.py | 13 ++++ page/views.py | 3 + templates/base.html | 25 +++++++ templates/bootstrap.html | 3 + templates/form.html | 17 +++++ templates/form_horizontal.html | 17 +++++ templates/form_inline.html | 17 +++++ templates/form_with_files.html | 17 +++++ templates/home.html | 7 ++ templates/pagination.html | 25 +++++++ templates/registration/activation_email.txt | 14 ++++ .../registration/activation_email_subject.txt | 1 + templates/test.html | 3 + 43 files changed, 588 insertions(+), 8 deletions(-) create mode 100644 account/__init__.py create mode 100644 account/admin.py create mode 100644 account/models.py create mode 100644 account/tests.py create mode 100644 account/views.py create mode 100644 demo/__init__.py create mode 100644 demo/forms.py create mode 100644 demo/templates/demo/base.html create mode 100644 demo/templates/demo/bootstrap.html create mode 100644 demo/templates/demo/form.html create mode 100644 demo/templates/demo/form_horizontal.html create mode 100644 demo/templates/demo/form_inline.html create mode 100644 demo/templates/demo/form_with_files.html create mode 100644 demo/templates/demo/home.html create mode 100644 demo/templates/demo/pagination.html create mode 100644 demo/urls.py create mode 100644 demo/views.py create mode 100644 django_skaschool/settings_email.py create mode 100644 notice/__init__.py create mode 100644 notice/admin.py create mode 100644 notice/models.py create mode 100644 notice/tests.py create mode 100644 notice/views.py create mode 100644 page/__init__.py create mode 100644 page/admin.py create mode 100644 page/models.py create mode 100644 page/tests.py create mode 100644 page/urls.py create mode 100644 page/views.py create mode 100644 templates/base.html create mode 100644 templates/bootstrap.html create mode 100644 templates/form.html create mode 100644 templates/form_horizontal.html create mode 100644 templates/form_inline.html create mode 100644 templates/form_with_files.html create mode 100644 templates/home.html create mode 100644 templates/pagination.html create mode 100644 templates/registration/activation_email.txt create mode 100644 templates/registration/activation_email_subject.txt create mode 100644 templates/test.html diff --git a/account/__init__.py b/account/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/account/admin.py b/account/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/account/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/account/models.py b/account/models.py new file mode 100644 index 0000000..a3c2b0a --- /dev/null +++ b/account/models.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# +# app 'account' models +# registration, login, etc. +# + +from django.db import models +from django.contrib.auth.models import User + +class UserProfile(models.Model): + user = models.OneToOneField(User) + diff --git a/account/tests.py b/account/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/account/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/account/views.py b/account/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/account/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/db.sqlite3 b/db.sqlite3 index 56b779a..67c2663 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/demo/__init__.py b/demo/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/demo/forms.py b/demo/forms.py new file mode 100644 index 0000000..aea1ce7 --- /dev/null +++ b/demo/forms.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django import forms + +from bootstrap3.tests import TestForm + +RADIO_CHOICES = ( + ('1', 'Radio 1'), + ('2', 'Radio 2'), +) + +MEDIA_CHOICES = ( + ('Audio', ( + ('vinyl', 'Vinyl'), + ('cd', 'CD'), + ) + ), + ('Video', ( + ('vhs', 'VHS Tape'), + ('dvd', 'DVD'), + ) + ), + ('unknown', 'Unknown'), +) + + +class ContactForm(TestForm): + pass + + +class FilesForm(forms.Form): + text1 = forms.CharField() + file1 = forms.FileField() + file2 = forms.FileField(required=False) + file3 = forms.FileField(widget=forms.ClearableFileInput) + file4 = forms.FileField(required=False, widget=forms.ClearableFileInput) diff --git a/demo/templates/demo/base.html b/demo/templates/demo/base.html new file mode 100644 index 0000000..06dc6e3 --- /dev/null +++ b/demo/templates/demo/base.html @@ -0,0 +1,25 @@ +{% extends 'demo/bootstrap.html' %} + +{% load url from future %} + +{% load bootstrap3 %} + +{% block bootstrap3_content %} +
+

{% block title %}(no title){% endblock %}

+ +

+ home + form + form_horizontal + form_inline + form_with_files + pagination +

+ + {% bootstrap_messages %} + + {% block content %}(no content){% endblock %} +
+ +{% endblock %} diff --git a/demo/templates/demo/bootstrap.html b/demo/templates/demo/bootstrap.html new file mode 100644 index 0000000..5e5b581 --- /dev/null +++ b/demo/templates/demo/bootstrap.html @@ -0,0 +1,3 @@ +{% extends 'bootstrap3/bootstrap3.html' %} + +{% block bootstrap3_title %}{% block title %}{% endblock %}{% endblock %} diff --git a/demo/templates/demo/form.html b/demo/templates/demo/form.html new file mode 100644 index 0000000..d89672f --- /dev/null +++ b/demo/templates/demo/form.html @@ -0,0 +1,17 @@ +{% extends 'demo/base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Forms +{% endblock %} + +{% block content %} + +
+ {% csrf_token %} + {% bootstrap_form form %} + {% buttons submit='OK' reset="Cancel" %}{% endbuttons %} +
+ +{% endblock %} diff --git a/demo/templates/demo/form_horizontal.html b/demo/templates/demo/form_horizontal.html new file mode 100644 index 0000000..229d400 --- /dev/null +++ b/demo/templates/demo/form_horizontal.html @@ -0,0 +1,17 @@ +{% extends 'demo/base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Forms +{% endblock %} + +{% block content %} + +
+ {% csrf_token %} + {% bootstrap_form form layout="horizontal" %} + {% buttons submit='OK' reset='Cancel' layout='horizontal' %}{% endbuttons %} +
+ +{% endblock %} diff --git a/demo/templates/demo/form_inline.html b/demo/templates/demo/form_inline.html new file mode 100644 index 0000000..9f76c1e --- /dev/null +++ b/demo/templates/demo/form_inline.html @@ -0,0 +1,17 @@ +{% extends 'demo/base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Forms +{% endblock %} + +{% block content %} + +
+ {% csrf_token %} + {% bootstrap_form form layout='inline' %} + {% buttons submit='OK' reset='Cancel' layout='inline' %}{% endbuttons %} +
+ +{% endblock %} diff --git a/demo/templates/demo/form_with_files.html b/demo/templates/demo/form_with_files.html new file mode 100644 index 0000000..3e5e83f --- /dev/null +++ b/demo/templates/demo/form_with_files.html @@ -0,0 +1,17 @@ +{% extends 'demo/base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Forms +{% endblock %} + +{% block content %} + +
+ {% csrf_token %} + {% bootstrap_form form layout=layout %} + {% buttons submit='OK' reset="Cancel" %}{% endbuttons %} +
+ +{% endblock %} diff --git a/demo/templates/demo/home.html b/demo/templates/demo/home.html new file mode 100644 index 0000000..7166062 --- /dev/null +++ b/demo/templates/demo/home.html @@ -0,0 +1,7 @@ +{% extends 'demo/base.html' %} + +{% block title %}django-bootstrap3{% endblock %} + +{% block content %} + This is bootstrap3 for Django. +{% endblock %} \ No newline at end of file diff --git a/demo/templates/demo/pagination.html b/demo/templates/demo/pagination.html new file mode 100644 index 0000000..e7c1ed3 --- /dev/null +++ b/demo/templates/demo/pagination.html @@ -0,0 +1,25 @@ +{% extends 'demo/base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Pagination +{% endblock %} + +{% block content %} + + + {% for line in lines %} + + + + {% endfor %} +
{{ line }}
+ +
+ + {% bootstrap_pagination lines url="/pagination?page=1&flop=flip" extra="q=foo" size="small" %} + + {% bootstrap_pagination lines url="/pagination?page=1" size="large" %} + +{% endblock %} \ No newline at end of file diff --git a/demo/urls.py b/demo/urls.py new file mode 100644 index 0000000..b45a57a --- /dev/null +++ b/demo/urls.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.conf.urls import patterns, url + +from .views import HomePageView, FormHorizontalView, FormInlineView, PaginationView, FormWithFilesView, \ + DefaultFormView + +# Uncomment the next two lines to enable the admin: +# from django.contrib import admin +# admin.autodiscover() + +# urlpatterns = patterns('', +# # Examples: +# # url(r'^$', 'demo.views.home', name='home'), +# # url(r'^demo/', include('demo.foo.urls')), +# +# # Uncomment the admin/doc line below to enable admin documentation: +# # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), +# +# # Uncomment the next line to enable the admin: +# # url(r'^admin/', include(admin.site.urls)), +# ) + +urlpatterns = patterns('', + url(r'^$', HomePageView.as_view(), name='home'), + url(r'^form$', DefaultFormView.as_view(), name='form_default'), + url(r'^form_horizontal$', FormHorizontalView.as_view(), name='form_horizontal'), + url(r'^form_inline$', FormInlineView.as_view(), name='form_inline'), + url(r'^pagination$', PaginationView.as_view(), name='pagination'), + url(r'^form_with_files$', FormWithFilesView.as_view(), name='form_with_files'), +) diff --git a/demo/views.py b/demo/views.py new file mode 100644 index 0000000..07c25f0 --- /dev/null +++ b/demo/views.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +from django.core.files.storage import default_storage + +from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage +from django.db.models.fields.files import FieldFile +from django.views.generic import FormView +from django.views.generic.base import TemplateView +from django.contrib import messages + +from .forms import ContactForm, FilesForm + + +# http://yuji.wordpress.com/2013/01/30/django-form-field-in-initial-data-requires-a-fieldfile-instance/ +class FakeField(object): + storage = default_storage + + +fieldfile = FieldFile(None, FakeField, 'dummy.txt') + + +class HomePageView(TemplateView): + template_name = 'demo/home.html' + + def get_context_data(self, **kwargs): + context = super(HomePageView, self).get_context_data(**kwargs) + messages.info(self.request, 'This is a demo of a message.') + return context + + +class DefaultFormView(FormView): + template_name = 'demo/form.html' + form_class = ContactForm + + +class FormHorizontalView(FormView): + template_name = 'demo/form_horizontal.html' + form_class = ContactForm + + +class FormInlineView(FormView): + template_name = 'demo/form_inline.html' + form_class = ContactForm + + +class FormWithFilesView(FormView): + template_name = 'demo/form_with_files.html' + form_class = FilesForm + + def get_context_data(self, **kwargs): + context = super(FormWithFilesView, self).get_context_data(**kwargs) + context['layout'] = self.request.GET.get('layout', 'vertical') + return context + + def get_initial(self): + return { + 'file4': fieldfile, + } + +class PaginationView(TemplateView): + template_name = 'demo/pagination.html' + + def get_context_data(self, **kwargs): + context = super(PaginationView, self).get_context_data(**kwargs) + lines = [] + for i in range(10000): + lines.append('Line %s' % (i + 1)) + paginator = Paginator(lines, 10) + page = self.request.GET.get('page') + try: + show_lines = paginator.page(page) + except PageNotAnInteger: + # If page is not an integer, deliver first page. + show_lines = paginator.page(1) + except EmptyPage: + # If page is out of range (e.g. 9999), deliver last page of results. + show_lines = paginator.page(paginator.num_pages) + context['lines'] = show_lines + return context diff --git a/django_skaschool/settings.py b/django_skaschool/settings.py index 57f8598..b75ed25 100644 --- a/django_skaschool/settings.py +++ b/django_skaschool/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) +PROJECT_DIR = os.path.dirname(__file__) # Quick-start development settings - unsuitable for production @@ -28,16 +29,29 @@ ALLOWED_HOSTS = [] # Application definition - -INSTALLED_APPS = ( +# DEFAULT_APPS: django framework apps +DEFAULT_APPS = ( 'django.contrib.admin', 'django.contrib.auth', + 'django.contrib.sites', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', +) +# THIRD_PARTY_APPS +THIRD_PARTY_APPS = ( 'south', + 'bootstrap3', + 'registration', +) +# LOCAL_APPS +LOCAL_APPS = ( + 'page', + 'demo', ) +# INSTALLED_APPS +INSTALLED_APPS = DEFAULT_APPS + THIRD_PARTY_APPS + LOCAL_APPS MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', @@ -68,7 +82,8 @@ DATABASES = { LANGUAGE_CODE = 'en-us' -TIME_ZONE = 'UTC' +#TIME_ZONE = 'UTC' +TIME_ZONE = 'Asia/Shanghai' USE_I18N = True @@ -76,8 +91,58 @@ USE_L10N = True USE_TZ = True +## template directories +TEMPLATE_DIRS = ( + # Don't forget to use absolute paths, not relative paths. + os.path.join(BASE_DIR, 'templates'), +) + +## static directories +STATICFILES_DIRS = ( + # Don't forget to use absolute paths, not relative paths. + os.path.join(BASE_DIR, 'static'), +) + +## static root +# absolute path to the directory where 'collectstatic' will collect +# static files for deployment +#STATIC_ROOT = '/var/www/example.com/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'static_root') # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.6/howto/static-files/ - STATIC_URL = '/static/' + +## media root +# absolute filesystem path to the directory that hold user-uploaded files +#MEDIA_ROOT = '/var/www/example.com/media/' +# media url +MEDIA_URL = '/media/' + +## email settings +try: + from settings_email import * +except ImportError: + pass + + +################################################# +## bootstrap3 +BOOTSTRAP3 = { + 'jquery_url': '//code.jquery.com/jquery-1.11.0.min.js', + 'base_url': '//netdna.bootstrapcdn.com/bootstrap/3.1.1/', + 'css_url': None, + 'theme_url': None, + 'javascript_url': None, + 'javascript_in_head': False, + 'horizontal_label_class': 'col-md-2', + 'horizontal_field_class': 'col-md-4', +} + +## django-registration +# One-week activation window +ACCOUNT_ACTIVATION_DAYS = 7 +# whether registration of new accounts if currently permitted +REGISTRATION_OPEN = True + +# vim: set ts=4 sw=4 tw=0 fenc=utf-8 ft=python: diff --git a/django_skaschool/settings_email.py b/django_skaschool/settings_email.py new file mode 100644 index 0000000..e06cc3b --- /dev/null +++ b/django_skaschool/settings_email.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# +# django email settings +# + +EMAIL_HOST = "smtp.163.com" +EMAIL_HOST_USER = "skaschool2014" +EMAIL_HOST_PASSWORD = "2014skasjtu" +EMAIL_PORT = 25 +EMAIL_SUBJECT_PREFIX = '[Django] ' +EMAIL_USE_TLS = False +DEFAULT_FROM_EMAIL = "2014SKA School " + diff --git a/django_skaschool/urls.py b/django_skaschool/urls.py index f3ae807..770e524 100644 --- a/django_skaschool/urls.py +++ b/django_skaschool/urls.py @@ -1,12 +1,34 @@ +# -*- coding: utf-8 -*- + from django.conf.urls import patterns, include, url +from django.conf import settings from django.contrib import admin admin.autodiscover() -urlpatterns = patterns('', - # Examples: - # url(r'^$', 'django_skaschool.views.home', name='home'), - # url(r'^blog/', include('blog.urls')), +from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.views.generic.base import TemplateView + +urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), + url(r'^page/', include('page.urls')), + url(r'^$', TemplateView.as_view(template_name='index.html'), + name='index'), +) + +## demo +urlpatterns += patterns('', + url(r'^demo/', include('demo.urls')), ) + +## django-registration +urlpatterns += patterns('', + url(r'^accounts/', include('registration.backends.default.urls')), +) + +## staticfiles +if settings.DEBUG: + urlpatterns += staticfiles_urlpatterns() + + diff --git a/notice/__init__.py b/notice/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/notice/admin.py b/notice/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/notice/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/notice/models.py b/notice/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/notice/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/notice/tests.py b/notice/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/notice/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/notice/views.py b/notice/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/notice/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/page/__init__.py b/page/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/page/admin.py b/page/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/page/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/page/models.py b/page/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/page/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/page/tests.py b/page/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/page/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/page/urls.py b/page/urls.py new file mode 100644 index 0000000..daef1aa --- /dev/null +++ b/page/urls.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# +# urls.py for app 'page' +# + +from django.conf.urls import patterns, include, url +from django.views.generic.base import TemplateView + +urlpatterns = patterns('', + url(r'^test/$', TemplateView.as_view(template_name='test.html'), + name='test'), +) + diff --git a/page/views.py b/page/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/page/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..df9c111 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,25 @@ +{% extends 'bootstrap.html' %} + +{% load url from future %} + +{% load bootstrap3 %} + +{% block bootstrap3_content %} +
+

{% block title %}(no title){% endblock %}

+ +

+ home + form + form_horizontal + form_inline + form_with_files + pagination +

+ + {% bootstrap_messages %} + + {% block content %}(no content){% endblock %} +
+ +{% endblock %} diff --git a/templates/bootstrap.html b/templates/bootstrap.html new file mode 100644 index 0000000..5e5b581 --- /dev/null +++ b/templates/bootstrap.html @@ -0,0 +1,3 @@ +{% extends 'bootstrap3/bootstrap3.html' %} + +{% block bootstrap3_title %}{% block title %}{% endblock %}{% endblock %} diff --git a/templates/form.html b/templates/form.html new file mode 100644 index 0000000..dca0f83 --- /dev/null +++ b/templates/form.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Forms +{% endblock %} + +{% block content %} + +
+ {% csrf_token %} + {% bootstrap_form form %} + {% buttons submit='OK' reset="Cancel" %}{% endbuttons %} +
+ +{% endblock %} diff --git a/templates/form_horizontal.html b/templates/form_horizontal.html new file mode 100644 index 0000000..d9fc0c3 --- /dev/null +++ b/templates/form_horizontal.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Forms +{% endblock %} + +{% block content %} + +
+ {% csrf_token %} + {% bootstrap_form form layout="horizontal" %} + {% buttons submit='OK' reset='Cancel' layout='horizontal' %}{% endbuttons %} +
+ +{% endblock %} diff --git a/templates/form_inline.html b/templates/form_inline.html new file mode 100644 index 0000000..493bd18 --- /dev/null +++ b/templates/form_inline.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Forms +{% endblock %} + +{% block content %} + +
+ {% csrf_token %} + {% bootstrap_form form layout='inline' %} + {% buttons submit='OK' reset='Cancel' layout='inline' %}{% endbuttons %} +
+ +{% endblock %} diff --git a/templates/form_with_files.html b/templates/form_with_files.html new file mode 100644 index 0000000..3e5e83f --- /dev/null +++ b/templates/form_with_files.html @@ -0,0 +1,17 @@ +{% extends 'demo/base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Forms +{% endblock %} + +{% block content %} + +
+ {% csrf_token %} + {% bootstrap_form form layout=layout %} + {% buttons submit='OK' reset="Cancel" %}{% endbuttons %} +
+ +{% endblock %} diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..64d4501 --- /dev/null +++ b/templates/home.html @@ -0,0 +1,7 @@ +{% extends 'base.html' %} + +{% block title %}django-bootstrap3{% endblock %} + +{% block content %} + This is bootstrap3 for Django. +{% endblock %} diff --git a/templates/pagination.html b/templates/pagination.html new file mode 100644 index 0000000..ed11d4f --- /dev/null +++ b/templates/pagination.html @@ -0,0 +1,25 @@ +{% extends 'base.html' %} + +{% load bootstrap3 %} + +{% block title %} + Pagination +{% endblock %} + +{% block content %} + + + {% for line in lines %} + + + + {% endfor %} +
{{ line }}
+ +
+ + {% bootstrap_pagination lines url="/pagination?page=1&flop=flip" extra="q=foo" size="small" %} + + {% bootstrap_pagination lines url="/pagination?page=1" size="large" %} + +{% endblock %} diff --git a/templates/registration/activation_email.txt b/templates/registration/activation_email.txt new file mode 100644 index 0000000..48bee50 --- /dev/null +++ b/templates/registration/activation_email.txt @@ -0,0 +1,14 @@ +Dear {% username %}, + +Please follow the link below to activate your account at +"2014 SKA Summer School". + +{% activation_key %} +{% expiration_days %} +{% site %} + + +Best regards. + +2014 SKA Summer School Team + diff --git a/templates/registration/activation_email_subject.txt b/templates/registration/activation_email_subject.txt new file mode 100644 index 0000000..d5fe380 --- /dev/null +++ b/templates/registration/activation_email_subject.txt @@ -0,0 +1 @@ +激活您的账号 diff --git a/templates/test.html b/templates/test.html new file mode 100644 index 0000000..85ec3e6 --- /dev/null +++ b/templates/test.html @@ -0,0 +1,3 @@ +{% extends 'base.html' %} + +{# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=htmldjango.html: #} -- cgit v1.2.2