Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactored docs from a separate project into django_website/docs.

  • Loading branch information...
commit 5f66182a5225a73be74f246789e4fcd9464f9ad0 1 parent 1c5b6b8
@jacobian jacobian authored
Showing with 97 additions and 114 deletions.
  1. +8 −0 README.txt
  2. 0  {djangodocs/templatetags → django_website/docs}/__init__.py
  3. 0  {djangodocs → django_website/docs}/admin.py
  4. +3 −3 djangodocs/fixtures/releases.json → django_website/docs/fixtures/doc_releases.json
  5. +1 −1  {djangodocs → django_website/docs}/fixtures/initial_data.json
  6. 0  {djangodocs → django_website/docs}/forms.py
  7. 0  {djangodocs/management/commands → django_website/docs/management}/__init__.py
  8. 0  {djangodocs/management → django_website/docs/management/commands}/__init__.py
  9. 0  {djangodocs → django_website/docs}/management/commands/update_docs.py
  10. 0  {djangodocs → django_website/docs}/models.py
  11. +15 −37 {djangodocs → django_website/docs}/templates/docs/doc.html
  12. 0  {djangodocs → django_website/docs}/templates/docs/genindex.html
  13. +8 −0 django_website/docs/templates/docs/index.html
  14. 0  {djangodocs → django_website/docs}/templates/docs/modindex.html
  15. 0  {djangodocs → django_website/docs}/templates/docs/search.html
  16. 0  {djangodocs → django_website/docs}/templates/docs/search_form.html
  17. 0  {djangodocs → django_website/docs/templatetags}/__init__.py
  18. +2 −2 {djangodocs → django_website/docs}/templatetags/docs.py
  19. 0  {djangodocs → django_website/docs}/utils.py
  20. 0  {djangodocs → django_website/docs}/views.py
  21. 0  django_website/settings/__init__.py
  22. +14 −0 django_website/settings/docs.py
  23. +16 −6 django_website/{settings.py → settings/www.py}
  24. 0  django_website/urls/__init__.py
  25. +1 −1  djangodocs/urls.py → django_website/urls/docs.py
  26. 0  django_website/{urls.py → urls/www.py}
  27. +0 −22 djangodocs/settings.py
  28. +0 −31 djangodocs/templates/docs/index.html
  29. +0 −9 manage-www.py
  30. +2 −2 manage-docs.py → manage.py
  31. +5 −0 media/css/docs/docs.css
  32. +22 −0 media/css/docs/index.css
View
8 README.txt
@@ -0,0 +1,8 @@
+TO run locally, do the usual::
+
+ python manage.py runserver.
+
+This runs as ``www.djangoproject.com``. To run locally as
+``docs.djangoproject.com``, use::
+
+ python manage.py runserver --settings=django_website.settings.docs
View
0  djangodocs/templatetags/__init__.py → django_website/docs/__init__.py
File renamed without changes
View
0  djangodocs/admin.py → django_website/docs/admin.py
File renamed without changes
View
6 djangodocs/fixtures/releases.json → ...o_website/docs/fixtures/doc_releases.json
@@ -1,6 +1,6 @@
[
{
- "model": "djangodocs.documentrelease",
+ "model": "docs.documentrelease",
"pk": 2,
"fields": {
"lang": "en",
@@ -11,7 +11,7 @@
}
},
{
- "model": "djangodocs.documentrelease",
+ "model": "docs.documentrelease",
"pk": 3,
"fields": {
"lang": "en",
@@ -22,7 +22,7 @@
}
},
{
- "model": "djangodocs.documentrelease",
+ "model": "docs.documentrelease",
"pk": 4,
"fields": {
"lang": "en",
View
2  djangodocs/fixtures/initial_data.json → ...o_website/docs/fixtures/initial_data.json
@@ -1,6 +1,6 @@
[
{
- "model": "djangodocs.documentrelease",
+ "model": "docs.documentrelease",
"pk": 1,
"fields": {
"lang": "en",
View
0  djangodocs/forms.py → django_website/docs/forms.py
File renamed without changes
View
0  djangodocs/management/commands/__init__.py → django_website/docs/management/__init__.py
File renamed without changes
View
0  djangodocs/management/__init__.py → ...site/docs/management/commands/__init__.py
File renamed without changes
View
0  ...godocs/management/commands/update_docs.py → ...e/docs/management/commands/update_docs.py
File renamed without changes
View
0  djangodocs/models.py → django_website/docs/models.py
File renamed without changes
View
52 djangodocs/templates/docs/doc.html → django_website/docs/templates/docs/doc.html
@@ -4,30 +4,7 @@
{% block extrahead %}
{{ block.super }}
- <style type="text/css" media="screen">
- #docs-search {
- color: #000;
- float: right;
- }
- #docs-search form {
- font-size: 92%;
- margin: 0;
- padding: 1em 1em 0;
- white-space: nowrap;
- }
- form.search ul {
- list-style: none;
- margin: 0;
- padding: 0;
- }
- form.search li {
- display: inline;
- padding-right: 1em;
- }
- form.search .query {
- width: 18em;
- }
- </style>
+ <link rel="stylesheet" href="{{ MEDIA_URL }}css/docs/docs.css" type="text/css" />
<link rel="stylesheet" href="{{ MEDIA_URL }}css/pygments.css" type="text/css" />
{% endblock %}
@@ -41,18 +18,19 @@
{% load docs %}
{% get_all_doc_versions docurl as versions %}
<h2 class="deck">
- {% ifequal version "dev" %}
- This document is for Django's development version, which can be
- significantly different from previous releases. Get old docs here:
- {% for version in versions|slice:"1:" %}
- <a href="/en/{{ version }}/{{ docurl }}">{{ version }}</a>{% if forloop.last %}.{% else %},{% endif %}
- {% endfor %}
- {% else %}
- {% ifequal versions.0 "dev" %}
+ {% if version == "dev" %}
+ This document is for Django's development version, which can be
+ significantly different from previous releases. Get older docs here:
+ {% for version in versions %}
+ {% if version != "dev" %}
+ <a href="{% url document-detail lang=lang, version=version, url=docurl %}">
+ {{ version }}</a>{% if forloop.last %}.{% else %},{% endif %}
+ {% endif %}
+ {% endfor %}
+ {% else %}
This document describes Django {{ version }}. For development docs,
- <a href="/en/dev/{{ docurl }}">go here</a>.
- {% endifequal %}
- {% endifequal %}
+ <a href="{% url document-detail lang=lang, version="dev", url=docurl %}">go here</a>.
+ {% endif %}
</h2>
{{ doc.body|safe }}
{% endblock %}
@@ -62,8 +40,8 @@ <h2 id="comments">Questions/Feedback</h2>
<p>Having trouble? We'd like to help!</p>
<ul>
<li>
- Try the <a href="/en/dev/faq/">FAQ</a> -— it's got answers to many common
- questions.
+ Try the <a href="{% url document-detail lang=lang, version=version, url="faq" %}">FAQ</a>
+ -— it's got answers to many common questions.
</li>
<li>
Search for information in the <a
View
0  djangodocs/templates/docs/genindex.html → ...website/docs/templates/docs/genindex.html
File renamed without changes
View
8 django_website/docs/templates/docs/index.html
@@ -0,0 +1,8 @@
+{% extends "docs/doc.html" %}
+
+{% block extrahead %}
+ {{ block.super }}
+ <link rel="stylesheet" href="{{ MEDIA_URL }}css/docs/index.css" type="text/css" charset="utf-8">
+{% endblock %}
+
+{% block toc-wrapper %}{% endblock %}
View
0  djangodocs/templates/docs/modindex.html → ...website/docs/templates/docs/modindex.html
File renamed without changes
View
0  djangodocs/templates/docs/search.html → ...o_website/docs/templates/docs/search.html
File renamed without changes
View
0  djangodocs/templates/docs/search_form.html → ...site/docs/templates/docs/search_form.html
File renamed without changes
View
0  djangodocs/__init__.py → django_website/docs/templatetags/__init__.py
File renamed without changes
View
4 djangodocs/templatetags/docs.py → django_website/docs/templatetags/docs.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import
from django import template
-from djangodocs.forms import SearchForm
+from ..forms import SearchForm
from ..models import DocumentRelease
from ..utils import get_doc_root, get_doc_path
@@ -58,6 +58,6 @@ def render(self, context):
versions.append(release.version)
# Save the versions into the context
- context[self.asvar] = versions
+ context[self.asvar] = reversed(sorted(versions))
return ''
View
0  djangodocs/utils.py → django_website/docs/utils.py
File renamed without changes
View
0  djangodocs/views.py → django_website/docs/views.py
File renamed without changes
View
0  django_website/settings/__init__.py
No changes.
View
14 django_website/settings/docs.py
@@ -0,0 +1,14 @@
+from django_website.settings.www import *
+
+PREPEND_WWW = False
+APPEND_SLASH = True
+INSTALLED_APPS = ['django_website.docs']
+TEMPLATE_CONTEXT_PROCESSORS += ["django.core.context_processors.request"]
+ROOT_URLCONF = 'django_website.urls.docs'
+CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
+
+# Where to store the build Sphinx docs.
+if DEVELOPMENT_MODE:
+ DOCS_BUILD_ROOT = '/tmp/djangodocs'
+else:
+ DOCS_BUILD_ROOT = "/home/djangodocs/"
View
22 django_website/settings.py → django_website/settings/www.py
@@ -1,6 +1,10 @@
-import os, platform
+# Settings for www.djangoproject.com
-BASE = os.path.abspath(os.path.dirname(__file__))
+import platform
+from unipath import FSPath as Path
+
+# The full path to the django_website directory.
+BASE = Path(__file__).absolute().ancestor(2)
# Far too clever trick to know if we're running on the deployment server.
DEVELOPMENT_MODE = (platform.node() != "djangoproject")
@@ -13,14 +17,14 @@
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'djangoproject'
-TEMPLATE_DIRS = [os.path.join(os.path.dirname(__file__), "templates")]
+TEMPLATE_DIRS = [BASE.child('templates')]
if DEVELOPMENT_MODE:
DEBUG = True
PREPEND_WWW = False
CACHE_BACKEND = "dummy:///"
DJANGO_SVN_ROOT = "http://code.djangoproject.com/svn/django/"
- MEDIA_ROOT = os.path.abspath(os.path.join(BASE, '..', 'media'))
+ MEDIA_ROOT = BASE.parent.child('media')
MEDIA_URL = "/media/"
ADMIN_MEDIA_PREFIX = '/admin_media/'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
@@ -36,7 +40,7 @@
ADMIN_MEDIA_PREFIX = 'http://media.djangoproject.com/admin/'
SITE_ID = 1
-ROOT_URLCONF = 'django_website.urls'
+ROOT_URLCONF = 'django_website.urls.www'
INSTALLED_APPS = (
'django.contrib.sites',
'django.contrib.auth',
@@ -50,7 +54,7 @@
'django.contrib.sitemaps',
'django_website.blog',
'django_website.aggregator',
- 'djangodocs',
+ 'django_website.docs',
'registration',
)
@@ -76,6 +80,12 @@
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)
+TEMPLATE_CONTEXT_PROCESSORS = [
+ "django.contrib.auth.context_processors.auth",
+ "django.core.context_processors.debug",
+ "django.core.context_processors.i18n",
+ "django.core.context_processors.media",
+]
USE_I18N = False
View
0  django_website/urls/__init__.py
No changes.
View
2  djangodocs/urls.py → django_website/urls/docs.py
@@ -1,6 +1,6 @@
from django.conf import settings
from django.conf.urls.defaults import *
-from . import views
+from ..docs import views
urlpatterns = patterns('',
url(
View
0  django_website/urls.py → django_website/urls/www.py
File renamed without changes
View
22 djangodocs/settings.py
@@ -1,22 +0,0 @@
-from django_website.settings import *
-
-PREPEND_WWW = False
-APPEND_SLASH = True
-INSTALLED_APPS = ['djangodocs']
-TEMPLATE_DIRS = [os.path.join(os.path.dirname(__file__), "templates")] + TEMPLATE_DIRS
-TEMPLATE_CONTEXT_PROCESSORS = [
- "django.contrib.auth.context_processors.auth",
- "django.core.context_processors.debug",
- "django.core.context_processors.i18n",
- "django.core.context_processors.media",
- "django.core.context_processors.request",
-]
-
-ROOT_URLCONF = 'djangodocs.urls'
-CACHE_MIDDLEWARE_KEY_PREFIX = 'djangodocs'
-
-# Where to store the build Sphinx docs.
-if DEVELOPMENT_MODE:
- DOCS_BUILD_ROOT = '/tmp/djangodocs'
-else:
- DOCS_BUILD_ROOT = "/home/djangodocs/"
View
31 djangodocs/templates/docs/index.html
@@ -1,31 +0,0 @@
-{% extends "docs/doc.html" %}
-
-{% block extrahead %}
- {{ block.super }}
- <style type="text/css" media="screen">
-
- p.rubric { font-size:150%; font-weight:normal; margin-bottom:.2em; color:#487858; }
- div.section dt { font-weight: normal; }
-
- #s-getting-help { float: right; width: 40%; background: #E1ECE2; padding: 1em; margin: 2em 0 2em 2em; }
- #s-getting-help h2 { margin: 0; }
-
- #s-django-documentation div.section div.section h3 { margin: 0; }
- #s-django-documentation div.section div.section { background: #E1ECE2; padding: 1em; margin: 2em 0 2em 57%; }
- #s-django-documentation div.section div.section a.reference { white-space: nowrap; }
-
- #s-using-django dl,
- #s-add-on-contrib-applications dl,
- #s-solving-specific-problems dl,
- #s-reference dl
- { float: left; width: 57%; }
-
- #s-add-on-contrib-applications,
- #s-solving-specific-problems,
- #s-reference,
- #s-and-all-the-rest
- { clear: left; }
- </style>
-{% endblock %}
-
-{% block toc-wrapper %}{% endblock %}
View
9 manage-www.py
@@ -1,9 +0,0 @@
-#!/usr/bin/env python -Wall
-
-import os
-import sys
-sys.path.append(os.path.abspath(os.path.dirname(__file__)))
-
-import django_website.settings
-from django.core.management import execute_manager
-execute_manager(django_website.settings)
View
4 manage-docs.py → manage.py
@@ -4,6 +4,6 @@
import sys
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
-import djangodocs.settings
+import django_website.settings.www
from django.core.management import execute_manager
-execute_manager(djangodocs.settings)
+execute_manager(django_website.settings.www)
View
5 media/css/docs/docs.css
@@ -0,0 +1,5 @@
+#docs-search { color: #000; float: right; }
+#docs-search form { font-size: 92%; margin: 0; padding: 1em 1em 0; white-space: nowrap; }
+form.search ul { list-style: none; margin: 0; padding: 0; }
+form.search li { display: inline; padding-right: 1em; }
+form.search .query { width: 18em; }
View
22 media/css/docs/index.css
@@ -0,0 +1,22 @@
+
+p.rubric { font-size:150%; font-weight:normal; margin-bottom:.2em; color:#487858; }
+div.section dt { font-weight: normal; }
+
+#s-getting-help { float: right; width: 40%; background: #E1ECE2; padding: 1em; margin: 2em 0 2em 2em; }
+#s-getting-help h2 { margin: 0; }
+
+#s-django-documentation div.section div.section h3 { margin: 0; }
+#s-django-documentation div.section div.section { background: #E1ECE2; padding: 1em; margin: 2em 0 2em 57%; }
+#s-django-documentation div.section div.section a.reference { white-space: nowrap; }
+
+#s-using-django dl,
+#s-add-on-contrib-applications dl,
+#s-solving-specific-problems dl,
+#s-reference dl
+ { float: left; width: 57%; }
+
+#s-add-on-contrib-applications,
+#s-solving-specific-problems,
+#s-reference,
+#s-and-all-the-rest
+ { clear: left; }
Please sign in to comment.
Something went wrong with that request. Please try again.