mirror of
https://github.com/jazzband/django-ddp.git
synced 2026-03-16 22:40:24 +00:00
Fix dddp.test.test_project URL config and options for MiniMongo collections.
This commit is contained in:
parent
9cf2ec3a0b
commit
81824e5bfe
2 changed files with 23 additions and 3 deletions
|
|
@ -1,8 +1,14 @@
|
|||
if (Meteor.isClient) {
|
||||
// This code only runs on the client
|
||||
Django = DDP.connect('http://'+window.location.hostname+':8000/');
|
||||
Tasks = new Mongo.Collection("django_todos.task", {"connection": Django});
|
||||
Django.subscribe('Tasks');
|
||||
options = {};
|
||||
if (__meteor_runtime_config__.hasOwnProperty('DDP_DEFAULT_CONNECTION_URL')) {
|
||||
Django = Meteor;
|
||||
} else {
|
||||
Django = DDP.connect(window.location.protocol + '//'+window.location.hostname+':8000/');
|
||||
options.connection = Django;
|
||||
}
|
||||
Tasks = new Mongo.Collection("django_todos.task", options);
|
||||
TaskSub = Django.subscribe('Tasks');
|
||||
Template.body.helpers({
|
||||
tasks: function () {
|
||||
return Tasks.find({});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
"""Django DDP test project - URL configuraiton."""
|
||||
import os.path
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.contrib import admin
|
||||
from dddp.views import MeteorView
|
||||
import dddp.test
|
||||
|
||||
app = MeteorView.as_view(
|
||||
json_path=os.path.join(
|
||||
os.path.dirname(dddp.test.__file__),
|
||||
'build', 'bundle', 'star.json'
|
||||
),
|
||||
)
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# Examples:
|
||||
|
|
@ -16,4 +28,6 @@ urlpatterns = patterns('',
|
|||
'show_indexes': False,
|
||||
},
|
||||
),
|
||||
# all remaining URLs routed to Meteor app.
|
||||
url(r'^(?P<path>.*)$', app),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue