Skip to content

Commit

Permalink
MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards…
Browse files Browse the repository at this point in the history
…-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrian committed May 2, 2006
1 parent 1e4b6b3 commit 0b99a86
Show file tree
Hide file tree
Showing 366 changed files with 17,799 additions and 11,165 deletions.
4 changes: 4 additions & 0 deletions AUTHORS
Expand Up @@ -71,6 +71,7 @@ answer newbie questions, and generally made Django that much better:
lakin.wecker@gmail.com
Stuart Langridge <http://www.kryogenix.org/>
Eugene Lazutkin <http://lazutkin.com/blog/>
Christopher Lenz <http://www.cmlenz.net/>
limodou
Martin Maney <http://www.chipy.org/Martin_Maney>
Manuzhai
Expand All @@ -79,6 +80,7 @@ answer newbie questions, and generally made Django that much better:
mattycakes@gmail.com
Jason McBrayer <http://www.carcosa.net/jason/>
michael.mcewan@gmail.com
mir@noris.de
mmarshall
Eric Moritz <http://eric.themoritzfamily.com/>
Robin Munn <http://www.geekforgod.com/>
Expand All @@ -102,7 +104,9 @@ answer newbie questions, and generally made Django that much better:
Aaron Swartz <http://www.aaronsw.com/>
Tom Tobin
Joe Topjian <http://joe.terrarum.net/geek/code/python/django/>
Malcolm Tredinnick
Amit Upadhyay
Geert Vanderkelen
Milton Waddams
Rachel Willmer <http://www.willmer.com/kb/>
wojtek
Expand Down
2 changes: 1 addition & 1 deletion django/__init__.py
@@ -1 +1 @@
VERSION = (0, 9, 1, 'SVN')
VERSION = (0, 95, 'post-magic-removal')
10 changes: 5 additions & 5 deletions django/bin/daily_cleanup.py
@@ -1,17 +1,17 @@
"Daily cleanup file"

from django.core.db import db
from django.db import backend, connection, transaction

DOCUMENTATION_DIRECTORY = '/home/html/documentation/'

def clean_up():
# Clean up old database records
cursor = db.cursor()
cursor = connection.cursor()
cursor.execute("DELETE FROM %s WHERE %s < NOW()" % \
(db.quote_name('core_sessions'), db.quote_name('expire_date')))
(backend.quote_name('core_sessions'), backend.quote_name('expire_date')))
cursor.execute("DELETE FROM %s WHERE %s < NOW() - INTERVAL '1 week'" % \
(db.quote_name('registration_challenges'), db.quote_name('request_date')))
db.commit()
(backend.quote_name('registration_challenges'), backend.quote_name('request_date')))
transaction.commit_unless_managed()

if __name__ == "__main__":
clean_up()
73 changes: 73 additions & 0 deletions django/conf/__init__.py
@@ -0,0 +1,73 @@
"""
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""

import os
import sys
from django.conf import global_settings

ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"

class Settings:

def __init__(self, settings_module):

# update this dict from global settings (but only for ALL_CAPS settings)
for setting in dir(global_settings):
if setting == setting.upper():
setattr(self, setting, getattr(global_settings, setting))

# store the settings module in case someone later cares
self.SETTINGS_MODULE = settings_module

try:
mod = __import__(self.SETTINGS_MODULE, '', '', [''])
except ImportError, e:
raise EnvironmentError, "Could not import settings '%s' (is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)

# Settings that should be converted into tuples if they're mistakenly entered
# as strings.
tuple_settings = ("INSTALLED_APPS", "TEMPLATE_DIRS")

for setting in dir(mod):
if setting == setting.upper():
setting_value = getattr(mod, setting)
if setting in tuple_settings and type(setting_value) == str:
setting_value = (setting_value,) # In case the user forgot the comma.
setattr(self, setting, setting_value)

# Expand entries in INSTALLED_APPS like "django.contrib.*" to a list
# of all those apps.
new_installed_apps = []
for app in self.INSTALLED_APPS:
if app.endswith('.*'):
appdir = os.path.dirname(__import__(app[:-2], '', '', ['']).__file__)
for d in os.listdir(appdir):
if d.isalpha() and os.path.isdir(os.path.join(appdir, d)):
new_installed_apps.append('%s.%s' % (app[:-2], d))
else:
new_installed_apps.append(app)
self.INSTALLED_APPS = new_installed_apps

# move the time zone info into os.environ
os.environ['TZ'] = self.TIME_ZONE

# try to load DJANGO_SETTINGS_MODULE
try:
settings_module = os.environ[ENVIRONMENT_VARIABLE]
if not settings_module: # If it's set but is an empty string.
raise KeyError
except KeyError:
raise EnvironmentError, "Environment variable %s is undefined." % ENVIRONMENT_VARIABLE

# instantiate the configuration object
settings = Settings(settings_module)

# install the translation machinery so that it is available
from django.utils import translation
translation.install()

3 changes: 3 additions & 0 deletions django/conf/app_template/models.py
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
1 change: 0 additions & 1 deletion django/conf/app_template/models/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions django/conf/app_template/models/app_name.py

This file was deleted.

20 changes: 11 additions & 9 deletions django/conf/global_settings.py
Expand Up @@ -79,7 +79,7 @@
SEND_BROKEN_LINK_EMAILS = False

# Database connection info.
DATABASE_ENGINE = 'postgresql' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_ENGINE = '' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
Expand All @@ -102,19 +102,16 @@
# List of locations of the template source files, in search order.
TEMPLATE_DIRS = ()

# Extension on all templates.
TEMPLATE_FILE_EXTENSION = '.html'

# List of callables that know how to import templates from various sources.
# See the comments in django/core/template/loader.py for interface
# documentation.
TEMPLATE_LOADERS = (
'django.core.template.loaders.filesystem.load_template_source',
'django.core.template.loaders.app_directories.load_template_source',
# 'django.core.template.loaders.eggs.load_template_source',
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

# List of processors used by DjangoContext to populate the context.
# List of processors used by RequestContext to populate the context.
# Each one should be a callable that takes the request object as its
# only parameter and returns a dictionary to add to the context.
TEMPLATE_CONTEXT_PROCESSORS = (
Expand Down Expand Up @@ -205,6 +202,10 @@
# http://psyco.sourceforge.net/
ENABLE_PSYCO = False

# Do you want to manage transactions manually?
# Hint: you really don't!
TRANSACTIONS_MANAGED = False

##############
# MIDDLEWARE #
##############
Expand All @@ -213,7 +214,8 @@
# this middleware classes will be applied in the order given, and in the
# response phase the middleware will be applied in reverse order.
MIDDLEWARE_CLASSES = (
"django.middleware.sessions.SessionMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
# "django.middleware.http.ConditionalGetMiddleware",
# "django.middleware.gzip.GZipMiddleware",
"django.middleware.common.CommonMiddleware",
Expand Down
15 changes: 10 additions & 5 deletions django/conf/project_template/settings.py
Expand Up @@ -9,7 +9,7 @@

MANAGERS = ADMINS

DATABASE_ENGINE = 'postgresql' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_ENGINE = '' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
Expand Down Expand Up @@ -45,14 +45,15 @@

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.core.template.loaders.filesystem.load_template_source',
'django.core.template.loaders.app_directories.load_template_source',
# 'django.core.template.loaders.eggs.load_template_source',
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
"django.middleware.common.CommonMiddleware",
"django.middleware.sessions.SessionMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.doc.XViewMiddleware",
)

Expand All @@ -64,4 +65,8 @@
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
)
2 changes: 1 addition & 1 deletion django/conf/project_template/urls.py
Expand Up @@ -5,5 +5,5 @@
# (r'^{{ project_name }}/', include('{{ project_name }}.apps.foo.urls.foo')),

# Uncomment this for admin:
# (r'^admin/', include('django.contrib.admin.urls.admin')),
# (r'^admin/', include('django.contrib.admin.urls')),
)
77 changes: 0 additions & 77 deletions django/conf/settings.py

This file was deleted.

14 changes: 7 additions & 7 deletions django/conf/urls/registration.py
@@ -1,9 +1,9 @@
from django.conf.urls.defaults import *

urlpatterns = patterns('',
(r'^login/$', 'django.views.auth.login.login'),
(r'^logout/$', 'django.views.auth.login.logout'),
(r'^login_another/$', 'django.views.auth.login.logout_then_login'),
(r'^login/$', 'django.contrib.auth.view.login'),
(r'^logout/$', 'django.contrib.auth.views.logout'),
(r'^login_another/$', 'django.contrib.auth.views.logout_then_login'),

(r'^register/$', 'ellington.registration.views.registration.signup'),
(r'^register/(?P<challenge_string>\w{32})/$', 'ellington.registration.views.registration.register_form'),
Expand All @@ -12,8 +12,8 @@
(r'^profile/welcome/$', 'ellington.registration.views.profile.profile_welcome'),
(r'^profile/edit/$', 'ellington.registration.views.profile.edit_profile'),

(r'^password_reset/$', 'django.views.registration.passwords.password_reset'),
(r'^password_reset/done/$', 'django.views.registration.passwords.password_reset_done'),
(r'^password_change/$', 'django.views.registration.passwords.password_change'),
(r'^password_change/done/$', 'django.views.registration.passwords.password_change_done'),
(r'^password_reset/$', 'django.contrib.auth.views.password_reset'),
(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'),
(r'^password_change/$', 'django.contrib.auth.views.password_change'),
(r'^password_change/done/$', 'django.contrib.auth.views.password_change_done'),
)

0 comments on commit 0b99a86

Please sign in to comment.