Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #627 -- BACKWARDS-INCOMPATIBLE CHANGE. Admin is now an app, not…

… a middleware. See BackwardsIncompatibleChanges for a full list of changes and information on how to update your code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@948 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f07e5d4f5df5ca9ca3366d7ecc4b01c490c13198 1 parent fd3d579
Adrian Holovaty authored October 19, 2005

Showing 101 changed files with 142 additions and 377 deletions. Show diff stats Hide diff stats

  1. 10  django/conf/project_template/{settings/main.py → settings.py}
  2. 0  django/conf/project_template/settings/__init__.py
  3. 18  django/conf/project_template/settings/admin.py
  4. 0  django/conf/project_template/settings/urls/__init__.py
  5. 6  django/conf/project_template/settings/urls/admin.py
  6. 3  django/conf/project_template/{settings/urls/main.py → urls.py}
  7. 0  django/{conf/admin_media → contrib/admin/media}/css/base.css
  8. 0  django/{conf/admin_media → contrib/admin/media}/css/changelists.css
  9. 0  django/{conf/admin_media → contrib/admin/media}/css/global.css
  10. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/arrow-down.gif
  11. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/arrow-up.gif
  12. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/changelist-bg.gif
  13. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/chooser-bg.gif
  14. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/chooser_stacked-bg.gif
  15. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/default-bg-reverse.gif
  16. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/default-bg.gif
  17. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon-no.gif
  18. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon-yes.gif
  19. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_addlink.gif
  20. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_alert.gif
  21. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_calendar.gif
  22. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_changelink.gif
  23. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_clock.gif
  24. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_deletelink.gif
  25. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_error.gif
  26. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_searchbox.png
  27. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/icon_success.gif
  28. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/nav-bg-grabber.gif
  29. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/nav-bg-reverse.gif
  30. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/nav-bg.gif
  31. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/selector-add.gif
  32. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/selector-addall.gif
  33. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/selector-remove.gif
  34. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/selector-removeall.gif
  35. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/selector-search.gif
  36. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/selector_stacked-add.gif
  37. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/selector_stacked-remove.gif
  38. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/tool-left.gif
  39. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/tool-left_over.gif
  40. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/tool-right.gif
  41. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/tool-right_over.gif
  42. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/tooltag-add.gif
  43. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/tooltag-add_over.gif
  44. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/tooltag-arrowright.gif
  45. 0  django/{conf/admin_media → contrib/admin/media}/img/admin/tooltag-arrowright_over.gif
  46. 0  django/{conf/admin_media → contrib/admin/media}/js/SelectBox.js
  47. 0  django/{conf/admin_media → contrib/admin/media}/js/SelectFilter.js
  48. 0  django/{conf/admin_media → contrib/admin/media}/js/SelectFilter2.js
  49. 0  django/{conf/admin_media → contrib/admin/media}/js/admin/CollapsedFieldsets.js
  50. 0  django/{conf/admin_media → contrib/admin/media}/js/admin/DateTimeShortcuts.js
  51. 0  django/{conf/admin_media → contrib/admin/media}/js/admin/RelatedObjectLookups.js
  52. 0  django/{conf/admin_media → contrib/admin/media}/js/admin/ordering.js
  53. 0  django/{conf/admin_media → contrib/admin/media}/js/calendar.js
  54. 0  django/{conf/admin_media → contrib/admin/media}/js/core.js
  55. 0  django/{conf/admin_media → contrib/admin/media}/js/dateparse.js
  56. 0  django/{conf/admin_media → contrib/admin/media}/js/getElementsBySelector.js
  57. 0  django/{conf/admin_media → contrib/admin/media}/js/timeparse.js
  58. 0  django/{conf/admin_media → contrib/admin/media}/js/urlify.js
  59. 2  django/{conf/admin_templates → contrib/admin/templates/admin}/404.html
  60. 2  django/{conf/admin_templates → contrib/admin/templates/admin}/500.html
  61. 0  django/{conf/admin_templates → contrib/admin/templates/admin}/base.html
  62. 2  django/{conf/admin_templates → contrib/admin/templates/admin}/base_site.html
  63. 2  ...n_templates/delete_confirmation_generic.html → contrib/admin/templates/admin/delete_confirmation.html}
  64. 2  django/{conf/admin_templates → contrib/admin/templates/admin}/index.html
  65. 2  django/{conf/admin_templates → contrib/admin/templates/admin}/login.html
  66. 2  ...o/{conf/admin_templates/admin_object_history.html → contrib/admin/templates/admin/object_history.html}
  67. 2  django/{conf/admin_templates → contrib/admin/templates/admin}/template_validator.html
  68. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/bookmarklets.html
  69. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/index.html
  70. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/missing_docutils.html
  71. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/model_detail.html
  72. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/model_index.html
  73. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/template_detail.html
  74. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/template_filter_index.html
  75. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/template_tag_index.html
  76. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/view_detail.html
  77. 2  django/{conf/admin_templates/doc → contrib/admin/templates/admin_doc}/view_index.html
  78. 2  django/{conf/admin_templates → contrib/admin/templates}/registration/logged_out.html
  79. 2  django/{conf/admin_templates → contrib/admin/templates}/registration/password_change_done.html
  80. 2  django/{conf/admin_templates → contrib/admin/templates}/registration/password_change_form.html
  81. 2  django/{conf/admin_templates → contrib/admin/templates}/registration/password_reset_done.html
  82. 0  django/{conf/admin_templates → contrib/admin/templates}/registration/password_reset_email.html
  83. 2  django/{conf/admin_templates → contrib/admin/templates}/registration/password_reset_form.html
  84. 0  django/{ → contrib/admin}/templatetags/adminapplist.py
  85. 0  django/{ → contrib/admin}/templatetags/adminmedia.py
  86. 2  django/{ → contrib/admin}/templatetags/log.py
  87. 0  django/{conf → contrib/admin}/urls/admin.py
  88. 12  django/contrib/admin/views/main.py
  89. 2  django/contrib/admin/views/template.py
  90. 13  django/core/management.py
  91. 2  django/core/servers/basehttp.py
  92. 126  django/middleware/admin.py
  93. 46  django/models/auth.py
  94. 4  docs/django-admin.txt
  95. 3  docs/faq.txt
  96. 21  docs/middleware.txt
  97. 32  docs/modpython.txt
  98. 10  docs/settings.txt
  99. 27  docs/tutorial01.txt
  100. 93  docs/tutorial02.txt
  101. 43  docs/tutorial03.txt
10  django/conf/project_template/settings/main.py → django/conf/project_template/settings.py
@@ -27,22 +27,28 @@
27 27
 # Example: "http://media.lawrence.com"
28 28
 MEDIA_URL = ''
29 29
 
  30
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
  31
+# trailing slash.
  32
+# Examples: "http://foo.com/media/", "/media/".
  33
+ADMIN_MEDIA_PREFIX = '/media/'
  34
+
30 35
 # Make this unique, and don't share it with anybody.
31 36
 SECRET_KEY = ''
32 37
 
33 38
 # List of callables that know how to import templates from various sources.
34 39
 TEMPLATE_LOADERS = (
35  
-#     'django.core.template.loaders.app_directories.load_template_source',
36 40
     'django.core.template.loaders.filesystem.load_template_source',
  41
+    'django.core.template.loaders.app_directories.load_template_source',
37 42
 #     'django.core.template.loaders.eggs.load_template_source',
38 43
 )
39 44
 
40 45
 MIDDLEWARE_CLASSES = (
41 46
     "django.middleware.common.CommonMiddleware",
  47
+    "django.middleware.sessions.SessionMiddleware",
42 48
     "django.middleware.doc.XViewMiddleware",
43 49
 )
44 50
 
45  
-ROOT_URLCONF = '{{ project_name }}.settings.urls.main'
  51
+ROOT_URLCONF = '{{ project_name }}.urls'
46 52
 
47 53
 TEMPLATE_DIRS = (
48 54
     # Put strings here, like "/home/html/django_templates".
0  django/conf/project_template/settings/__init__.py
No changes.
18  django/conf/project_template/settings/admin.py
... ...
@@ -1,18 +0,0 @@
1  
-# Django settings for {{ project_name }} project admin site.
2  
-
3  
-from main import *
4  
-
5  
-TEMPLATE_DIRS = (
6  
-    # Put strings here, like "/home/html/django_templates".
7  
-)
8  
-ROOT_URLCONF = '{{ project_name }}.settings.urls.admin'
9  
-MIDDLEWARE_CLASSES = (
10  
-    'django.middleware.sessions.SessionMiddleware',
11  
-    'django.middleware.admin.AdminUserRequired',
12  
-    'django.middleware.common.CommonMiddleware',
13  
-)
14  
-
15  
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
16  
-# trailing slash.
17  
-# Examples: "http://foo.com/media/", "/media/".
18  
-ADMIN_MEDIA_PREFIX = '/media/'
0  django/conf/project_template/settings/urls/__init__.py
No changes.
6  django/conf/project_template/settings/urls/admin.py
... ...
@@ -1,6 +0,0 @@
1  
-from django.conf.urls.defaults import *
2  
-
3  
-urlpatterns = patterns('',
4  
-    (r'^admin/', include('django.conf.urls.admin')),
5  
-    (r'^r/', include('django.conf.urls.shortcut')),
6  
-)
3  django/conf/project_template/settings/urls/main.py → django/conf/project_template/urls.py
@@ -3,4 +3,7 @@
3 3
 urlpatterns = patterns('',
4 4
     # Example:
5 5
     # (r'^{{ project_name }}/', include('{{ project_name }}.apps.foo.urls.foo')),
  6
+
  7
+    # Uncomment this for admin:
  8
+#     (r'^admin/', include('django.contrib.admin.urls.admin')),
6 9
 )
0  django/conf/admin_media/css/base.css → django/contrib/admin/media/css/base.css
File renamed without changes
0  django/conf/admin_media/css/changelists.css → django/contrib/admin/media/css/changelists.css
File renamed without changes
0  django/conf/admin_media/css/global.css → django/contrib/admin/media/css/global.css
File renamed without changes
0  django/conf/admin_media/img/admin/arrow-down.gif → django/contrib/admin/media/img/admin/arrow-down.gif
File renamed without changes
0  django/conf/admin_media/img/admin/arrow-up.gif → django/contrib/admin/media/img/admin/arrow-up.gif
File renamed without changes
0  django/conf/admin_media/img/admin/changelist-bg.gif → ...o/contrib/admin/media/img/admin/changelist-bg.gif
File renamed without changes
0  django/conf/admin_media/img/admin/chooser-bg.gif → django/contrib/admin/media/img/admin/chooser-bg.gif
File renamed without changes
0  ...conf/admin_media/img/admin/chooser_stacked-bg.gif → ...trib/admin/media/img/admin/chooser_stacked-bg.gif
File renamed without changes
0  ...conf/admin_media/img/admin/default-bg-reverse.gif → ...trib/admin/media/img/admin/default-bg-reverse.gif
File renamed without changes
0  django/conf/admin_media/img/admin/default-bg.gif → django/contrib/admin/media/img/admin/default-bg.gif
File renamed without changes
0  django/conf/admin_media/img/admin/icon-no.gif → django/contrib/admin/media/img/admin/icon-no.gif
File renamed without changes
0  django/conf/admin_media/img/admin/icon-yes.gif → django/contrib/admin/media/img/admin/icon-yes.gif
File renamed without changes
0  django/conf/admin_media/img/admin/icon_addlink.gif → ...go/contrib/admin/media/img/admin/icon_addlink.gif
File renamed without changes
0  django/conf/admin_media/img/admin/icon_alert.gif → django/contrib/admin/media/img/admin/icon_alert.gif
File renamed without changes
0  django/conf/admin_media/img/admin/icon_calendar.gif → ...o/contrib/admin/media/img/admin/icon_calendar.gif
File renamed without changes
0  ...go/conf/admin_media/img/admin/icon_changelink.gif → ...contrib/admin/media/img/admin/icon_changelink.gif
File renamed without changes
0  django/conf/admin_media/img/admin/icon_clock.gif → django/contrib/admin/media/img/admin/icon_clock.gif
File renamed without changes
0  ...go/conf/admin_media/img/admin/icon_deletelink.gif → ...contrib/admin/media/img/admin/icon_deletelink.gif
File renamed without changes
0  django/conf/admin_media/img/admin/icon_error.gif → django/contrib/admin/media/img/admin/icon_error.gif
File renamed without changes
0  django/conf/admin_media/img/admin/icon_searchbox.png → .../contrib/admin/media/img/admin/icon_searchbox.png
File renamed without changes
0  django/conf/admin_media/img/admin/icon_success.gif → ...go/contrib/admin/media/img/admin/icon_success.gif
File renamed without changes
0  django/conf/admin_media/img/admin/nav-bg-grabber.gif → .../contrib/admin/media/img/admin/nav-bg-grabber.gif
File renamed without changes
0  django/conf/admin_media/img/admin/nav-bg-reverse.gif → .../contrib/admin/media/img/admin/nav-bg-reverse.gif
File renamed without changes
0  django/conf/admin_media/img/admin/nav-bg.gif → django/contrib/admin/media/img/admin/nav-bg.gif
File renamed without changes
0  django/conf/admin_media/img/admin/selector-add.gif → ...go/contrib/admin/media/img/admin/selector-add.gif
File renamed without changes
0  ...go/conf/admin_media/img/admin/selector-addall.gif → ...contrib/admin/media/img/admin/selector-addall.gif
File renamed without changes
0  ...go/conf/admin_media/img/admin/selector-remove.gif → ...contrib/admin/media/img/admin/selector-remove.gif
File renamed without changes
0  ...conf/admin_media/img/admin/selector-removeall.gif → ...trib/admin/media/img/admin/selector-removeall.gif
File renamed without changes
0  ...go/conf/admin_media/img/admin/selector-search.gif → ...contrib/admin/media/img/admin/selector-search.gif
File renamed without changes
0  ...nf/admin_media/img/admin/selector_stacked-add.gif → ...ib/admin/media/img/admin/selector_stacked-add.gif
File renamed without changes
0  ...admin_media/img/admin/selector_stacked-remove.gif → ...admin/media/img/admin/selector_stacked-remove.gif
File renamed without changes
0  django/conf/admin_media/img/admin/tool-left.gif → django/contrib/admin/media/img/admin/tool-left.gif
File renamed without changes
0  django/conf/admin_media/img/admin/tool-left_over.gif → .../contrib/admin/media/img/admin/tool-left_over.gif
File renamed without changes
0  django/conf/admin_media/img/admin/tool-right.gif → django/contrib/admin/media/img/admin/tool-right.gif
File renamed without changes
0  ...go/conf/admin_media/img/admin/tool-right_over.gif → ...contrib/admin/media/img/admin/tool-right_over.gif
File renamed without changes
0  django/conf/admin_media/img/admin/tooltag-add.gif → django/contrib/admin/media/img/admin/tooltag-add.gif
File renamed without changes
0  ...o/conf/admin_media/img/admin/tooltag-add_over.gif → ...ontrib/admin/media/img/admin/tooltag-add_over.gif
File renamed without changes
0  ...conf/admin_media/img/admin/tooltag-arrowright.gif → ...trib/admin/media/img/admin/tooltag-arrowright.gif
File renamed without changes
0  ...admin_media/img/admin/tooltag-arrowright_over.gif → ...admin/media/img/admin/tooltag-arrowright_over.gif
File renamed without changes
0  django/conf/admin_media/js/SelectBox.js → django/contrib/admin/media/js/SelectBox.js
File renamed without changes
0  django/conf/admin_media/js/SelectFilter.js → django/contrib/admin/media/js/SelectFilter.js
File renamed without changes
0  django/conf/admin_media/js/SelectFilter2.js → django/contrib/admin/media/js/SelectFilter2.js
File renamed without changes
0  ...o/conf/admin_media/js/admin/CollapsedFieldsets.js → ...ontrib/admin/media/js/admin/CollapsedFieldsets.js
File renamed without changes
0  ...go/conf/admin_media/js/admin/DateTimeShortcuts.js → ...contrib/admin/media/js/admin/DateTimeShortcuts.js
File renamed without changes
0  ...conf/admin_media/js/admin/RelatedObjectLookups.js → ...trib/admin/media/js/admin/RelatedObjectLookups.js
File renamed without changes
0  django/conf/admin_media/js/admin/ordering.js → django/contrib/admin/media/js/admin/ordering.js
File renamed without changes
0  django/conf/admin_media/js/calendar.js → django/contrib/admin/media/js/calendar.js
File renamed without changes
0  django/conf/admin_media/js/core.js → django/contrib/admin/media/js/core.js
File renamed without changes
0  django/conf/admin_media/js/dateparse.js → django/contrib/admin/media/js/dateparse.js
File renamed without changes
0  django/conf/admin_media/js/getElementsBySelector.js → ...o/contrib/admin/media/js/getElementsBySelector.js
File renamed without changes
0  django/conf/admin_media/js/timeparse.js → django/contrib/admin/media/js/timeparse.js
File renamed without changes
0  django/conf/admin_media/js/urlify.js → django/contrib/admin/media/js/urlify.js
File renamed without changes
2  django/conf/admin_templates/404.html → django/contrib/admin/templates/admin/404.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block title %}Page not found{% endblock %}
4 4
 
2  django/conf/admin_templates/500.html → django/contrib/admin/templates/admin/500.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; Server error</div>{% endblock %}
4 4
 
0  django/conf/admin_templates/base.html → django/contrib/admin/templates/admin/base.html
File renamed without changes
2  django/conf/admin_templates/base_site.html → django/contrib/admin/templates/admin/base_site.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base" %}
  1
+{% extends "admin/base" %}
2 2
 
3 3
 {% block title %}{{ title }} | Django site admin{% endblock %}
4 4
 
2  .../admin_templates/delete_confirmation_generic.html → ...ib/admin/templates/admin/delete_confirmation.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block content %}
4 4
 
2  django/conf/admin_templates/index.html → django/contrib/admin/templates/admin/index.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block coltype %}colMS{% endblock %}
4 4
 {% block bodyclass %}dashboard{% endblock %}
2  django/conf/admin_templates/login.html → django/contrib/admin/templates/admin/login.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}{% endblock %}
4 4
 
2  ...go/conf/admin_templates/admin_object_history.html → ...contrib/admin/templates/admin/object_history.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}
4 4
 <div class="breadcrumbs"><a href="../../../../">Home</a> &rsaquo; <a href="../../">{{ module_name }}</a> &rsaquo; <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo; History</div>
2  django/conf/admin_templates/template_validator.html → ...rib/admin/templates/admin/template_validator.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block content %}
4 4
 
2  django/conf/admin_templates/doc/bookmarklets.html → ...ntrib/admin/templates/admin_doc/bookmarklets.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Bookmarklets</div>{% endblock %}
4 4
 
2  django/conf/admin_templates/doc/index.html → django/contrib/admin/templates/admin_doc/index.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Documentation</div>{% endblock %}
4 4
 
2  ...go/conf/admin_templates/doc/missing_docutils.html → ...b/admin/templates/admin_doc/missing_docutils.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Documentation</div>{% endblock %}
4 4
 
2  django/conf/admin_templates/doc/model_detail.html → ...ntrib/admin/templates/admin_doc/model_detail.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block extrahead %}
4 4
 
2  django/conf/admin_templates/doc/model_index.html → ...ontrib/admin/templates/admin_doc/model_index.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block coltype %}colSM{% endblock %}
4 4
 
2  django/conf/admin_templates/doc/template_detail.html → ...ib/admin/templates/admin_doc/template_detail.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; Templates &rsaquo; {{ name }}</div>{% endblock %}
4 4
 
2  ...nf/admin_templates/doc/template_filter_index.html → ...in/templates/admin_doc/template_filter_index.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block coltype %}colSM{% endblock %}
4 4
 
2  .../conf/admin_templates/doc/template_tag_index.html → ...admin/templates/admin_doc/template_tag_index.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block coltype %}colSM{% endblock %}
4 4
 
2  django/conf/admin_templates/doc/view_detail.html → ...ontrib/admin/templates/admin_doc/view_detail.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; <a href="../">Views</a> &rsaquo; {{ name }}</div>{% endblock %}
4 4
 
2  django/conf/admin_templates/doc/view_index.html → ...contrib/admin/templates/admin_doc/view_index.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block coltype %}colSM{% endblock %}
4 4
 
2  ...conf/admin_templates/registration/logged_out.html → ...trib/admin/templates/registration/logged_out.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a></div>{% endblock %}
4 4
 
2  ..._templates/registration/password_change_done.html → .../templates/registration/password_change_done.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Password change</div>{% endblock %}
4 4
 
2  ..._templates/registration/password_change_form.html → .../templates/registration/password_change_form.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Password change</div>{% endblock %}
4 4
 
2  ...n_templates/registration/password_reset_done.html → ...n/templates/registration/password_reset_done.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Password reset</div>{% endblock %}
4 4
 
0  ..._templates/registration/password_reset_email.html → .../templates/registration/password_reset_email.html
File renamed without changes
2  ...n_templates/registration/password_reset_form.html → ...n/templates/registration/password_reset_form.html
... ...
@@ -1,4 +1,4 @@
1  
-{% extends "base_site" %}
  1
+{% extends "admin/base_site" %}
2 2
 
3 3
 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Password reset</div>{% endblock %}
4 4
 
0  django/templatetags/adminapplist.py → django/contrib/admin/templatetags/adminapplist.py
File renamed without changes
0  django/templatetags/adminmedia.py → django/contrib/admin/templatetags/adminmedia.py
File renamed without changes
2  django/templatetags/log.py → django/contrib/admin/templatetags/log.py
... ...
@@ -1,4 +1,4 @@
1  
-from django.models.auth import log
  1
+from django.models.admin import log
2 2
 from django.core import template
3 3
 
4 4
 class AdminLogNode(template.Node):
0  django/conf/urls/admin.py → django/contrib/admin/urls/admin.py
File renamed without changes
12  django/contrib/admin/views/main.py
@@ -6,7 +6,7 @@
6 6
 from django.core.exceptions import Http404, ObjectDoesNotExist, PermissionDenied
7 7
 from django.core.extensions import DjangoContext as Context
8 8
 from django.core.extensions import get_object_or_404, render_to_response
9  
-from django.models.auth import log
  9
+from django.models.admin import log
10 10
 from django.utils.html import strip_tags
11 11
 from django.utils.httpwrappers import HttpResponse, HttpResponseRedirect
12 12
 from django.utils.text import capfirst, get_text_list
@@ -49,7 +49,7 @@ def get_query_string(original_params, new_params={}, remove=[]):
49 49
     return '?' + '&amp;'.join(['%s=%s' % (k, v) for k, v in p.items()]).replace(' ', '%20')
50 50
 
51 51
 def index(request):
52  
-    return render_to_response('index', {'title': 'Site administration'}, context_instance=Context(request))
  52
+    return render_to_response('admin/index', {'title': 'Site administration'}, context_instance=Context(request))
53 53
 index = staff_member_required(index)
54 54
 
55 55
 def change_list(request, app_label, module_name):
@@ -266,7 +266,7 @@ def change_list(request, app_label, module_name):
266 266
             else:
267 267
                 pass # Invalid argument to "list_filter"
268 268
 
269  
-    raw_template = ['{% extends "base_site" %}\n']
  269
+    raw_template = ['{% extends "admin/base_site" %}\n']
270 270
     raw_template.append('{% block bodyclass %}change-list{% endblock %}\n')
271 271
     if not is_popup:
272 272
         raw_template.append('{%% block breadcrumbs %%}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; %s</div>{%% endblock %%}\n' % capfirst(opts.verbose_name_plural))
@@ -538,7 +538,7 @@ def _get_template(opts, app_label, add=False, change=False, show_delete=False, f
538 538
     admin_field_objs = opts.admin.get_field_objs(opts)
539 539
     ordered_objects = opts.get_ordered_objects()[:]
540 540
     auto_populated_fields = [f for f in opts.fields if f.prepopulate_from]
541  
-    t = ['{% extends "base_site" %}\n']
  541
+    t = ['{% extends "admin/base_site" %}\n']
542 542
     t.append('{% block extrahead %}')
543 543
 
544 544
     # Put in any necessary JavaScript imports.
@@ -1087,7 +1087,7 @@ def delete_stage(request, app_label, module_name, object_id):
1087 1087
         log.log_action(request.user.id, opts.get_content_type_id(), object_id, obj_repr, log.DELETION)
1088 1088
         request.user.add_message('The %s "%s" was deleted successfully.' % (opts.verbose_name, obj_repr))
1089 1089
         return HttpResponseRedirect("../../")
1090  
-    return render_to_response('delete_confirmation_generic', {
  1090
+    return render_to_response('admin/delete_confirmation', {
1091 1091
         "title": "Are you sure?",
1092 1092
         "object_name": opts.verbose_name,
1093 1093
         "object": obj,
@@ -1102,7 +1102,7 @@ def history(request, app_label, module_name, object_id):
1102 1102
         order_by=("action_time",), select_related=True)
1103 1103
     # If no history was found, see whether this object even exists.
1104 1104
     obj = get_object_or_404(mod, pk=object_id)
1105  
-    return render_to_response('admin_object_history', {
  1105
+    return render_to_response('admin/object_history', {
1106 1106
         'title': 'Change history: %r' % obj,
1107 1107
         'action_list': action_list,
1108 1108
         'module_name': capfirst(opts.verbose_name_plural),
2  django/contrib/admin/views/template.py
@@ -23,7 +23,7 @@ def template_validator(request):
23 23
         errors = manipulator.get_validation_errors(new_data)
24 24
         if not errors:
25 25
             request.user.add_message('The template is valid.')
26  
-    return render_to_response('template_validator', {
  26
+    return render_to_response('admin/template_validator', {
27 27
         'title': 'Template validator',
28 28
         'form': formfields.FormWrapper(manipulator, new_data, errors),
29 29
     }, context_instance=DjangoContext(request))
13  django/core/management.py
@@ -17,7 +17,6 @@
17 17
 # Use django.__path__[0] because we don't know which directory django into
18 18
 # which has been installed.
19 19
 PROJECT_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', '%s_template')
20  
-ADMIN_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', 'admin_templates')
21 20
 
22 21
 def _get_packages_insert(app_label):
23 22
     return "INSERT INTO packages (label, name) VALUES ('%s', '%s');" % (app_label, app_label)
@@ -142,7 +141,7 @@ def get_sql_delete(mod):
142 141
     if cursor is not None:
143 142
         cursor.execute("SELECT id FROM content_types WHERE package = %s", [app_label])
144 143
         for row in cursor.fetchall():
145  
-            output.append("DELETE FROM auth_admin_log WHERE content_type_id = %s;" % row[0])
  144
+            output.append("DELETE FROM django_admin_log WHERE content_type_id = %s;" % row[0])
146 145
 
147 146
     # Close database connection explicitly, in case this output is being piped
148 147
     # directly into a database client, to avoid locking issues.
@@ -378,16 +377,8 @@ def startproject(project_name, directory):
378 377
     "Creates a Django project for the given project_name in the given directory."
379 378
     from random import choice
380 379
     _start_helper('project', project_name, directory)
381  
-    # Populate TEMPLATE_DIRS for the admin templates, based on where Django is
382  
-    # installed.
383  
-    admin_settings_file = os.path.join(directory, project_name, 'settings', 'admin.py')
384  
-    settings_contents = open(admin_settings_file, 'r').read()
385  
-    fp = open(admin_settings_file, 'w')
386  
-    settings_contents = re.sub(r'(?s)\b(TEMPLATE_DIRS\s*=\s*\()(.*?)\)', "\\1\n    r%r,\\2)" % ADMIN_TEMPLATE_DIR, settings_contents)
387  
-    fp.write(settings_contents)
388  
-    fp.close()
389 380
     # Create a random SECRET_KEY hash, and put it in the main settings.
390  
-    main_settings_file = os.path.join(directory, project_name, 'settings', 'main.py')
  381
+    main_settings_file = os.path.join(directory, project_name, 'settings.py')
391 382
     settings_contents = open(main_settings_file, 'r').read()
392 383
     fp = open(main_settings_file, 'w')
393 384
     secret_key = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
2  django/core/servers/basehttp.py
@@ -602,7 +602,7 @@ def __init__(self, application):
602 602
         from django.conf import settings
603 603
         import django
604 604
         self.application = application
605  
-        self.media_dir = django.__path__[0] + '/conf/admin_media'
  605
+        self.media_dir = django.__path__[0] + '/contrib/admin/media'
606 606
         self.media_url = settings.ADMIN_MEDIA_PREFIX
607 607
 
608 608
     def __call__(self, environ, start_response):
126  django/middleware/admin.py
... ...
@@ -1,126 +0,0 @@
1  
-from django.utils import httpwrappers
2  
-from django.core.extensions import DjangoContext
3  
-from django.core.extensions import render_to_response
4  
-from django.models.auth import users
5  
-from django.views.registration import passwords
6  
-from django.views.auth.login import logout
7  
-import base64, md5
8  
-import cPickle as pickle
9  
-from django.conf.settings import SECRET_KEY
10  
-
11  
-ERROR_MESSAGE = "Please enter a correct username and password. Note that both fields are case-sensitive."
12  
-
13  
-class AdminUserRequired:
14  
-    """
15  
-    Admin middleware.  If this is enabled, access to the site will be granted only
16  
-    to valid users with the "is_staff" flag set.
17  
-    """
18  
-
19  
-    def process_view(self, request, view_func, param_dict):
20  
-        """
21  
-        Make sure the user is logged in and is a valid admin user before
22  
-        allowing any access.
23  
-
24  
-        Done at the view point because we need to know if we're running the
25  
-        password reset function.
26  
-        """
27  
-
28  
-        # If this is the password reset view, we don't want to require login
29  
-        # Otherwise the password reset would need its own entry in the httpd
30  
-        # conf, which is a little uglier than this. Same goes for the logout
31  
-        # view.
32  
-
33  
-        if view_func in (passwords.password_reset, passwords.password_reset_done, logout):
34  
-            return
35  
-
36  
-        assert hasattr(request, 'session'), "The admin requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.middleware.sessions.SessionMiddleware' before %r." % self.__class__.__name__
37  
-
38  
-        # Check for a logged in, valid user
39  
-        if self.user_is_valid(request.user):
40  
-            return
41  
-
42  
-        # If this isn't already the login page, display it
43  
-        if not request.POST.has_key('this_is_the_login_form'):
44  
-            if request.POST:
45  
-                message = "Please log in again, because your session has expired. "\
46  
-                          "Don't worry: Your submission has been saved."
47  
-            else:
48  
-                message = ""
49  
-            return self.display_login_form(request, message)
50  
-
51  
-        # Check that the user accepts cookies.
52  
-        if not request.session.test_cookie_worked():
53  
-            message = "Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again."
54  
-            return self.display_login_form(request, message)
55  
-
56  
-        # Check the password
57  
-        username = request.POST.get('username', '')
58  
-        try:
59  
-            user = users.get_object(username__exact=username)
60  
-        except users.UserDoesNotExist:
61  
-            message = ERROR_MESSAGE
62  
-            if '@' in username:
63  
-                # Mistakenly entered e-mail address instead of username? Look it up.
64  
-                try:
65  
-                    user = users.get_object(email__exact=username)
66  
-                except users.UserDoesNotExist:
67  
-                    message = "Usernames cannot contain the '@' character."
68  
-                else:
69  
-                    message = "Your e-mail address is not your username. Try '%s' instead." % user.username
70  
-            return self.display_login_form(request, message)
71  
-
72  
-        # The user data is correct; log in the user in and continue
73  
-        else:
74  
-            if self.authenticate_user(user, request.POST.get('password', '')):
75  
-                request.session[users.SESSION_KEY] = user.id
76  
-                if request.POST.has_key('post_data'):
77  
-                    post_data = decode_post_data(request.POST['post_data'])
78  
-                    if post_data and not post_data.has_key('this_is_the_login_form'):
79  
-                        # overwrite request.POST with the saved post_data, and continue
80  
-                        request.POST = post_data
81  
-                        request.user = user
82  
-                        return
83  
-                    else:
84  
-                        request.session.delete_test_cookie()
85  
-                        return httpwrappers.HttpResponseRedirect(request.path)
86  
-            else:
87  
-                return self.display_login_form(request, ERROR_MESSAGE)
88  
-
89  
-    def display_login_form(self, request, error_message=''):
90  
-        request.session.set_test_cookie()
91  
-        if request.POST and request.POST.has_key('post_data'):
92  
-            # User has failed login BUT has previously saved 'post_data'
93  
-            post_data = request.POST['post_data']
94  
-        elif request.POST:
95  
-            # User's session must have expired; save their post data
96  
-            post_data = encode_post_data(request.POST)
97  
-        else:
98  
-            post_data = encode_post_data({})
99  
-        return render_to_response(self.get_login_template_name(), {
100  
-            'title': 'Log in',
101  
-            'app_path': request.path,
102  
-            'post_data': post_data,
103  
-            'error_message': error_message
104  
-        }, context_instance=DjangoContext(request))
105  
-
106  
-    def authenticate_user(self, user, password):
107  
-        return user.check_password(password) and user.is_staff
108  
-
109  
-    def user_is_valid(self, user):
110  
-        return not user.is_anonymous() and user.is_staff
111  
-
112  
-    def get_login_template_name(self):
113  
-        return "login"
114  
-
115  
-def encode_post_data(post_data):
116  
-    pickled = pickle.dumps(post_data)
117  
-    pickled_md5 = md5.new(pickled + SECRET_KEY).hexdigest()
118  
-    return base64.encodestring(pickled + pickled_md5)
119  
-
120  
-def decode_post_data(encoded_data):
121  
-    encoded_data = base64.decodestring(encoded_data)
122  
-    pickled, tamper_check = encoded_data[:-32], encoded_data[-32:]
123  
-    if md5.new(pickled + SECRET_KEY).hexdigest() != tamper_check:
124  
-        from django.core.exceptions import SuspiciousOperation
125  
-        raise SuspiciousOperation, "User may have tampered with session cookie."
126  
-    return pickle.loads(pickled)
46  django/models/auth.py
@@ -176,49 +176,3 @@ class Message(meta.Model):
176 176
 
177 177
     def __repr__(self):
178 178
         return self.message
179  
-
180  
-class LogEntry(meta.Model):
181  
-    action_time = meta.DateTimeField(auto_now=True)
182  
-    user = meta.ForeignKey(User)
183  
-    content_type = meta.ForeignKey(core.ContentType, blank=True, null=True)
184  
-    object_id = meta.TextField(blank=True, null=True)
185  
-    object_repr = meta.CharField(maxlength=200)
186  
-    action_flag = meta.PositiveSmallIntegerField()
187  
-    change_message = meta.TextField(blank=True)
188  
-    class META:
189  
-        module_name = 'log'
190  
-        verbose_name_plural = 'log entries'
191  
-        db_table = 'auth_admin_log'
192  
-        ordering = ('-action_time',)
193  
-        module_constants = {
194  
-            'ADDITION': 1,
195  
-            'CHANGE': 2,
196  
-            'DELETION': 3,
197  
-        }
198  
-
199  
-    def __repr__(self):
200  
-        return str(self.action_time)
201  
-
202  
-    def is_addition(self):
203  
-        return self.action_flag == ADDITION
204  
-
205  
-    def is_change(self):
206  
-        return self.action_flag == CHANGE
207  
-
208  
-    def is_deletion(self):
209  
-        return self.action_flag == DELETION
210  
-
211  
-    def get_edited_object(self):
212  
-        "Returns the edited object represented by this log entry"
213  
-        return self.get_content_type().get_object_for_this_type(pk=self.object_id)
214  
-
215  
-    def get_admin_url(self):
216  
-        """
217  
-        Returns the admin URL to edit the object represented by this log entry.
218  
-        This is relative to the Django admin index page.
219  
-        """
220  
-        return "%s/%s/%s/" % (self.get_content_type().package, self.get_content_type().python_module_name, self.object_id)
221  
-
222  
-    def _module_log_action(user_id, content_type_id, object_id, object_repr, action_flag, change_message=''):
223  
-        e = LogEntry(None, None, user_id, content_type_id, object_id, object_repr[:200], action_flag, change_message)
224  
-        e.save()
4  docs/django-admin.txt
@@ -192,10 +192,10 @@ Available options
192 192
 
193 193
 Example usage::
194 194
 
195  
-    django-admin.py init --settings='myproject.settings.main'
  195
+    django-admin.py init --settings=myproject.settings
196 196
 
197 197
 Explicitly specifies the settings module to use. The settings module should be
198  
-in Python path syntax, e.g. "myproject.settings.main". If this isn't provided,
  198
+in Python path syntax, e.g. "myproject.settings". If this isn't provided,
199 199
 ``django-admin.py`` will use the DJANGO_SETTINGS_MODULE environment variable.
200 200
 
201 201
 --pythonpath
3  docs/faq.txt
@@ -348,8 +348,7 @@ things:
348 348
     * Set the ``SESSION_COOKIE_DOMAIN`` setting in your admin config file
349 349
       to match your domain. For example, if you're going to
350 350
       "http://www.mysite.com/admin/" in your browser, in
351  
-      "myproject.settings.admin" you should set ``SESSION_COOKIE_DOMAIN =
352  
-      'www.mysite.com'``.
  351
+      "myproject.settings" you should set ``SESSION_COOKIE_DOMAIN = 'www.mysite.com'``.
353 352
 
354 353
     * Some browsers (Firefox?) don't like to accept cookies from domains that
355 354
       don't have dots in them. If you're running the admin site on "localhost"
21  docs/middleware.txt
@@ -27,30 +27,15 @@ name. For example, here's the default ``MIDDLEWARE_CLASSES`` created by
27 27
         "django.middleware.doc.XViewMiddleware",
28 28
     )
29 29
 
30  
-The default admin site has the following ``MIDDLEWARE_CLASSES`` set::
31  
-
32  
-    MIDDLEWARE_CLASSES = (
33  
-        "django.middleware.sessions.SessionMiddleware",
34  
-        "django.middleware.admin.AdminUserRequired",
35  
-        "django.middleware.common.CommonMiddleware",
36  
-    )
37  
-
38 30
 Django applies middleware in the order it's defined in ``MIDDLEWARE_CLASSES``.
39 31
 
40  
-For a regular (i.e., non-admin) Django installation, no middleware is required,
41  
-but it's strongly suggested that you use ``CommonMiddleware``. For a Django
42  
-admin site, ``SessionMiddleware`` and ``AdminUserRequired`` (in that order) are
43  
-required.
  32
+A Django installation doesn't require any middleware -- e.g.,
  33
+``MIDDLEWARE_CLASSES`` can be empty, if you'd like -- but it's strongly
  34
+suggested that you use ``CommonMiddleware``.
44 35
 
45 36
 Available middleware
46 37
 ====================
47 38
 
48  
-django.middleware.admin.AdminUserRequired
49  
------------------------------------------
50  
-
51  
-Limits site access to valid users with the ``is_staff`` flag set. This is
52  
-required by Django's admin, and this middleware requires ``SessionMiddleware``.
53  
-
54 39
 django.middleware.cache.CacheMiddleware
55 40
 ---------------------------------------
56 41
 
32  docs/modpython.txt
@@ -25,12 +25,11 @@ Then edit your ``httpd.conf`` file and add the following::
25 25
     <Location "/mysite/">
26 26
         SetHandler python-program
27 27
         PythonHandler django.core.handlers.modpython
28  
-        SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main
  28
+        SetEnv DJANGO_SETTINGS_MODULE myproject.settings
29 29
         PythonDebug On
30 30
     </Location>
31 31
 
32  
-...and replace ``myproject.settings.main`` with the Python path to your
33  
-settings file.
  32
+...and replace ``myproject.settings`` with the Python path to your settings file.
34 33
 
35 34
 This tells Apache: "Use mod_python for any URL at or under '/mysite/', using the
36 35
 Django mod_python handler." It passes the value of ``DJANGO_SETTINGS_MODULE``
@@ -55,17 +54,6 @@ full URL.
55 54
 When deploying Django sites on mod_python, you'll need to restart Apache each
56 55
 time you make changes to your Python code.
57 56
 
58  
-Here's a template for an admin configuration::
59  
-
60  
-    <Location "/admin/">
61  
-        SetHandler python-program
62  
-        PythonHandler django.core.handlers.modpython
63  
-        SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin
64  
-        PythonDebug On
65  
-    </Location>
66  
-
67  
-The only thing different here is the ``DJANGO_SETTINGS_MODULE``.
68  
-
69 57
 Multiple Django installations on the same Apache
70 58
 ================================================
71 59
 
@@ -77,13 +65,13 @@ instance. Just use ``VirtualHost`` for that, like so::
77 65
     <VirtualHost *>
78 66
         ServerName www.example.com
79 67
         # ...
80  
-        SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main
  68
+        SetEnv DJANGO_SETTINGS_MODULE myproject.settings
81 69
     </VirtualHost>
82 70
 
83 71
     <VirtualHost *>
84  
-        ServerName admin.example.com
  72
+        ServerName www2.example.com
85 73
         # ...
86  
-        SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin
  74
+        SetEnv DJANGO_SETTINGS_MODULE myproject.other_settings
87 75
     </VirtualHost>
88 76
 
89 77
 If you need to put two Django installations within the same ``VirtualHost``,
@@ -95,13 +83,13 @@ mess things up. Use the ``PythonInterpreter`` directive to give different
95 83
         ServerName www.example.com
96 84
         # ...
97 85
         <Location "/something">
98  
-            SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main
99  
-            PythonInterpreter myproject_main
  86
+            SetEnv DJANGO_SETTINGS_MODULE myproject.settings
  87
+            PythonInterpreter myproject
100 88
         </Location>
101 89
 
102  
-        <Location "/admin">
103  
-            SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin
104  
-            PythonInterpreter myproject_admin
  90
+        <Location "/otherthing">
  91
+            SetEnv DJANGO_SETTINGS_MODULE myproject.other_settings
  92
+            PythonInterpreter myproject_other
105 93
         </Location>
106 94
     </VirtualHost>
107 95
 
10  docs/settings.txt
@@ -34,7 +34,7 @@ When you use Django, you have to tell it which settings you're using. Do this
34 34
 by using an environment variable, ``DJANGO_SETTINGS_MODULE``.
35 35
 
36 36
 The value of ``DJANGO_SETTINGS_MODULE`` should be in Python path syntax, e.g.
37  
-``"myproject.settings.main"``. Note that the settings module should be on the
  37
+``"myproject.settings"``. Note that the settings module should be on the
38 38
 Python `import search path`_.
39 39
 
40 40
 .. _import search path: http://diveintopython.org/getting_to_know_python/everything_is_an_object.html
@@ -47,17 +47,17 @@ once, or explicitly pass in the settings module each time you run the utility.
47 47
 
48 48
 Example (Unix Bash shell)::
49 49
 
50  
-    export DJANGO_SETTINGS_MODULE=myproject.settings.main
  50
+    export DJANGO_SETTINGS_MODULE=myproject.settings
51 51
     django-admin.py runserver
52 52
 
53 53
 Example (Windows shell)::
54 54
 
55  
-    set DJANGO_SETTINGS_MODULE=myproject.settings.main
  55
+    set DJANGO_SETTINGS_MODULE=myproject.settings
56 56
     django-admin.py runserver
57 57
 
58 58
 Use the ``--settings`` command-line argument to specify the settings manually::
59 59
 
60  
-    django-admin.py runserver --settings=myproject.settings.main
  60
+    django-admin.py runserver --settings=myproject.settings
61 61
 
62 62
 .. _django-admin.py: http://www.djangoproject.com/documentation/django_admin/
63 63
 
@@ -70,7 +70,7 @@ settings file to use. Do that with ``SetEnv``::
70 70
     <Location "/mysite/">
71 71
         SetHandler python-program
72 72
         PythonHandler django.core.handlers.modpython
73  
-        SetEnv DJANGO_SETTINGS_MODULE myproject.settings.main
  73
+        SetEnv DJANGO_SETTINGS_MODULE myproject.settings
74 74
     </Location>
75 75
 
76 76
 Read the `Django mod_python documentation`_ for more information.
27  docs/tutorial01.txt
@@ -40,16 +40,10 @@ settings. Let's look at what ``startproject`` created::
40 40
         __init__.py
41 41
         apps/
42 42
             __init__.py
43  
-        settings/
44  
-            __init__.py
45  
-            admin.py
46  
-            main.py
47  
-            urls/
48  
-                __init__.py
49  
-                admin.py
50  
-                main.py
51  
-
52  
-First, edit ``myproject/settings/main.py``. It's a normal Python module with
  43
+        settings.py
  44
+        urls.py
  45
+
  46
+First, edit ``myproject/settings.py``. It's a normal Python module with
53 47
 module-level variables representing Django settings. Edit the file and change
54 48
 these settings to match your database's connection parameters:
55 49
 
@@ -69,11 +63,6 @@ these settings to match your database's connection parameters:
69 63
     point. Do that with "``CREATE DATABASE database_name;``" within your
70 64
     database's interactive prompt.
71 65
 
72  
-    Also, note that MySQL and sqlite support is a recent development, and Django
73  
-    hasn't been comprehensively tested with either database. If you find any
74  
-    bugs in those bindings, please file them in `Django's ticket system`_ so we
75  
-    can fix them immediately.
76  
-
77 66
 Now, take a second to make sure ``myproject`` is on your Python path. You
78 67
 can do this by copying ``myproject`` to Python's ``site-packages`` directory,
79 68
 or you can do it by altering the ``PYTHONPATH`` environment variable. See the
@@ -84,7 +73,7 @@ or you can do it by altering the ``PYTHONPATH`` environment variable. See the
84 73
 
85 74
 Run the following command::
86 75
 
87  
-    django-admin.py init --settings=myproject.settings.main
  76
+    django-admin.py init --settings=myproject.settings
88 77
 
89 78
 The ``django-admin.py`` utility generally needs to know which settings module
90 79
 you're using. Here, we're doing that by specifying ``settings=`` on the command
@@ -92,11 +81,11 @@ line, but that can get tedious. If you don't want to type ``settings=`` each
92 81
 time, you can set the ``DJANGO_SETTINGS_MODULE`` environment variable. Here's
93 82
 how you do that in the Bash shell on Unix::
94 83
 
95  
-    export DJANGO_SETTINGS_MODULE=myproject.settings.main
  84
+    export DJANGO_SETTINGS_MODULE=myproject.settings
96 85
 
97 86
 On Windows, you'd use ``set`` instead::
98 87
 
99  
-    set DJANGO_SETTINGS_MODULE=myproject.settings.main
  88
+    set DJANGO_SETTINGS_MODULE=myproject.settings
100 89
 
101 90
 If you don't see any errors after running ``django-admin.py init``, you know it
102 91
 worked. That command initialized your database with Django's core database
@@ -221,7 +210,7 @@ But first we need to tell our project that the ``polls`` app is installed.
221 210
    projects, and you can distribute apps, because they don't have to be tied to
222 211
    a given Django installation.
223 212
 
224  
-Edit the myproject/settings/main.py file again, and change the ``INSTALLED_APPS``
  213
+Edit the myproject/settings.py file again, and change the ``INSTALLED_APPS``
225 214
 setting to include the string "myproject.apps.polls". So it'll look like this::
226 215
 
227 216
     INSTALLED_APPS = (
93  docs/tutorial02.txt
@@ -24,15 +24,26 @@ application and will focus on Django's automatically-generated admin site.
24 24
     The admin isn't necessarily intended to be used by site visitors; it's for site
25 25
     managers.
26 26
 
  27
+Activate the admin site
  28
+=======================
  29
+
  30
+The Django admin site is not activated by default -- it's an opt-in thing. To
  31
+activate the admin site for your installation, do these three things:
  32
+
  33
+    * Add ``"django.contrib.admin"`` to your ``INSTALLED_APPS`` setting.
  34
+    * Run the command ``django-admin.py install admin``. This will create an
  35
+      extra database table that the admin needs.
  36
+    * Edit your ``myproject.urls`` file and uncomment the line below
  37
+      "Uncomment this for admin:". This file is a URLconf; we'll dig into
  38
+      URLconfs in the next tutorial. For now, all you need to know is that it
  39
+      maps URL roots to applications.
  40
+
27 41
 Create a user account
28 42
 =====================
29 43
 
30 44
 Run the following command to create a superuser account for your admin site::
31 45
 
32  
-    django-admin.py createsuperuser --settings="myproject.settings.main"
33  
-
34  
-(Note: You can use either "myproject.settings.main" or "myproject.settings.admin"
35  
-here. They both reference the same database.)
  46
+    django-admin.py createsuperuser --settings=myproject.settings
36 47
 
37 48
 The script will prompt you for a username, e-mail address and password (twice).
38 49
 
@@ -45,36 +56,26 @@ server and explore the admin site.
45 56
 
46 57
 Just run the following command to start the server::
47 58
 
48  
-    django-admin.py runserver --settings="myproject.settings.admin"
  59
+    django-admin.py runserver --settings=myproject.settings
49 60
 
50 61
 It'll start a Web server running locally -- on port 8000, by default. If you
51 62
 want to change the server's port, pass it as a command-line argument::
52 63
 
53  
-    django-admin.py runserver 8080 --settings="myproject.settings.admin"
  64
+    django-admin.py runserver 8080 --settings=myproject.settings
54 65
 
55 66
 DON'T use this server in anything resembling a production environment. It's
56 67
 intended only for use while developing.
57 68
 
58  
-Now, open a Web browser and go to "/admin/" on your domain. You should see the
59  
-admin's login screen:
  69
+Now, open a Web browser and go to "/admin/" on your local domain -- e.g.,
  70
+http://127.0.0.1:8000/admin/. You should see the admin's login screen:
60 71
 
61 72
 .. image:: http://media.djangoproject.com/img/doc/tutorial/admin01.png
62 73
    :alt: Django admin login screen
63 74
 
64  
-.. admonition:: Note
65  
-
66  
-    If you get an error telling you that the URL 'admin/' didn't match any of
67  
-    your URLconf entries, you most likely used ``myproject.settings.main``
68  
-    instead of ``myproject.settings.admin``.
69  
-
70 75
 Enter the admin site
71 76
 ====================
72 77
 
73  
-Now, try logging in.
74  
-
75  
-If it didn't work, read the `"I can't log in" questions`_ in the FAQ.
76  
-
77  
-If it worked, you should see the Django admin index page:
  78
+Now, try logging in. You should see the Django admin index page:
78 79
 
79 80
 .. image:: http://media.djangoproject.com/img/doc/tutorial/admin02t.png
80 81
    :alt: Django admin index page
@@ -381,39 +382,47 @@ think they should.
381 382
 Customize the admin look and feel
382 383
 =================================
383 384
 
384  
-Clearly having "Django administration" and "example.com" at the top of each
  385
+Clearly, having "Django administration" and "example.com" at the top of each
385 386
 admin page is ridiculous. It's just placeholder text.
386 387
 
387  
-That's easy to change, though, using Django's template system.
  388
+That's easy to change, though, using Django's template system. The Django admin
  389
+is powered by Django itself, and its interfaces use Django's own template
  390
+system. (How meta!)
388 391
 
389  
-Open your admin settings file and look at the ``TEMPLATE_DIRS`` setting.
390  
-``TEMPLATE_DIRS`` is a tuple of filesystem directories to check when loading
391  
-Django templates. It's a search path.
  392
+Open your settings file (``myproject/settings.py``, remember) and look at the
  393
+``TEMPLATE_DIRS`` setting. ``TEMPLATE_DIRS`` is a tuple of filesystem
  394
+directories to check when loading Django templates. It's a search path.
392 395
 
393  
-The ``django-admin.py startproject`` command automatically prepopulated
394  
-this setting with the location of Django's default admin templates, according
395  
-to where you have Django installed. But let's add an extra line to
396  
-``TEMPLATE_DIRS`` so that it checks a custom directory first, before checking
397  
-the default admin template directory::
  396
+By default, ``TEMPLATE_DIRS`` is empty. So, let's add a line to it, to tell
  397
+Django where our templates live.
398 398
 
399 399
     TEMPLATE_DIRS = (
400  
-        "/home/mytemplates/admin",
401  
-        "/usr/lib/python2.3/site-packages/django/conf/admin_templates",
  400
+        "/home/mytemplates", # Change this to your own directory.
402 401
     )
403 402
 
404  
-Again, note that you should edit the admin settings file, not the main settings
405  
-file. That's because we're dealing with admin-site templates.
  403
+Now copy the template ``admin/base_site.html`` from within the default Django
  404
+admin template directory (``django/contrib/admin/templates``) into an ``admin``
  405
+subdirectory of whichever directory you're using in ``TEMPLATE_DIRS``. For
  406
+example, if your ``TEMPLATE_DIRS`` includes ``"/home/mytemplates"``, as above,
  407
+then copy ``django/contrib/admin/templates/admin/base_site.html`` to
  408
+``/home/mytemplates/admin/base_site.html``.
406 409
 
407  
-Now copy the template ``base_site.html`` from within the default Django admin
408  
-template directory, into ``/home/mytemplates/admin`` (or wherever you're
409  
-putting your custom admin templates). Edit the file and replace the generic
410  
-Django stuff with your own site's name as you see fit.
  410
+Then, just edit the file and replace the generic Django text with your own
  411
+site's name and URL as you see fit.
411 412
 
412 413
 Note that any of Django's default admin templates can be overridden. To
413