Changeset 948
- Timestamp:
- 10/18/05 20:09:05 (3 years ago)
- Files:
-
- django/trunk/django/conf/project_template/settings (deleted)
- django/trunk/django/conf/project_template/settings.py (copied) (copied from django/trunk/django/conf/project_template/settings/main.py) (3 diffs)
- django/trunk/django/conf/project_template/urls.py (copied) (copied from django/trunk/django/conf/project_template/settings/urls/main.py) (1 diff)
- django/trunk/django/contrib/admin/media (moved) (moved from django/trunk/django/conf/admin_media)
- django/trunk/django/contrib/admin/media/css (copied) (copied from django/trunk/django/conf/admin_media/css)
- django/trunk/django/contrib/admin/media/img (copied) (copied from django/trunk/django/conf/admin_media/img)
- django/trunk/django/contrib/admin/media/js (copied) (copied from django/trunk/django/conf/admin_media/js)
- django/trunk/django/contrib/admin/templates/admin/404.html (moved) (moved from django/trunk/django/conf/admin_templates/404.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin/500.html (moved) (moved from django/trunk/django/conf/admin_templates/500.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin/base.html (moved) (moved from django/trunk/django/conf/admin_templates/base.html)
- django/trunk/django/contrib/admin/templates/admin/base_site.html (moved) (moved from django/trunk/django/conf/admin_templates/base_site.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin/delete_confirmation.html (moved) (moved from django/trunk/django/conf/admin_templates/delete_confirmation_generic.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/bookmarklets.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/bookmarklets.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/index.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/index.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/missing_docutils.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/missing_docutils.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/model_detail.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/model_detail.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/model_index.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/model_index.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/template_detail.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/template_detail.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/template_filter_index.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/template_filter_index.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/template_tag_index.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/template_tag_index.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/view_detail.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/view_detail.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin_doc/view_index.html (moved) (moved from django/trunk/django/conf/admin_templates/doc/view_index.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin/index.html (moved) (moved from django/trunk/django/conf/admin_templates/index.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin/login.html (moved) (moved from django/trunk/django/conf/admin_templates/login.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin/object_history.html (moved) (moved from django/trunk/django/conf/admin_templates/admin_object_history.html) (1 diff)
- django/trunk/django/contrib/admin/templates/admin/template_validator.html (moved) (moved from django/trunk/django/conf/admin_templates/template_validator.html) (1 diff)
- django/trunk/django/contrib/admin/templates/registration/logged_out.html (moved) (moved from django/trunk/django/conf/admin_templates/registration/logged_out.html) (1 diff)
- django/trunk/django/contrib/admin/templates/registration/password_change_done.html (moved) (moved from django/trunk/django/conf/admin_templates/registration/password_change_done.html) (1 diff)
- django/trunk/django/contrib/admin/templates/registration/password_change_form.html (moved) (moved from django/trunk/django/conf/admin_templates/registration/password_change_form.html) (1 diff)
- django/trunk/django/contrib/admin/templates/registration/password_reset_done.html (moved) (moved from django/trunk/django/conf/admin_templates/registration/password_reset_done.html) (1 diff)
- django/trunk/django/contrib/admin/templates/registration/password_reset_email.html (moved) (moved from django/trunk/django/conf/admin_templates/registration/password_reset_email.html)
- django/trunk/django/contrib/admin/templates/registration/password_reset_form.html (moved) (moved from django/trunk/django/conf/admin_templates/registration/password_reset_form.html) (1 diff)
- django/trunk/django/contrib/admin/templatetags/adminapplist.py (moved) (moved from django/trunk/django/templatetags/adminapplist.py)
- django/trunk/django/contrib/admin/templatetags/adminmedia.py (moved) (moved from django/trunk/django/templatetags/adminmedia.py)
- django/trunk/django/contrib/admin/templatetags/log.py (moved) (moved from django/trunk/django/templatetags/log.py) (1 diff)
- django/trunk/django/contrib/admin/urls/admin.py (moved) (moved from django/trunk/django/conf/urls/admin.py)
- django/trunk/django/contrib/admin/views/main.py (modified) (6 diffs)
- django/trunk/django/contrib/admin/views/template.py (modified) (1 diff)
- django/trunk/django/core/management.py (modified) (3 diffs)
- django/trunk/django/core/servers/basehttp.py (modified) (1 diff)
- django/trunk/django/middleware/admin.py (deleted)
- django/trunk/django/models/auth.py (modified) (1 diff)
- django/trunk/docs/django-admin.txt (modified) (1 diff)
- django/trunk/docs/faq.txt (modified) (1 diff)
- django/trunk/docs/middleware.txt (modified) (1 diff)
- django/trunk/docs/modpython.txt (modified) (4 diffs)
- django/trunk/docs/settings.txt (modified) (3 diffs)
- django/trunk/docs/tutorial01.txt (modified) (5 diffs)
- django/trunk/docs/tutorial02.txt (modified) (6 diffs)
- django/trunk/docs/tutorial03.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/conf/project_template/settings.py
r892 r948 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 = '' … … 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 ) … … 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 = ( django/trunk/django/conf/project_template/urls.py
r124 r948 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 ) django/trunk/django/contrib/admin/templates/admin/404.html
r92 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block title %}Page not found{% endblock %} django/trunk/django/contrib/admin/templates/admin/500.html
r92 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> › Server error</div>{% endblock %} django/trunk/django/contrib/admin/templates/admin/base_site.html
r183 r948 1 {% extends " base" %}1 {% extends "admin/base" %} 2 2 3 3 {% block title %}{{ title }} | Django site admin{% endblock %} django/trunk/django/contrib/admin/templates/admin/delete_confirmation.html
r92 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block content %} django/trunk/django/contrib/admin/templates/admin_doc/bookmarklets.html
r337 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> › <a href="../">Documentation</a> › Bookmarklets</div>{% endblock %} django/trunk/django/contrib/admin/templates/admin_doc/index.html
r391 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> › Documentation</div>{% endblock %} django/trunk/django/contrib/admin/templates/admin_doc/missing_docutils.html
r337 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> › Documentation</div>{% endblock %} django/trunk/django/contrib/admin/templates/admin_doc/model_detail.html
r337 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block extrahead %} django/trunk/django/contrib/admin/templates/admin_doc/model_index.html
r337 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block coltype %}colSM{% endblock %} django/trunk/django/contrib/admin/templates/admin_doc/template_detail.html
r392 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> › <a href="../../">Documentation</a> › Templates › {{ name }}</div>{% endblock %} django/trunk/django/contrib/admin/templates/admin_doc/template_filter_index.html
r337 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block coltype %}colSM{% endblock %} django/trunk/django/contrib/admin/templates/admin_doc/template_tag_index.html
r337 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block coltype %}colSM{% endblock %} django/trunk/django/contrib/admin/templates/admin_doc/view_detail.html
r337 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> › <a href="../../">Documentation</a> › <a href="../">Views</a> › {{ name }}</div>{% endblock %} django/trunk/django/contrib/admin/templates/admin_doc/view_index.html
r391 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block coltype %}colSM{% endblock %} django/trunk/django/contrib/admin/templates/admin/index.html
r684 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block coltype %}colMS{% endblock %} django/trunk/django/contrib/admin/templates/admin/login.html
r123 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}{% endblock %} django/trunk/django/contrib/admin/templates/admin/object_history.html
r92 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %} django/trunk/django/contrib/admin/templates/admin/template_validator.html
r92 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block content %} django/trunk/django/contrib/admin/templates/registration/logged_out.html
r326 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a></div>{% endblock %} django/trunk/django/contrib/admin/templates/registration/password_change_done.html
r327 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> › Password change</div>{% endblock %} django/trunk/django/contrib/admin/templates/registration/password_change_form.html
r327 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> › Password change</div>{% endblock %} django/trunk/django/contrib/admin/templates/registration/password_reset_done.html
r327 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> › Password reset</div>{% endblock %} django/trunk/django/contrib/admin/templates/registration/password_reset_form.html
r327 r948 1 {% extends " base_site" %}1 {% extends "admin/base_site" %} 2 2 3 3 {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> › Password reset</div>{% endblock %} django/trunk/django/contrib/admin/templatetags/log.py
r549 r948 1 from django.models.a uthimport log1 from django.models.admin import log 2 2 from django.core import template 3 3 django/trunk/django/contrib/admin/views/main.py
r931 r948 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.a uthimport log9 from django.models.admin import log 10 10 from django.utils.html import strip_tags 11 11 from django.utils.httpwrappers import HttpResponse, HttpResponseRedirect … … 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 … … 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: … … 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 … … 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, … … 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, django/trunk/django/contrib/admin/views/template.py
r929 r948 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), django/trunk/django/core/management.py
r823 r948 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): … … 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 … … 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 is382 # 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') django/trunk/django/core/servers/basehttp.py
r575 r948 603 603 import django 604 604 self.application = application 605 self.media_dir = django.__path__[0] + '/con f/admin_media'605 self.media_dir = django.__path__[0] + '/contrib/admin/media' 606 606 self.media_url = settings.ADMIN_MEDIA_PREFIX 607 607 django/trunk/django/models/auth.py
r938 r948 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 == ADDITION204 205 def is_change(self):206 return self.action_flag == CHANGE207 208 def is_deletion(self):209 return self.action_flag == DELETION210 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()django/trunk/docs/django-admin.txt
r900 r948 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 django/trunk/docs/faq.txt
r653 r948 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 django/trunk/docs/middleware.txt
r880 r948 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 48 django.middleware.admin.AdminUserRequired49 -----------------------------------------50 51 Limits site access to valid users with the ``is_staff`` flag set. This is52 required by Django's admin, and this middleware requires ``SessionMiddleware``.53 38 54 39 django.middleware.cache.CacheMiddleware django/trunk/docs/modpython.txt
r845 r948 26 26 SetHandler python-program 27 27 PythonHandler django.core.handlers.modpython 28 SetEnv DJANGO_SETTINGS_MODULE myproject.settings .main28 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 … … 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-program62 PythonHandler django.core.handlers.modpython63 SetEnv DJANGO_SETTINGS_MODULE myproject.settings.admin64 PythonDebug On65 </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 ================================================ … … 78 66 ServerName www.example.com 79 67 # ... 80 SetEnv DJANGO_SETTINGS_MODULE myproject.settings .main68 SetEnv DJANGO_SETTINGS_MODULE myproject.settings 81 69 </VirtualHost> 82 70 83 71 <VirtualHost *> 84 ServerName admin.example.com72 ServerName www2.example.com 85 73 # ... 86 SetEnv DJANGO_SETTINGS_MODULE myproject. settings.admin74 SetEnv DJANGO_SETTINGS_MODULE myproject.other_settings 87 75 </VirtualHost> 88 76 … … 96 84 # ... 97 85 <Location "/something"> 98 SetEnv DJANGO_SETTINGS_MODULE myproject.settings .main99 PythonInterpreter myproject _main86 SetEnv DJANGO_SETTINGS_MODULE myproject.settings 87 PythonInterpreter myproject 100 88 </Location> 101 89 102 <Location "/ admin">103 SetEnv DJANGO_SETTINGS_MODULE myproject. settings.admin104 PythonInterpreter myproject_ admin90 <Location "/otherthing"> 91 SetEnv DJANGO_SETTINGS_MODULE myproject.other_settings 92 PythonInterpreter myproject_other 105 93 </Location> 106 94 </VirtualHost> django/trunk/docs/settings.txt
r902 r948 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 the37 ``"myproject.settings"``. Note that the settings module should be on the 38 38 Python `import search path`_. 39 39 … … 48 48 Example (Unix Bash shell):: 49 49 50 export DJANGO_SETTINGS_MODULE=myproject.settings .main50 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 .main55 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 .main60 django-admin.py runserver --settings=myproject.settings 61 61 62 62 .. _django-admin.py: http://www.djangoproject.com/documentation/django_admin/ … … 71 71 SetHandler python-program 72 72 PythonHandler django.core.handlers.modpython 73 SetEnv DJANGO_SETTINGS_MODULE myproject.settings .main73 SetEnv DJANGO_SETTINGS_MODULE myproject.settings 74 74 </Location> 75 75 django/trunk/docs/tutorial01.txt
r747 r948 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: … … 70 64 database's interactive prompt. 71 65 72 Also, note that MySQL and sqlite support is a recent development, and Django73 hasn't been comprehensively tested with either database. If you find any74 bugs in those bindings, please file them in `Django's ticket system`_ so we75 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, … … 85 74 Run the following command:: 86 75 87 django-admin.py init --settings=myproject.settings .main76 django-admin.py init --settings=myproject.settings 88 77 89 78 The ``django-admin.py`` utility generally needs to know which settings module … … 93 82 how you do that in the Bash shell on Unix:: 94 83 95 export DJANGO_SETTINGS_MODULE=myproject.settings .main84 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 .main88 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 … … 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 django/trunk/docs/tutorial02.txt
r596 r948 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 ===================== … … 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). … … 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
