(Django) The best solution for event calendar

浪子不回头ぞ 提交于 2019-12-05 19:12:17

Without knowing the level of complexity you need, I always suggest quick and easy first. Once minimum requirements are established you can confidently migrate.

Django Flatpages can take you a long way with very little effort.

If you're looking to go all the way, setting up a DAViCal server with some kind of python bindings would give you a very flexible application. The integration with Django looks like it would have to be built from scratch, but all the heavy lifting is done in DAViCal and the python bindings.

DAViCal would allow you to access the calendar from several different applications, making your solution much more robust.

If you're willing to build your own, I found Python's Calendar module to be great. I used calendar.monthcalendar() to build a table-layout calendar. The module has many useful functions in it and recommend checking it out if you haven't already.

Here's more info on calendar.monthcalendar(year, month):

Returns a matrix representing a month’s calendar. Each row represents a week; days outside of the month a represented by zeros. Each week begins with Monday unless set by setfirstweekday().

If you want your calendar to start on Sunday as opposed to the Monday default, just:

calendar.setfirstweekday(6)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!