From 0b2c4760923800cb6305b4cd072652cb359695be Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Thu, 17 Sep 2015 00:20:32 +0200 Subject: [PATCH] First commit, not working --- database/manage.py | 10 +++ database/{platal_models.py => platal/models.py} | 0 database/settings_sqlitedb.py | 99 +++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100755 database/manage.py rename database/{platal_models.py => platal/models.py} (100%) create mode 100644 database/settings_sqlitedb.py diff --git a/database/manage.py b/database/manage.py new file mode 100755 index 0000000..09d3735 --- /dev/null +++ b/database/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings_sqlitedb") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/database/platal_models.py b/database/platal/models.py similarity index 100% rename from database/platal_models.py rename to database/platal/models.py diff --git a/database/settings_sqlitedb.py b/database/settings_sqlitedb.py new file mode 100644 index 0000000..5c28e40 --- /dev/null +++ b/database/settings_sqlitedb.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +#*************************************************************************** +#* Copyright (C) 2015 Polytechnique.org * +#* http://opensource.polytechnique.org/ * +#* * +#* This program is free software; you can redistribute it and/or modify * +#* it under the terms of the GNU General Public License as published by * +#* the Free Software Foundation; either version 2 of the License, or * +#* (at your option) any later version. * +#* * +#* This program is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU General Public License for more details. * +#* * +#* You should have received a copy of the GNU General Public License * +#* along with this program; if not, write to the Free Software * +#* Foundation, Inc., * +#* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * +#***************************************************************************/ +"""Django settings for a local SQLite database""" + +# Build paths inside the project like this: os.path.join(ROOT_DIR, ...) +import os.path +CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) + +DEBUG = True + +INSTALLED_APPS = ( + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'platal', +) + +ADMINS = ( + # ('Your Name', 'your_email@example.com'), +) + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(CURRENT_DIR, 'db.sqlite'), + 'ATOMIC_REQUESTS': True, + } +} + +# 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. +# On Unix systems, a value of None will cause Django to use the same +# timezone as the operating system. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'Europe/Paris' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +LANGUAGES = ( + ('en', 'English'), + ('fr', 'French'), +) + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale. +USE_L10N = True + +# If you set this to False, Django will not use timezone-aware datetimes. +USE_TZ = True + +SECRET_KEY = 'Key for development purpose only ;)' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', +) + +INTERNAL_IPS = ('127.0.0.1', '::1') -- 2.1.4