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'),
精彩评论