jackfrued / jackfrued/Python-100-Days
43.静态资源和Ajax一些修改
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 187k
- Forks
- 55.8k
- PR merge metrics
- No merged PRs in 30d
Description
用Ajax实现投票功能
代码中from vote import views,如果是跟着文档走的话,此时应该是对应polls应用才对,所以需要修改成from polls import views
前一天的from polls.views import show_subjects, show_teachers可以直接删除
另外urlpatterns后面的引用有问题,不是views.prise...应该是views.praise
设计视图函数
设计视图函数应该在应用(即polls目录下)的views.py,因为用到了JsonResponse,所以在开头需要导入
from django.http import JsonResponse
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the Ajax voting documentation and its URL-pattern example, then inspect polls/views.py as mentioned in the issue. Check the imports, remove the obsolete polls view imports, correct the praise reference, and ensure the JsonResponse import is shown where the view is designed. Done means the documented example is internally consistent and follows the described polls layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100