如何正确使用这个 Django 应用程序?
https://github.com/jtauber/django-notification/tree/555b506a3e225d476d17939d8b43f8 53fd0226ec/通知
好的,这就是我到目前为止所做的:
- 通过 setup.py install
- put "notification" in INSTALLED_APPS
- import notification in my views.py
查看该应用程序的源代码后,似乎有应用程序内的 URLs.py。此外,还有一个模板文件夹。
我该怎么办?我的项目目录中已经有一个 urls.py...那么我如何将当前的 urls.py 指向该目录呢?
我是否正确安装了这个?我是否应该将整个目录复制到我的项目目录,而不是通过 setup.py install ?
OK, so this is what I did so far:
- Install this via setup.py install
- put "notification" in INSTALLED_APPS
- import notification in my views.py
After looking at the source code of that app, it seems like there is URLs.py inside the app. Also, there is a templates folder.
What do I do with these? I already have a urls.py in my project directory....so how do I point my current urls.py to that one?
Did I install this correctly? Was I supposed to copy the entire directory to my project directory, instead of going through setup.py install?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 setup.py,并将其安装到项目的 virtualenv 中。
如果您不使用 virtualenv 进行开发,也可能不使用 virtualenv 进行部署,那么您应该使用 virtualenv。
哦,还有包含 urls.py 的强制性文档链接: http://docs.djangoproject.com/en/dev/topics/http/urls/#include-other-urlconfs(向 Ignacio 致敬)。
Use setup.py, and install it into your project's virtualenv.
If you aren't using virtualenv for development, and probably deployment, then you should be.
Oh, and obligatory docs link for including urls.py: http://docs.djangoproject.com/en/dev/topics/http/urls/#including-other-urlconfs (hat-tip to Ignacio).