diff --git a/MANIFEST.in b/MANIFEST.in
index dbabde1..77048db 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,10 +1,11 @@
include COPYING
-include ez_setup.py
include *.rst
recursive-include src/postorius *.py *.html *.js *.rst *.txt
prune src/postorius/doc/_build
graft src/postorius/static
include src/postorius/doc/Makefile
-include dev-requirements.txt tox.ini
-recursive-include testing *.py *.cfg
+include tox.ini
+prune example_project/env
+prune example_project/venv
+prune example_project/public
graft src/postorius/tests/fixtures
diff --git a/example_project/.gitignore b/example_project/.gitignore
new file mode 100644
index 0000000..a6f814a
--- /dev/null
+++ b/example_project/.gitignore
@@ -0,0 +1,4 @@
+postorius.db
+public
+venv
+env
diff --git a/example_project/README.rst b/example_project/README.rst
new file mode 100644
index 0000000..8c1576d
--- /dev/null
+++ b/example_project/README.rst
@@ -0,0 +1,33 @@
+===============================
+Running the example application
+===============================
+
+Assuming you use virtualenv, follow these steps to download and run the
+postorius example application in this directory:
+
+::
+
+ $ git clone https://gitlab.com/mailman/postorius.git
+ $ cd postorius/example_project
+ $ virtualenv venv
+ $ . venv/bin/activate
+ $ pip install -r requirements.txt
+
+Now we need to create the database tables and an admin user.
+Run the following and when prompted to create a
+superuser choose yes and follow the instructions:
+
+::
+
+ $ python manage.py migrate
+ $ python manage.py createsuperuser
+
+
+Now you need to run the Django development server:
+
+::
+
+ $ python manage.py runserver
+
+You should then be able to open your browser on http://127.0.0.1:8000 and see
+postorius running.
diff --git a/example_project/__init__.py b/example_project/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/example_project/__init__.py
diff --git a/example_project/mailman.cfg b/example_project/mailman.cfg
new file mode 100644
index 0000000..08062c7
--- /dev/null
+++ b/example_project/mailman.cfg
@@ -0,0 +1,23 @@
+# Example Mailman config file suitable for testing
+
+[devmode]
+enabled: yes
+testing: yes
+recipient: you@yourdomain.com
+
+[mta]
+smtp_port: 9025
+lmtp_port: 9024
+incoming: mailman.testing.mta.FakeMTA
+
+[webservice]
+port: 9001
+
+[archiver.mhonarc]
+enable: yes
+
+[archiver.mail_archive]
+enable: yes
+
+[archiver.prototype]
+enable: yes
diff --git a/example_project/manage.py b/example_project/manage.py
new file mode 100755
index 0000000..f309a3c
--- /dev/null
+++ b/example_project/manage.py
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# Copyright (C) 1998-2012 by the Free Software Foundation, Inc.
+#
+# This file is part of Postorius.
+#
+# Postorius 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.
+#
+# Postorius 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
+# Postorius. If not, see .
+import os
+import sys
+
+if __name__ == "__main__":
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv)
diff --git a/example_project/requirements.txt b/example_project/requirements.txt
new file mode 100644
index 0000000..4629be6
--- /dev/null
+++ b/example_project/requirements.txt
@@ -0,0 +1,3 @@
+Django>1.8,<1.10
+# before a release replace it with the version about to be released
+../
diff --git a/example_project/settings.py b/example_project/settings.py
new file mode 100644
index 0000000..1af8640
--- /dev/null
+++ b/example_project/settings.py
@@ -0,0 +1,220 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.
+#
+# This file is part of Postorius.
+#
+# Postorius 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.
+#
+# Postorius 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
+# Postorius. If not, see .
+
+"""
+Django settings for postorius project.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.9/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/1.9/ref/settings/
+"""
+
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+import os
+
+BASE_DIR = os.path.dirname(os.path.abspath(__file__))
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = '$!-7^wl#wiifjbh)5@f7ji%x!vp7s1vzbvwt26hxv$idixq0u0'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ADMINS = (
+ #('Admin', 'webmaster@example.com'),
+)
+
+ALLOWED_HOSTS = []
+
+# Mailman API credentials
+MAILMAN_REST_API_URL = 'http://localhost:9001'
+MAILMAN_REST_API_USER = 'restadmin'
+MAILMAN_REST_API_PASS = 'restpass'
+
+
+# Application definition
+
+INSTALLED_APPS = (
+ 'django.contrib.admin',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+ 'postorius',
+ 'django_browserid',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.middleware.locale.LocaleMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+ 'django.middleware.security.SecurityMiddleware',
+ 'postorius.middleware.PostoriusMiddleware',
+)
+
+# Set `postorius.urls` as main url config if Postorius
+# is the only app you want to serve.
+ROOT_URLCONF = 'urls'
+
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.template.context_processors.debug',
+ 'django.template.context_processors.i18n',
+ 'django.template.context_processors.media',
+ 'django.template.context_processors.static',
+ 'django.template.context_processors.tz',
+ 'django.template.context_processors.csrf',
+ 'django.template.context_processors.request',
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+ 'postorius.context_processors.postorius',
+ ],
+ },
+ },
+]
+
+WSGI_APPLICATION = 'wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': os.path.join(BASE_DIR, 'postorius.db'),
+ }
+}
+
+# Password validation
+# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+ {
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+ },
+]
+
+# Internationalization
+# https://docs.djangoproject.com/en/1.9/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_L10N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/1.9/howto/static-files/
+
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/var/www/example.com/static/"
+STATIC_ROOT = os.path.join(BASE_DIR, 'public', 'static')
+
+# URL prefix for static files.
+# Example: "http://example.com/static/", "http://static.example.com/"
+STATIC_URL = '/static/'
+
+LOGIN_URL = 'user_login'
+LOGIN_REDIRECT_URL = 'list_index'
+LOGOUT_URL = 'user_logout'
+
+
+# Use the email username as identifier, but truncate it because
+# the User.username field is only 30 chars long.
+def username(email):
+ return email.rsplit('@', 1)[0][:30]
+BROWSERID_USERNAME_ALGO = username
+
+
+# Compatibility with Bootstrap 3
+from django.contrib.messages import constants as messages
+MESSAGE_TAGS = {
+ messages.ERROR: 'danger'
+}
+
+
+AUTHENTICATION_BACKENDS = (
+ 'django_browserid.auth.BrowserIDBackend',
+ 'django.contrib.auth.backends.ModelBackend',
+)
+
+
+# From Address for emails sent to users
+DEFAULT_FROM_EMAIL = 'postorius@localhost.local'
+# From Address for emails sent to admins
+SERVER_EMAIL = 'root@localhost.local'
+
+# These can be set to override the defaults but are not mandatory:
+# EMAIL_CONFIRMATION_TEMPLATE = 'postorius/address_confirmation_message.txt'
+# EMAIL_CONFIRMATION_SUBJECT = 'Confirmation needed'
+
+# You can enable logging by uncommenting the following lines
+# LOGGING = {
+# 'version': 1,
+# 'disable_existing_loggers': False,
+# 'handlers': {
+# 'console': {
+# 'class': 'logging.StreamHandler'
+# },
+# },
+# 'loggers': {
+# 'django': {
+# 'handlers': ['console'],
+# 'level': 'INFO',
+# },
+# 'django_browserid': {
+# 'handlers': ['console'],
+# 'level': 'DEBUG',
+# },
+# },
+# }
diff --git a/example_project/urls.py b/example_project/urls.py
new file mode 100644
index 0000000..50b85df
--- /dev/null
+++ b/example_project/urls.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.
+#
+# This file is part of Postorius.
+#
+# Postorius 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.
+#
+# Postorius 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
+# Postorius. If not, see .
+
+
+from django.conf.urls import include, url
+
+from django.contrib import admin
+admin.autodiscover()
+
+from postorius import views
+
+urlpatterns = [
+ url(r'^admin/', include(admin.site.urls)),
+ url('', include('django_browserid.urls')),
+ url(r'^$', views.list.list_index),
+ url(r'^postorius/', include('postorius.urls')),
+]
diff --git a/example_project/wsgi.py b/example_project/wsgi.py
new file mode 100755
index 0000000..9580f2f
--- /dev/null
+++ b/example_project/wsgi.py
@@ -0,0 +1,16 @@
+"""
+WSGI config for meh project.
+
+It exposes the WSGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+
+application = get_wsgi_application()
diff --git a/src/postorius/doc/deployment.rst b/src/postorius/doc/deployment.rst
index 2aa5757..d4923f0 100644
--- a/src/postorius/doc/deployment.rst
+++ b/src/postorius/doc/deployment.rst
@@ -19,7 +19,7 @@
[uwsgi]
chdir = /srv/django/mailman
- module = postorius_standalone.wsgi
+ module = example_project.wsgi
virtualenv = /srv/django/mailman/env
master = true
@@ -97,21 +97,21 @@
::
- Alias /static /path/to/postorius_standalone/static
-
+ Alias /static /srv/django/mailman/public/static
+
Order deny,allow
Allow from all
- WSGIScriptAlias / /path/to/postorius_standalone/srv/postorius.wsgi
-
+ WSGIScriptAlias / /srv/django/mailman/srv/postorius.wsgi
+
Order deny,allow
Allow from all
The first Alias serves the static files (CSS, JS, Images, etc.). The
WSGIScriptAlias serves the Django application. The paths need to be changed
-depending on which location you downloaded ``postorius_standalone`` to.
+depending on which location you have your postorius project in.
Final setup instructions
========================
@@ -119,7 +119,7 @@
We're almost ready. But you need to create translations and collect the static
files from Postorius (which resides somewhere on your pythonpath) to be able to
serve them from the site directory. All you have to do is to change into the
-``postorius_standalone`` directory and run:
+postorius project directory and run:
::
diff --git a/src/postorius/doc/development.rst b/src/postorius/doc/development.rst
index 1dc3349..d85fdcd 100644
--- a/src/postorius/doc/development.rst
+++ b/src/postorius/doc/development.rst
@@ -129,8 +129,8 @@
Accessing the Mailman API
=========================
-Postorius uses mailman.client to connect to Mailman's REST API. In order to
-directly use the client, ``cd`` to your project folder and execute
+Postorius uses mailmanclient to connect to Mailman's REST API. In order to
+directly use the client, ``cd`` to the ``example_project`` folder and execute
``python manage.py mmclient``. This will open a python shell (IPython, if
that's available) and provide you with a client object connected to to your
local Mailman API server (it uses the credentials from your settings.py).
@@ -144,14 +144,14 @@
>>> client
- >>> print client.system['mailman_version']
+ >>> print(client.system['mailman_version'])
GNU Mailman 3.0.0b2+ (Here Again)
>>> mailman_dev = client.get_list('mailman-developers@python.org')
- >>> print mailman_dev settings
+ >>> print(mailman_dev.settings)
{u'description': u'Mailman development',
u'default_nonmember_action': u'hold', ...}
-For detailed information how to use mailman.client, check out its documentation_.
+For detailed information how to use mailmanclient, check out its documentation_.
.. _documentation: https://gitlab.com/mailman/mailmanclient/blob/master/src/mailmanclient/docs/using.rst
diff --git a/src/postorius/doc/setup.rst b/src/postorius/doc/setup.rst
index 62e86d0..91c1203 100644
--- a/src/postorius/doc/setup.rst
+++ b/src/postorius/doc/setup.rst
@@ -27,12 +27,6 @@
$ pip install postorius
-or:
-
-::
-
- $ easy_install postorius
-
Latest dev version
------------------
@@ -53,28 +47,24 @@
Since you have now installed the necessary packages to run Postorius, it's
time to setup your Django site.
-First, get the project directory from gitlab:
+You can find an example project in ``example_project`` in the root of
+``postorius'`` git repository.
-::
-
- $ git clone https://gitlab.com/mailman/postorius_standalone.git
-
-Change the database setting in ``postorius_standalone/settings.py`` to
+Change the database setting in ``example_project/settings.py`` to
your preferred database, if you want something other than SQlite.
.. note::
Detailed information on how to use different database engines can be found
in the `Django documentation`_.
-.. _Django documentation: https://docs.djangoproject.com/en/1.8/ref/settings/#databases
+.. _Django documentation: https://docs.djangoproject.com/en/1.9/ref/settings/#databases
Third, prepare the database:
::
- $ cd postorius_standalone
+ $ cd example_project
$ python manage.py migrate
- $ cd ..
This will create the ``.db file`` (if you ar using SQLite) and will setup all the
necessary db tables.
@@ -82,9 +72,8 @@
To create a superuser which will act as an admin account for Postorius, run the
following commands::
- $ cd postorius_standalone
+ $ cd example_project
$ python manage.py createsuperuser
- $ cd ..
Running the development server
@@ -94,7 +83,7 @@
::
- $ cd postorius_standalone
+ $ cd example_project
$ python manage.py runserver
diff --git a/testing/__init__.py b/testing/__init__.py
deleted file mode 100644
index 25c2b91..0000000
--- a/testing/__init__.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2012-2016 by the Free Software Foundation, Inc.
-#
-# This file is part of Postorius.
-#
-# Postorius 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.
-# Postorius 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
-# Postorius. If not, see .
-
-import os
-import vcr
-
-from django.conf import settings
-
-
-TEST_DIR = os.path.abspath(os.path.dirname(__file__))
-FIXTURES_DIR = os.path.join(TEST_DIR, 'fixtures', 'vcr_cassettes')
-
-
-MM_VCR = vcr.VCR(serializer='json',
- cassette_library_dir=FIXTURES_DIR,
- match_on=['uri', 'method'])
diff --git a/testing/test_mailman.cfg b/testing/test_mailman.cfg
deleted file mode 100644
index 64dcc1a..0000000
--- a/testing/test_mailman.cfg
+++ /dev/null
@@ -1,35 +0,0 @@
-# AUTOMATICALLY GENERATED BY MAILMAN ON 2015-01-18 07:49:14
-#
-# This is your GNU Mailman 3 configuration file. You can edit this file to
-# configure Mailman to your needs, and Mailman will never overwrite it.
-# Additional configuration information is (for now) available in the
-# schema.cfg file and the base mailman.cfg file
-# .
-#
-# For example, uncomment the following lines to run Mailman in developer mode.
-#
-# [devmode]
-# enabled: yes
-# recipient: your.address@your.domain
-
-[devmode]
-enabled: yes
-testing: yes
-recipient: you@yourdomain.com
-
-[mta]
-smtp_port: 9025
-lmtp_port: 9024
-incoming: mailman.testing.mta.FakeMTA
-
-[webservice]
-port: 9001
-
-[archiver.mhonarc]
-enable: yes
-
-[archiver.mail_archive]
-enable: yes
-
-[archiver.prototype]
-enable: yes
diff --git a/testing/test_settings.py b/testing/test_settings.py
deleted file mode 100755
index d425374..0000000
--- a/testing/test_settings.py
+++ /dev/null
@@ -1,155 +0,0 @@
-#-*- coding: utf-8 -*-
-# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.
-#
-# This file is part of Postorius.
-#
-# Postorius 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.
-#
-# Postorius 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
-# Postorius. If not, see .
-
-"""
-Django settings for postorius project.
-
-For more information on this file, see
-https://docs.djangoproject.com/en/1.8/topics/settings/
-
-For the full list of settings and their values, see
-https://docs.djangoproject.com/en/1.8/ref/settings/
-"""
-
-# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
-import os
-
-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
-
-# SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = '$!-7^wl#wiifjbh)5@f7ji%x!vp7s1vzbvwt26hxv$idixq0u0'
-
-# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = True
-
-ALLOWED_HOSTS = ['localhost']
-
-
-
-# Mailman API credentials for testing
-MAILMAN_REST_API_URL = 'http://localhost:9001'
-MAILMAN_REST_API_USER = 'restadmin'
-MAILMAN_REST_API_PASS = 'restpass'
-
-
-# Application definition
-
-INSTALLED_APPS = (
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'postorius',
- 'django_browserid',
-)
-
-MIDDLEWARE_CLASSES = (
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.middleware.locale.LocaleMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- 'django.middleware.security.SecurityMiddleware',
- 'postorius.middleware.PostoriusMiddleware',
-)
-
-# Set `postorius.urls` as main url config if Postorius
-# is the only app you want to serve.
-ROOT_URLCONF = 'testing.urls'
-
-TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.i18n',
- 'django.template.context_processors.media',
- 'django.template.context_processors.static',
- 'django.template.context_processors.tz',
- 'django.template.context_processors.csrf',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- 'postorius.context_processors.postorius',
- ],
- },
- },
-]
-
-#WSGI_APPLICATION = 'postorius_standalone.wsgi.application'
-
-
-# Database
-# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
-
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': os.path.join(BASE_DIR, 'postorius.db'),
- }
-}
-
-
-# Internationalization
-# https://docs.djangoproject.com/en/1.8/topics/i18n/
-
-LANGUAGE_CODE = 'en-us'
-
-TIME_ZONE = 'UTC'
-
-USE_I18N = True
-
-USE_L10N = True
-
-USE_TZ = True
-
-
-# Static files (CSS, JavaScript, Images)
-# https://docs.djangoproject.com/en/1.8/howto/static-files/
-
-STATIC_URL = '/static/'
-
-
-LOGIN_URL = 'user_login'
-LOGIN_REDIRECT_URL = 'list_index'
-LOGOUT_URL = 'user_logout'
-
-def username(email):
- return email.rsplit('@', 1)[0]
-BROWSERID_USERNAME_ALGO = username
-
-
-# Compatibility with Bootstrap 3
-from django.contrib.messages import constants as messages
-MESSAGE_TAGS = {
- messages.ERROR: 'danger'
-}
-
-
-AUTHENTICATION_BACKENDS = (
- 'django.contrib.auth.backends.ModelBackend',
- 'django_browserid.auth.BrowserIDBackend',
-)
diff --git a/testing/urls.py b/testing/urls.py
deleted file mode 100644
index 2f81d0c..0000000
--- a/testing/urls.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.
-#
-# This file is part of Postorius.
-#
-# Postorius 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.
-#
-# Postorius 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
-# Postorius. If not, see .
-
-from django.conf.urls import include, url
-
-urlpatterns = [
- url('', include('django_browserid.urls')),
- url(r'', include('postorius.urls')),
-]
diff --git a/tox.ini b/tox.ini
index 71025d1..99226d3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,7 +16,7 @@
django19: Django>=1.9,<1.10a
django-latest: https://github.com/django/django/archive/master.tar.gz
commands =
- coverage run {envbindir}/django-admin.py test --settings=testing.test_settings {posargs:postorius}
+ coverage run example_project/manage.py test {posargs:postorius}
coverage report
setenv =
PYTHONPATH = {toxinidir}
@@ -30,7 +30,7 @@
PYTHONPATH = {toxinidir}
POSTORIUS_VCR_RECORD_MODE = all
commands =
- django-admin.py test --settings=testing.test_settings {posargs:postorius}
+ python example_project/manage.py test {posargs:postorius}
# These are used for local development and expect mailman.client to be
@@ -46,7 +46,7 @@
commands =
# Install mailmanclient from local repo instead of from pypi
pip install -e ../mailmanclient
- django-admin.py test --settings=testing.test_settings {posargs:postorius}
+ python example_project/manage.py test {posargs:postorius}
[testenv:dev-record]
usedevelop = True
@@ -60,7 +60,7 @@
commands =
# Install mailmanclient from local repo instead of from pypi
pip install -e ../mailmanclient
- django-admin.py test --settings=testing.test_settings {posargs:postorius}
+ python example_project/manage.py test {posargs:postorius}
[testenv:pep8]
basepython = python2.7
@@ -73,4 +73,4 @@
[flake8]
ignore = E123, E133
show-source = True
-exclude = .git,.tox,dist,*egg,testing,src/postorius/doc
+exclude = .git,.tox,dist,*egg,src/postorius/doc,example_project