├── .gitignore ├── LICENSE ├── __init__.py ├── app.yaml ├── build.sh ├── cron.yaml ├── index.yaml ├── indexes.py ├── manage.py ├── requirements.txt ├── settings.py ├── templates ├── 404.html ├── 500.html ├── base.html └── home.html └── urls.py /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pyc 3 | .gaedata 4 | 5 | django 6 | djangotoolbox 7 | djangoappengine 8 | django_mongodb_engine 9 | dbindexer 10 | autoload 11 | mediagenerator 12 | filetransfers 13 | mapreduce 14 | 15 | build 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Waldemar Kornewald, Thomas Wanschik, and all contributors. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of All Buttons Pressed nor 15 | the names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-nonrel/django-testapp/b1263805752a4f07e3003578e5eaaa508f26e5e4/__init__.py -------------------------------------------------------------------------------- /app.yaml: -------------------------------------------------------------------------------- 1 | application: ctst 2 | version: 1 3 | runtime: python27 4 | api_version: 1 5 | threadsafe: yes 6 | 7 | builtins: 8 | - remote_api: on 9 | 10 | inbound_services: 11 | - warmup 12 | 13 | libraries: 14 | - name: django 15 | version: latest 16 | 17 | handlers: 18 | - url: /_ah/queue/deferred 19 | script: djangoappengine.deferred.handler.application 20 | login: admin 21 | 22 | - url: /_ah/stats/.* 23 | script: djangoappengine.appstats.application 24 | 25 | - url: /media/admin 26 | static_dir: django/contrib/admin/media 27 | expiration: '0' 28 | 29 | - url: /static/admin 30 | static_dir: django/contrib/admin/static/admin 31 | expiration: '0' 32 | 33 | - url: /.* 34 | script: djangoappengine.main.application 35 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DOWNLOAD_DIR=./src 4 | 5 | # test for git and hg commands 6 | for cmd in git hg; do 7 | command -v ${cmd} >/dev/null || { echo "sh: command not found: ${cmd}"; exit 1; } 8 | done 9 | 10 | # download all packages to ./src (default) 11 | pip install --no-install -r requirements.txt 12 | 13 | cp -r ${DOWNLOAD_DIR}/django-autoload/autoload ./autoload 14 | cp -r ${DOWNLOAD_DIR}/django-dbindexer/dbindexer ./dbindexer 15 | cp -r ${DOWNLOAD_DIR}/django-nonrel/django ./django 16 | cp -r ${DOWNLOAD_DIR}/djangoappengine/djangoappengine ./djangoappengine 17 | cp -r ${DOWNLOAD_DIR}/djangotoolbox/djangotoolbox ./djangotoolbox 18 | 19 | [ -f ${DOWNLOAD_DIR}/pip-delete-this-directory.txt ] && rm -rf ${DOWNLOAD_DIR} 20 | 21 | echo "Now run: 22 | ./manage.py runserver 23 | 24 | To launch this app. If you want access to django /admin, run also: 25 | ./manage.py createsuperuser 26 | 27 | And then login in /admin, probably http://127.0.0.1:8000/admin" 28 | 29 | 30 | -------------------------------------------------------------------------------- /cron.yaml: -------------------------------------------------------------------------------- 1 | cron: 2 | -------------------------------------------------------------------------------- /index.yaml: -------------------------------------------------------------------------------- 1 | indexes: 2 | 3 | - kind: django_admin_log 4 | properties: 5 | - name: user_id 6 | - name: action_time 7 | direction: desc 8 | 9 | - kind: django_admin_log 10 | properties: 11 | - name: content_type_id 12 | - name: idxf_object_id_l_exact 13 | - name: action_time 14 | 15 | - kind: django_content_type 16 | properties: 17 | - name: app_label 18 | - name: name 19 | 20 | # AUTOGENERATED 21 | 22 | # This index.yaml is automatically updated whenever the dev_appserver 23 | # detects that a new type of query is run. If you want to manage the 24 | # index.yaml file manually, remove the above marker line (the line 25 | # saying "# AUTOGENERATED"). If you want to manage some indexes 26 | # manually, move them above the marker line. The index.yaml file is 27 | # automatically uploaded to the admin console when you next deploy 28 | # your application using appcfg.py. 29 | -------------------------------------------------------------------------------- /indexes.py: -------------------------------------------------------------------------------- 1 | from dbindexer import autodiscover 2 | autodiscover() 3 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from django.core.management import execute_manager 3 | try: 4 | import settings # Assumed to be in the same directory. 5 | except ImportError: 6 | import sys 7 | 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__) 8 | sys.exit(1) 9 | 10 | if __name__ == "__main__": 11 | execute_manager(settings) 12 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -e git+http://github.com/django-nonrel/djangotoolbox@toolbox-1.4#egg=djangotoolbox 2 | -e git+http://github.com/django-nonrel/djangoappengine@appengine-1.4#egg=djangoappengine 3 | -e git+http://github.com/django-nonrel/django-dbindexer@dbindexer-1.4#egg=django-dbindexer 4 | -e git+http://github.com/django-nonrel/django@nonrel-1.4#egg=django-nonrel 5 | -e hg+http://bitbucket.org/twanschik/django-autoload#egg=django-autoload 6 | -------------------------------------------------------------------------------- /settings.py: -------------------------------------------------------------------------------- 1 | # Initialize App Engine and import the default settings (DB backend, etc.). 2 | # If you want to use a different backend you have to remove all occurences 3 | # of "djangoappengine" from this file. 4 | from djangoappengine.settings_base import * 5 | 6 | import os 7 | 8 | # Activate django-dbindexer for the default database 9 | DATABASES['native'] = DATABASES['default'] 10 | DATABASES['default'] = {'ENGINE': 'dbindexer', 'TARGET': 'native'} 11 | AUTOLOAD_SITECONF = 'indexes' 12 | 13 | SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi' 14 | 15 | INSTALLED_APPS = ( 16 | 'django.contrib.admin', 17 | 'django.contrib.contenttypes', 18 | 'django.contrib.auth', 19 | 'django.contrib.sessions', 20 | 'djangotoolbox', 21 | 'autoload', 22 | 'dbindexer', 23 | 24 | # djangoappengine should come last, so it can override a few manage.py commands 25 | 'djangoappengine', 26 | ) 27 | 28 | MIDDLEWARE_CLASSES = ( 29 | # This loads the index definitions, so it has to come first 30 | 'autoload.middleware.AutoloadMiddleware', 31 | 32 | 'django.middleware.common.CommonMiddleware', 33 | 'django.contrib.sessions.middleware.SessionMiddleware', 34 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 35 | ) 36 | 37 | TEMPLATE_CONTEXT_PROCESSORS = ( 38 | 'django.contrib.auth.context_processors.auth', 39 | 'django.core.context_processors.request', 40 | 'django.core.context_processors.media', 41 | ) 42 | 43 | # This test runner captures stdout and associates tracebacks with their 44 | # corresponding output. Helps a lot with print-debugging. 45 | TEST_RUNNER = 'djangotoolbox.test.CapturingTestSuiteRunner' 46 | 47 | STATIC_URL = '/static/' 48 | 49 | TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates'),) 50 | 51 | ROOT_URLCONF = 'urls' 52 | -------------------------------------------------------------------------------- /templates/404.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Page not found{% endblock %} 3 | 4 | {% block content %} 5 | The page you requested could not be found. 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /templates/500.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}Server error{% endblock %} 3 | 4 | {% block content %} 5 | There was an error while handling your request. 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | 4 | 8 | 9 | {% block title %}{% endblock %} - Nonrel-testapp 10 | 11 | {% block css %} 12 | {% endblock %} 13 | 14 | {% block preload_js %} 15 | {% endblock %} 16 | 17 | {% block extra-head %}{% endblock %} 18 | 19 | 20 | 21 | 24 | 25 |
26 |
27 | {% block content-header %} 28 | {% if error %}
{{ error }}
{% endif %} 29 | {% if info %}
{{ info }}
{% endif %} 30 | {% if messages %} 31 | {% for message in messages %} 32 |
{{ message }}
33 | {% endfor %} 34 | {% endif %} 35 | {% endblock %} 36 | 37 | {% block content %}{% endblock %} 38 |
39 | 40 | 44 |
45 | 46 | 49 | 50 | {% block js %} 51 | {% endblock %} 52 | 53 | 54 | -------------------------------------------------------------------------------- /templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %}It works!{% endblock %} 3 | 4 | {% block content %} 5 |

It works!

6 |

7 | Your Django-nonrel installation is working fine. Now go and build something useful with it. :) 8 |

9 | 10 |

11 | If you'd like to learn more about using Django-nonrel take a look at the documentation. 12 | You may also want to follow the project on GitHub or subscribe to its google group so you don't miss any new features and improvements. 13 |

14 | 15 |

16 | If you're new to Django you should take a look at the Django documentation and the Django book. 17 | You'll also find djangosnippets very useful. 18 |

19 | 20 |

21 | If you have an existing Django project that you'd like to use with a non-relational back-end or would simply like to learn what are the differences between the normal Django and its non-relational version take a look at: porting. 22 |

23 | 24 |

25 | If you search for reusable apps that work with Django-nonrel here's a list to get you started: 26 |

27 | 28 | 37 | 38 |

39 | Finally, take a look at the apps listed on Django Packages. Many simple Django apps (e.g., django-registration) should work unmodified. If you want to use django-debug-toolbar you need to disable the SQLDebugPanel in your settings. 40 |

41 | {% endblock %} 42 | -------------------------------------------------------------------------------- /urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import * 2 | from django.contrib import admin 3 | import dbindexer 4 | 5 | handler500 = 'djangotoolbox.errorviews.server_error' 6 | 7 | # django admin 8 | admin.autodiscover() 9 | 10 | # search for dbindexes.py in all INSTALLED_APPS and load them 11 | dbindexer.autodiscover() 12 | 13 | urlpatterns = patterns('', 14 | ('^_ah/warmup$', 'djangoappengine.views.warmup'), 15 | ('^$', 'django.views.generic.simple.direct_to_template', {'template': 'home.html'}), 16 | ('^admin/', include(admin.site.urls)), 17 | ) 18 | --------------------------------------------------------------------------------