forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards…
…-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
1 parent
d5dbeaa
commit f69cf70
Showing
366 changed files
with
17,799 additions
and
11,165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ answer newbie questions, and generally made Django that much better: | |
[email protected] | ||
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 | ||
|
@@ -79,6 +80,7 @@ answer newbie questions, and generally made Django that much better: | |
[email protected] | ||
Jason McBrayer <http://www.carcosa.net/jason/> | ||
[email protected] | ||
[email protected] | ||
mmarshall | ||
Eric Moritz <http://eric.themoritzfamily.com/> | ||
Robin Munn <http://www.geekforgod.com/> | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = (0, 9, 1, 'SVN') | ||
VERSION = (0, 95, 'post-magic-removal') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.