From 59284d6bf0825e897c87aed9f96e0236e115349f Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Wed, 21 Dec 2011 23:33:17 +0100 Subject: [PATCH] Add .gitignore and update settings.py/manage.py to django 1.4. --- .gitignore | 1 + example/manage.py | 13 ------------- example/settings.py | 15 ++++----------- manage.py | 10 ++++++++++ 4 files changed, 15 insertions(+), 24 deletions(-) create mode 100644 .gitignore delete mode 100755 example/manage.py create mode 100755 manage.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/example/manage.py b/example/manage.py deleted file mode 100755 index 6a3a879..0000000 --- a/example/manage.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python -import sys, os -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) - -if __name__ == "__main__": - execute_manager(settings) diff --git a/example/settings.py b/example/settings.py index 40f669f..85b26f9 100644 --- a/example/settings.py +++ b/example/settings.py @@ -1,9 +1,9 @@ -# Django settings for example2 project. +# Django settings for example project. import os PATH = os.path.dirname(os.path.abspath(__file__)) -DEBUG = False +DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( @@ -14,12 +14,8 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': 'landscape', # Or path to database file if using sqlite3. - 'USER': 'postgres', # Not used with sqlite3. - 'PASSWORD': 'postgres', # Not used with sqlite3. - 'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '5432', # Set to empty string for default. Not used with sqlite3. + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'landscape', } } @@ -146,6 +142,3 @@ }, } } - -EMAIL_HOST='localhost' -EMAIL_PORT=1025 diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..05013d5 --- /dev/null +++ b/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os, sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) +