From c62c3a56824576f8395b7c1ffdc6a35e2f2609f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20M=C3=BCllegger?= Date: Sat, 16 Oct 2010 15:01:30 +0200 Subject: [PATCH] Initial app layout. --- AUTHORS.txt | 1 + CHANGES.rst | 5 +++ LICENSE.txt | 25 +++++++++++++ MANIFEST.in | 5 +++ README.rst | 2 + manage.py | 10 +++++ requirements.txt | 2 + runtests.py | 23 ++++++++++++ settings.py | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 58 +++++++++++++++++++++++++++++ 10 files changed, 228 insertions(+) create mode 100644 AUTHORS.txt create mode 100644 CHANGES.rst create mode 100644 LICENSE.txt create mode 100644 MANIFEST.in create mode 100644 README.rst create mode 100644 manage.py create mode 100644 requirements.txt create mode 100644 runtests.py create mode 100644 settings.py create mode 100644 setup.py diff --git a/AUTHORS.txt b/AUTHORS.txt new file mode 100644 index 0000000..711d3f9 --- /dev/null +++ b/AUTHORS.txt @@ -0,0 +1 @@ +Gregor Müllegger diff --git a/CHANGES.rst b/CHANGES.rst new file mode 100644 index 0000000..eb8e112 --- /dev/null +++ b/CHANGES.rst @@ -0,0 +1,5 @@ +Changlog +======== + +0.1.0 +----- diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..20726ae --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,25 @@ +Copyright (c) 2010, Gregor Müllegger +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..911f141 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include AUTHORS.txt +include CHANGES.rst +include LICENSE.txt +include MANIFEST.in +include README.rst diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..0a20eb0 --- /dev/null +++ b/README.rst @@ -0,0 +1,2 @@ +django-appname +============== diff --git a/manage.py b/manage.py new file mode 100644 index 0000000..a6e5459 --- /dev/null +++ b/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os + +os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' + + +if __name__ == '__main__': + from django.core.management import execute_from_command_line + execute_from_command_line() + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8a964ed --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +django +django-extensions diff --git a/runtests.py b/runtests.py new file mode 100644 index 0000000..ba853a9 --- /dev/null +++ b/runtests.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +import os, sys + +os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' +parent = os.path.dirname(os.path.abspath(__file__)) + +sys.path.insert(0, parent) + +from django.test.simple import run_tests + + +def runtests(*args): + failures = run_tests( + args or [ + 'appname', + 'appname_tests', + ], + verbosity=1, interactive=True) + sys.exit(failures) + +if __name__ == '__main__': + runtests(*sys.argv[1:]) + diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..ac0b4fb --- /dev/null +++ b/settings.py @@ -0,0 +1,97 @@ +# Django settings for testsite project. +import os +PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = os.path.join(PROJECT_ROOT, 'db.sqlite') # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'appname_tests', '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). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '/media/' + +# 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 = '/media/admin/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + '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.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.doc.XViewMiddleware', +) + +ROOT_URLCONF = 'appname_tests.urls' + +TEMPLATE_DIRS = ( + os.path.join(PROJECT_ROOT, 'appname_tests', 'templates'), +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'django_extensions', + + 'appname', +) + +TEMPLATE_CONTEXT_PROCESSORS = ( + "django.core.context_processors.auth", + "django.core.context_processors.debug", + "django.core.context_processors.i18n", + "django.core.context_processors.media", +) + +try: + from local_settings import * +except ImportError: + pass + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..8a3b133 --- /dev/null +++ b/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from setuptools import setup + + +class UltraMagicString(object): + ''' + Taken from + http://stackoverflow.com/questions/1162338/whats-the-right-way-to-use-unicode-metadata-in-setup-py + ''' + def __init__(self, value): + self.value = value + + def __str__(self): + return self.value + + def __unicode__(self): + return self.value.decode('UTF-8') + + def __add__(self, other): + return UltraMagicString(self.value + str(other)) + + def split(self, *args, **kw): + return self.value.split(*args, **kw) + + +long_description = UltraMagicString(u'\n\n'.join(( + file('README.rst').read(), + file('CHANGES.rst').read(), +))) + + +setup( + name = 'django-appname', + version = '0.1.0pre', + url = 'https://github.com/gregmuellegger/django-appname', + license = 'BSD', + description = '', + long_description = long_description, + author = UltraMagicString('Gregor Müllegger'), + author_email = 'gregor@muellegger.de', + classifiers = [ + 'Development Status :: 4 - Beta', + 'Environment :: Web Environment', + 'Framework :: Django', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + ], + packages = [ + 'appname', + ], + install_requires = ['setuptools'], + test_suite = 'runtests.runtests', +) +