开发者

Django apps urls.py access

I have one questions I have start project Sth. in sth project I have created app called misc. In view file in misc I have function index. When i try do render it i got NameError misc not found. Here is my urls.py

(r'^$'),misc.index, 

and here is how I add line for开发者_运维技巧 installed apps.

'Sth.misc',

I know that this is easy to do but I'm just beginning and can't handle it. Thanks for any help.


I think you should either import the misc module, or pass the function name as a string to patterns:

((r'^$'), 'misc.index'),
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜