From 155a7c628f128482aa64e870f72a4ccd182ce4aa Mon Sep 17 00:00:00 2001 From: Cyril Robert Date: Tue, 2 Mar 2010 11:48:17 -0500 Subject: [PATCH] =?utf8?q?Premi=C3=A8re=20version=20:=20mise=20en=20route=20?= =?utf8?q?du=20suivi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .gitignore | 30 +++++++++++++ auf_savoirs_django/development.py | 4 ++ auf_savoirs_django/production.py | 2 + auf_savoirs_django/savoirs/models.py | 3 ++ auf_savoirs_django/savoirs/tests.py | 23 ++++++++++ auf_savoirs_django/savoirs/views.py | 1 + auf_savoirs_django/settings.py | 64 ++++++++++++++++++++++++++++ auf_savoirs_django/urls.py | 19 +++++++++ bootstrap.py | 77 ++++++++++++++++++++++++++++++++++ buildout.cfg | 9 ++++ devel.cfg | 7 ++++ 11 files changed, 239 insertions(+) create mode 100644 .gitignore create mode 100644 README.txt create mode 100644 auf_savoirs_django/__init__.py create mode 100644 auf_savoirs_django/development.py create mode 100644 auf_savoirs_django/production.py create mode 100644 auf_savoirs_django/savoirs/__init__.py create mode 100644 auf_savoirs_django/savoirs/models.py create mode 100644 auf_savoirs_django/savoirs/tests.py create mode 100644 auf_savoirs_django/savoirs/views.py create mode 100644 auf_savoirs_django/settings.py create mode 100644 auf_savoirs_django/urls.py create mode 100644 bootstrap.py create mode 100644 buildout.cfg create mode 100644 devel.cfg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..04e93e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# binaires +*.pyc +*.pyo + +# Fichier temporaires: +.*.swp +.*.swo +*~ +\#*# + +# DB de dev +*.db + +# restants de merge +*.orig +*.rej + +# Configuration du projet - par environnement +conf.py +django.wsgi + +# buildout +.installed.cfg +bin +develop-eggs +downloads +eggs +log +parts +tmp diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..e69de29 diff --git a/auf_savoirs_django/__init__.py b/auf_savoirs_django/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/auf_savoirs_django/development.py b/auf_savoirs_django/development.py new file mode 100644 index 0000000..e35c583 --- /dev/null +++ b/auf_savoirs_django/development.py @@ -0,0 +1,4 @@ + +from auf_savoirs_django.settings import * +DEBUG=True +TEMPLATE_DEBUG=DEBUG diff --git a/auf_savoirs_django/production.py b/auf_savoirs_django/production.py new file mode 100644 index 0000000..45bdcff --- /dev/null +++ b/auf_savoirs_django/production.py @@ -0,0 +1,2 @@ + +from auf_savoirs_django.settings import * diff --git a/auf_savoirs_django/savoirs/__init__.py b/auf_savoirs_django/savoirs/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/auf_savoirs_django/savoirs/models.py b/auf_savoirs_django/savoirs/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/auf_savoirs_django/savoirs/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/auf_savoirs_django/savoirs/tests.py b/auf_savoirs_django/savoirs/tests.py new file mode 100644 index 0000000..2247054 --- /dev/null +++ b/auf_savoirs_django/savoirs/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/auf_savoirs_django/savoirs/views.py b/auf_savoirs_django/savoirs/views.py new file mode 100644 index 0000000..60f00ef --- /dev/null +++ b/auf_savoirs_django/savoirs/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/auf_savoirs_django/settings.py b/auf_savoirs_django/settings.py new file mode 100644 index 0000000..ac84b78 --- /dev/null +++ b/auf_savoirs_django/settings.py @@ -0,0 +1,64 @@ + +import os + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = 'auf_savoirs_django.db' +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. + +TIME_ZONE = 'America/Chicago' + +LANGUAGE_CODE = 'en-us' + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +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). +# 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 = '/admin_media/' + +# Don't share this with anybody. +SECRET_KEY = 'k5m_cyht&ipi!nbxng9-5zc!4_q84opflhsn#d3%^3=9gm44tt' + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.doc.XViewMiddleware', +) + +ROOT_URLCONF = 'auf_savoirs_django.urls' + + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.admin', +) + +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +) + +TEMPLATE_DIRS = ( + os.path.join(os.path.dirname(__file__), "templates"), +) + + diff --git a/auf_savoirs_django/urls.py b/auf_savoirs_django/urls.py new file mode 100644 index 0000000..9dd40d5 --- /dev/null +++ b/auf_savoirs_django/urls.py @@ -0,0 +1,19 @@ + +from django.conf.urls.defaults import patterns, include, handler500 +from django.conf import settings +from django.contrib import admin +admin.autodiscover() + +handler500 # Pyflakes + +urlpatterns = patterns( + '', + (r'^admin/(.*)', admin.site.root), + (r'^accounts/login/$', 'django.contrib.auth.views.login'), +) + +if settings.DEBUG: + urlpatterns += patterns('', + (r'^media/(?P.*)$', 'django.views.static.serve', + {'document_root': settings.MEDIA_ROOT}), + ) diff --git a/bootstrap.py b/bootstrap.py new file mode 100644 index 0000000..7728587 --- /dev/null +++ b/bootstrap.py @@ -0,0 +1,77 @@ +############################################################################## +# +# Copyright (c) 2006 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""Bootstrap a buildout-based project + +Simply run this script in a directory containing a buildout.cfg. +The script accepts buildout command-line options, so you can +use the -c option to specify an alternate configuration file. + +$Id$ +""" + +import os, shutil, sys, tempfile, urllib2 + +tmpeggs = tempfile.mkdtemp() + +is_jython = sys.platform.startswith('java') + +try: + import pkg_resources +except ImportError: + ez = {} + exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' + ).read() in ez + ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) + + import pkg_resources + +if sys.platform == 'win32': + def quote(c): + if ' ' in c: + return '"%s"' % c # work around spawn lamosity on windows + else: + return c +else: + def quote (c): + return c + +cmd = 'from setuptools.command.easy_install import main; main()' +ws = pkg_resources.working_set + +if is_jython: + import subprocess + + assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd', + quote(tmpeggs), 'zc.buildout'], + env=dict(os.environ, + PYTHONPATH= + ws.find(pkg_resources.Requirement.parse('setuptools')).location + ), + ).wait() == 0 + +else: + assert os.spawnle( + os.P_WAIT, sys.executable, quote (sys.executable), + '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout', + dict(os.environ, + PYTHONPATH= + ws.find(pkg_resources.Requirement.parse('setuptools')).location + ), + ) == 0 + +ws.add_entry(tmpeggs) +ws.require('zc.buildout') +import zc.buildout.buildout +zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) +shutil.rmtree(tmpeggs) diff --git a/buildout.cfg b/buildout.cfg new file mode 100644 index 0000000..a81fc2a --- /dev/null +++ b/buildout.cfg @@ -0,0 +1,9 @@ +[buildout] +parts = django + +[django] +recipe = djangorecipe +version = 1.1.1 +project = auf_savoirs_django +wsgi=true +settings=production diff --git a/devel.cfg b/devel.cfg new file mode 100644 index 0000000..2a1c4c8 --- /dev/null +++ b/devel.cfg @@ -0,0 +1,7 @@ +[buildout] +extends=buildout.cfg + +[django] +wsgi=false +settings=development + -- 1.7.10.4