david / django-portablecontacts (http://portablecontacts.net/)

Support for PortableContacts in Django.

Changed (Δ2.1 KB):

raw changeset »

examples/__init__.py (null-size change)

examples/manage.py (14 lines added, 0 lines removed)

examples/settings.py (42 lines added, 0 lines removed)

examples/urls.py (10 lines added, 0 lines removed)

portablecontacts_example/__init__.py

portablecontacts_example/manage.py

portablecontacts_example/settings.py

portablecontacts_example/urls.py

Up to file-list examples/manage.py:

1
import sys, os
2
sys.path = [os.path.join(os.getcwd(), '../'), '../../../lib/django_one'] + sys.path
3
4
from django.core.management import execute_manager
5
6
try:
7
    import settings # Assumed to be in the same directory.
8
except ImportError:
9
    import sys
10
    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
11
    sys.exit(1)
12
13
if __name__ == "__main__":
14
    execute_manager(settings)

Up to file-list examples/settings.py:

1
import os
2
ROOT_PATH = os.path.dirname(__file__)
3
4
TEMPLATE_DEBUG = DEBUG = True
5
MANAGERS = ADMINS = ()
6
DATABASE_ENGINE = 'sqlite3'
7
DATABASE_NAME = os.path.join(ROOT_PATH, 'testdb.sqlite')
8
9
TIME_ZONE = 'America/Chicago'
10
LANGUAGE_CODE = 'en-us'
11
SITE_ID = 1
12
USE_I18N = True
13
MEDIA_ROOT = ''
14
MEDIA_URL = ''
15
ADMIN_MEDIA_PREFIX = '/media/'
16
SECRET_KEY = '2+@4vnr#v8e273^+a)g$8%dre^dwcn#d&n#8+l6jk7r#$p&3zk'
17
TEMPLATE_LOADERS = (
18
    'django.template.loaders.filesystem.load_template_source',
19
    'django.template.loaders.app_directories.load_template_source',
20
)
21
MIDDLEWARE_CLASSES = (
22
    'django.middleware.common.CommonMiddleware',
23
    'django.contrib.sessions.middleware.SessionMiddleware',
24
    'django.contrib.auth.middleware.AuthenticationMiddleware',
25
    'portablecontacts.middlewares.PortableContactsMiddleware',
26
)
27
ROOT_URLCONF = 'urls'
28
TEMPLATE_DIRS = (os.path.join(ROOT_PATH, 'templates'),)
29
INSTALLED_APPS = (
30
    'portablecontacts',
31
    'django.contrib.auth',
32
    'django.contrib.contenttypes',
33
    'django.contrib.sessions',
34
    'django.contrib.sites',
35
)
36
37
# We do not want to override base serializers
38
SERIALIZATION_MODULES = {
39
    "poco-xml"    : "portablecontacts.serializers.xml_serializer",
40
    "poco-json"   : "portablecontacts.serializers.json",
41
}
42
#PORTABLE_CONTACTS_MODEL = 'portablecontacts.Contact'

Up to file-list examples/urls.py:

1
from django.conf.urls.defaults import *
2
3
def fake_home(request):
4
    from django.http import HttpResponse
5
    return HttpResponse('Home' * 50)
6
7
urlpatterns = patterns('',
8
    url(r'^$', fake_home),
9
    url(r'^portablecontacts/', include('portablecontacts.urls')),
10
)