From 7d337e428674975519e8f4a374b0c369b136ae3b Mon Sep 17 00:00:00 2001 From: yomguy Date: Tue, 21 Jun 2011 11:36:43 +0200 Subject: [PATCH] update sandbox example (with sqlite3), cleanup, go to 0.9.8 --- example/sandbox/__init__.py | 0 example/sandbox/manage.py | 11 +++++++++++ example/sandbox/settings.py | 32 ++++++++++++++------------------ telemeta/__init__.py | 2 +- telemeta/models/system.py | 18 ------------------ 5 files changed, 26 insertions(+), 37 deletions(-) create mode 100644 example/sandbox/__init__.py create mode 100755 example/sandbox/manage.py diff --git a/example/sandbox/__init__.py b/example/sandbox/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/example/sandbox/manage.py b/example/sandbox/manage.py new file mode 100755 index 00000000..bcdd55e2 --- /dev/null +++ b/example/sandbox/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/python +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/sandbox/settings.py b/example/sandbox/settings.py index 56fc003a..18ef40c1 100644 --- a/example/sandbox/settings.py +++ b/example/sandbox/settings.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- # Django settings for sandbox project. +import os.path + DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -12,11 +14,10 @@ MANAGERS = ADMINS DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -# 'OPTIONS': { 'init_command': 'SET storage_engine=INNODB', }, - 'NAME': 'telemeta', # Or path to database file if using sqlite3. - 'USER': '******', # Not used with sqlite3. - 'PASSWORD': '************', # Not used with sqlite3. + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': 'sandbox.db', # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } @@ -50,7 +51,7 @@ USE_L10N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '/home/dev/telemeta/sandboxes/sandbox_generic/media/' +MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media/') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). @@ -60,10 +61,10 @@ MEDIA_URL = '' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = 'http://wm22.parisson.com/django/media/' +ADMIN_MEDIA_PREFIX = 'http://localhost/django/media/' # Make this unique, and don't share it with anybody. -SECRET_KEY = '***************************************' +SECRET_KEY = 'a8l7%06wr2k+3=%#*#@#rvop2mmzko)44%7k(zx%lls^ihm9^5' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( @@ -82,13 +83,13 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.locale.LocaleMiddleware', ) -ROOT_URLCONF = 'sandbox_generic.urls' +ROOT_URLCONF = 'sandbox.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - '/home/dev/telemeta/sandboxes/sandbox_generic/templates/', + '', ) INSTALLED_APPS = ( @@ -107,20 +108,15 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', ) -#LOCALE_PATHS = ( - #'/home/dev/telemeta/telemeta/telemeta/locale', -#) - -TELEMETA_ORGANIZATION = 'CREM' -TELEMETA_SUBJECTS = ('Ethnomusicology', 'Research') +TELEMETA_ORGANIZATION = 'Parisson' +TELEMETA_SUBJECTS = ('Test', 'Sandbox') TELEMETA_GMAP_KEY = 'ABQIAAAArg7eSfnfTkBRma8glnGrlxRVbMrhnNNvToCbZQtWdaMbZTA_3RRGObu5PDoiBImgalVnnLU2yN4RMA' TELEMETA_DOWNLOAD_ENABLED = True TELEMETA_STREAMING_FORMATS = ('mp3', 'ogg') TELEMETA_PUBLIC_ACCESS_PERIOD = 51 AUTH_PROFILE_MODULE = 'telemeta.userprofile' -TELEMETA_OAI_HOST = 'telemeta.wm22.parisson.org' -TELEMETA_OAI_REPOSITORY_NAME = "University of Paris 10. CNRS. Research Centre of Ethnomusicology (CREM). Sound archives" +TELEMETA_OAI_REPOSITORY_NAME = "Telemeta TEST sandbox" LOGIN_URL = '/login' LOGIN_REDIRECT_URL = '/' diff --git a/telemeta/__init__.py b/telemeta/__init__.py index d023d9a5..3f685b80 100644 --- a/telemeta/__init__.py +++ b/telemeta/__init__.py @@ -12,7 +12,7 @@ U{http://telemeta.org} """ __docformat__ = 'epytext en' -__version__ = '0.9.6' +__version__ = '0.9.8' __url__ = 'http://telemeta.org' __copyright__ = '(C) 2007-2011 Parisson' __license__ = 'CeCILL-2' diff --git a/telemeta/models/system.py b/telemeta/models/system.py index 17111759..f6a892e5 100644 --- a/telemeta/models/system.py +++ b/telemeta/models/system.py @@ -74,24 +74,6 @@ class Revision(ModelCore): db_table = 'revisions' -class OldUser(ModelCore): - "Telemeta user (NOT USED ANYMORE !)" - LEVEL_CHOICES = (('user', 'user'), ('maintainer', 'maintainer'), ('admin', 'admin')) - - username = CharField(_('username'), primary_key=True, max_length=64, required=True) - level = CharField(_('level'), choices=LEVEL_CHOICES, max_length=32, required=True) - first_name = CharField(_('first name')) - last_name = CharField(_('last name')) - phone = CharField(_('phone')) - email = CharField(_('email')) - - class Meta(MetaCore): - db_table = 'users' - - def __unicode__(self): - return self.username - - class UserProfile(django.db.models.Model): "User profile extension" -- 2.39.5