Django calendar widget in a custom form

后端 未结 5 966
说谎
说谎 2021-01-31 04:25

I am trying to add a calendar date input to one of my forms. There is a wonderful calendar widget that Django uses on its admin pages, but I can\'t figure out how to add it to a

5条回答
  •  滥情空心
    2021-01-31 05:03

    This is basically a duplicate of Using Django time/date widgets in custom form.

    The answer has been given by @Dave S and @MrGlass, but for Django 1.2 and later this will additionally also be needed to help the JavaScript find the admin media:

    {% load adminmedia %} /* At the top of the template. */
    
    /* In the head section of the template. */
    
    

    (from Carl Meyer's answer)

提交回复
热议问题