小编Cra*_*uck的帖子

TemplateDoesNotExist在/

这是我的网站网址http://webtrick.heliohost.org/ 我的模板目录设置:

TEMPLATE_DIRS = (
    os.path.join(os.path.dirname(__file__) , 'templates').replace('\\','/')
)
Run Code Online (Sandbox Code Playgroud)

view.py

from django.http import HttpResponse
from django.template import Template , Context
from django.shortcuts import render_to_response
def index(request):
        return render_to_response('index.html')
Run Code Online (Sandbox Code Playgroud)

url.py

from django.conf.urls.defaults import patterns, include, url
from webtrickster.views import index
urlpatterns = patterns('',
    url(r'^$', index)
)
Run Code Online (Sandbox Code Playgroud)

我不知道这个代码有什么问题,任何帮助表示赞赏

django-templates

10
推荐指数
5
解决办法
3万
查看次数

如何在MongoDB中递归遍历嵌套文档

我试图以递归方式遍历MongoDB模型中的第n个节点.这是我的用户模型.

用户模型

var UserSchema  = new Schema({
    firstname : { type: String},
    parents:[{type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
    children:[{type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
    partner:[{type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
    sibling:[{type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
});
Run Code Online (Sandbox Code Playgroud)

我不知道如何从这个模型中生成一个类似树的结构,关于如何实现这个的任何想法?,我使用Mongoose作为模型,并且尝试深度树和填充没有解决,因为它只适用于第一级.

提前致谢.

mongoose mongodb node.js

5
推荐指数
1
解决办法
573
查看次数

标签 统计

django-templates ×1

mongodb ×1

mongoose ×1

node.js ×1