From d095db81f5167a4e40c6eb60eb9557152c781cb6 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 16 Jul 2005 03:48:36 +0000 Subject: [PATCH] 'django-admin.py init' now creates a site in the sites table, and project_template.settings.main.SITE_ID is now set to 1 git-svn-id: http://code.djangoproject.com/svn/django/trunk@93 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/bin/django-admin.py | 1 + django/conf/project_template/settings/main.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/django/bin/django-admin.py b/django/bin/django-admin.py index f6950dbf06f..ca4eb99e51c 100644 --- a/django/bin/django-admin.py +++ b/django/bin/django-admin.py @@ -271,6 +271,7 @@ def init(): cursor = db.db.cursor() for sql in get_sql_create(core) + get_sql_create(auth) + get_sql_initial_data(core) + get_sql_initial_data(auth): cursor.execute(sql) + cursor.execute("INSERT INTO %s (domain, name) VALUES ('mysite.com', 'My Django site')" % core.Site._meta.db_table) except Exception, e: sys.stderr.write("Error: The database couldn't be initialized. Here's the full exception:\n%s\n" % e) db.db.rollback() diff --git a/django/conf/project_template/settings/main.py b/django/conf/project_template/settings/main.py index eb4c5dbc3ff..b59ff74059a 100644 --- a/django/conf/project_template/settings/main.py +++ b/django/conf/project_template/settings/main.py @@ -16,6 +16,8 @@ DATABASE_USER = '' DATABASE_PASSWORD = '' DATABASE_HOST = '' # Set to empty string for localhost +SITE_ID = 1 + # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = ''