diff --git a/dev_setup/settings.py b/dev_setup/settings.py new file mode 100644 index 0000000..95e15ec --- /dev/null +++ b/dev_setup/settings.py @@ -0,0 +1,158 @@ +#-*- coding: utf-8 -*- +# Copyright (C) 1998-2010 by the Free Software Foundation, Inc. +# +# This file is part of GNU Mailman. +# +# GNU Mailman 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 3 of the License, or (at your option) +# any later version. +# +# GNU Mailman 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 +# GNU Mailman. If not, see . + +"""Import App Directory to syspath""" + +import os +import sys +PROJECT_ROOT = os.path.dirname(__file__) +sys.path.insert(0, os.path.split(PROJECT_ROOT)[0]) + +"""Django settings for mailmanweb project.""" + +import os.path + +INTERNAL_IPS = ('127.0.0.1',) + +# Mailman API credentials +REST_SERVER = 'http://localhost:8001' +API_USER = 'restadmin' +API_PASS = 'restpass' +# Mailman bin directory (necessary to run tests for mailmanweb) +MAILMAN_TEST_BINDIR = '/home/flo/Development/mailman/bin' + +# CSS theme for mailman-django application +MAILMAN_THEME = "default" + + +PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + #('Admin', 'webmaster@example.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' +DATABASE_NAME = os.path.join(PROJECT_PATH, 'mmtest.db') + +# 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 = 'Europe/Berlin' + +# 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 static files. +STATIC_ROOT = os.path.join(PROJECT_PATH, 'static/') +# Absolute path to the directory that holds media files. +MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media/') +# URL that handles the media served from STATIC_ROOT. Make sure to use a +STATIC_URL = '/static/' +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +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 = '/static/admin/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '$!-7^wl#wiifjbh)5@f7ji%x!vp7s1vzbvwt26hxv$idixq0u0' + +# 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', +) + +AUTHENTICATION_BACKENDS = ( + 'mailmanweb.auth.restbackend.RESTBackend', + 'django.contrib.auth.backends.ModelBackend', + 'social_auth.backends.OpenIDBackend', + 'social_auth.backends.browserid.BrowserIDBackend' +) + +TEMPLATE_CONTEXT_PROCESSORS = ( + "django.contrib.auth.context_processors.auth", + "django.core.context_processors.debug", + "django.core.context_processors.i18n", + "django.core.context_processors.media", + "django.core.context_processors.static", + "django.core.context_processors.csrf", + "django.contrib.messages.context_processors.messages", + "mailmanweb.context_processors.mailmanweb", + 'social_auth.context_processors.social_auth_by_name_backends', + 'social_auth.context_processors.social_auth_backends', + 'social_auth.context_processors.social_auth_by_type_backends', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + #'debug_toolbar.middleware.DebugToolbarMiddleware', +) + +# Set `mailmanweb.urls` as main url config if mailmanweb +# is the only app you want to serve. +ROOT_URLCONF = 'urls' + +TEMPLATE_DIRS = ( + # uncomment if you like to overwrite the default templates: + # os.path.join(PROJECT_PATH, "/templates/mailmanweb"), +) + +STATICFILES_FINDERS = ( + "django.contrib.staticfiles.finders.FileSystemFinder", + "django.contrib.staticfiles.finders.AppDirectoriesFinder", +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'django.contrib.staticfiles', + 'mailmanweb', + 'social_auth', + #'debug_toolbar', +) +LOGIN_URL = '/login-form/' +LOGIN_REDIRECT_URL = '/logged-in/' +LOGIN_ERROR_URL = '/login-error/' +SOCIAL_AUTH_COMPLETE_URL_NAME = 'socialauth_complete' +SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete' +SOCIAL_AUTH_DEFAULT_USERNAME = 'new_social_auth_user' +SOCIAL_AUTH_UUID_LENGTH = 16 + diff --git a/dev_setup/urls.py b/dev_setup/urls.py new file mode 100644 index 0000000..fe78154 --- /dev/null +++ b/dev_setup/urls.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 1998-2010 by the Free Software Foundation, Inc. +# +# This file is part of GNU Mailman. +# +# GNU Mailman 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 3 of the License, or (at your option) +# any later version. +# +# GNU Mailman 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 +# GNU Mailman. If not, see . + +from django.conf.urls.defaults import * +from django.conf import settings + +# Uncomment the next two lines to enable the admin: +from django.contrib import admin +admin.autodiscover() + +import mailmanweb +# Import mailman urls and set urlpatterns if you want to hook +# mailman_django into an existing django site. +# Otherwise set ROOT_URLCONF in settings.py to +# `mailman_django.urls`. +# from mailman_django import urls as mailman_urls + +print 'mailmanweb was here' +print mailmanweb.__file__ +urlpatterns = patterns('', + (r'^mailmanweb/', include('mailmanweb.urls')), + url(r'', include('social_auth.urls')), +)