Skip to content

Commit d3221c3

Browse files
committed
Update docs
1 parent 70fb31c commit d3221c3

File tree

4 files changed

+23
-56
lines changed

4 files changed

+23
-56
lines changed

CONTRIBUTING.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[![Jazzband](https://jazzband.co/static/img/jazzband.svg)](https://jazzband.co/)
2+
3+
This is a [Jazzband](https://jazzband.co/) project. By contributing you agree to abide by the [Contributor Code of Conduct](https://jazzband.co/docs/conduct) and follow the [guidelines](https://jazzband.co/docs/guidelines).

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include LICENSE AUTHORS README.rst MANIFEST.in tox.ini .coveragerc
1+
include LICENSE AUTHORS README.rst MANIFEST.in tox.ini .coveragerc CONTRIBUTING.md
22
recursive-include docs *.txt
33
recursive-include dbtemplates/locale *
44
recursive-include dbtemplates/static/dbtemplates *.css *.js

docs/changelog.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
Changelog
22
=========
33

4-
v2.0 (unreleased)
4+
v2.0 (2016-09-29)
55
-----------------
66

7-
* Moved to Jazzband: https://github.com/jazzband/django-dbtemplates
7+
.. warning::
8+
9+
This is a backwards-incompatible release!
10+
11+
* Moved maintenance to the `Jazzband <https://jazzband.co/>`_
812

913
* Dropped support for Python 2.6
1014

docs/overview.txt

+13-53
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Setup
3232
TEMPLATES = [
3333
{
3434
'BACKEND': 'django.template.backends.django.DjangoTemplates',
35-
'DIRS': [ # your template dirs here
35+
'DIRS': [ # your template dirs here
3636
],
37-
'APP_DIRS': False,
37+
'APP_DIRS': False,
3838
'OPTIONS': {
3939
'context_processors': [
4040
'django.contrib.auth.context_processors.auth',
@@ -47,30 +47,31 @@ Setup
4747
'django.template.context_processors.request',
4848
],
4949
'loaders': [
50-
'django.template.loaders.filesystem.Loader',
51-
'django.template.loaders.app_directories.Loader',
52-
'dbtemplates.loader.Loader',
50+
'django.template.loaders.filesystem.Loader',
51+
'django.template.loaders.app_directories.Loader',
52+
'dbtemplates.loader.Loader',
5353
],
5454
},
5555
},
5656
]
5757

58-
Order of ``TEMPLATES.OPTIONS.loaders`` is important. In the former example, templates from database
59-
will be used as a fallback (ie. when template does not exists in other locations).
60-
If you want template from database to be used to override templates in other locations,
61-
put ``dbtemplates.loader.Loader`` at beginning of ``loaders``.
58+
The order of ``TEMPLATES.OPTIONS.loaders`` is important. In the former
59+
example, templates from the database will be used as a fallback (ie. when
60+
the template does not exists in other locations). If you want the template
61+
from the database to be used to override templates in other locations,
62+
put ``dbtemplates.loader.Loader`` at the beginning of ``loaders``.
6263

63-
4. Sync your database ``python manage.py syncdb``
64+
4. Sync your database ``python manage.py migrate``
6465
5. Restart your Django server
6566

66-
.. _Git repository: http://github.com/jazzband/django-dbtemplates/
67+
.. _Git repository: https://github.com/jazzband/django-dbtemplates/
6768

6869
Usage
6970
=====
7071

7172
Creating database templates is pretty simple: Just open the admin interface
7273
of your Django-based site in your browser and click on "Templates" in the
73-
"Dbtemplates" section.
74+
"Database templates" section.
7475

7576
There you only need to fill in the ``name`` field with the identifier, Django
7677
is supposed to use while searching for templates, e.g.
@@ -84,44 +85,3 @@ other template loaders. For example, if you have a template called
8485
contents in the database, you just need to leave the content field empty to
8586
automatically populate it. That's especially useful if you don't want to
8687
copy and paste its content manually to the textarea.
87-
88-
Example
89-
=======
90-
91-
``dbtemplates`` comes with an example Django project that let's you try it
92-
out. The example uses Django's own `flatpages app`_ to enable you to create
93-
a simple page using ``dbtemplates``. Flat pages are a perfect fit to
94-
dbtemplates since they come prepackaged and are simple to use.
95-
96-
Here is how it works:
97-
98-
1. Open your command line and change to the ``example`` directory in the
99-
directory with the extracted source distribution.
100-
2. Run ``python manage.py syncdb`` and follow the instructions.
101-
3. Run ``python manage.py runserver`` and open your favorite browser with the
102-
address http://127.0.0.1:8000/admin/.
103-
4. Next add a new `Template` object in the ``dbtemplates`` section and use
104-
``flatpages/default.html`` as the value for the ``name`` field. For the
105-
``content`` field use this example::
106-
107-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
108-
"http://www.w3.org/TR/REC-html40/loose.dtd">
109-
<html>
110-
<head>
111-
<title>{{ flatpage.title }}</title>
112-
</head>
113-
<body>
114-
{{ flatpage.content }}
115-
</body>
116-
</html>
117-
118-
5. Return to the home screen of the admin interface and add a new flat page.
119-
Use ``/`` (yep, just a forward slash) and whatever ``title`` and
120-
``content`` you prefer. Please make sure you select the default site
121-
``example.com`` before you save the flat page.
122-
6. Visit http://127.0.0.1:8000/ and see the flat page you just created
123-
rendered with the ``flatpages/default.html`` template provided by
124-
``dbtemplates``.
125-
126-
.. _flatpages app: http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/
127-

0 commit comments

Comments
 (0)