urlpatterns = [
path('', views.index, name='index'),
path('', views.birthday_check, name='birthday_check'),
]
Can't we assign two functions to one url in this way?
django
So, do you want to congratulate the member who accessed the main screen of the homepage on his birthday that day? Then just include the logic of the index function with the logic of checking the member's birthday and printing additional congratulatory messages. I don't know if there's a reason why I shouldn't do that.
Because... To answer the question itself... It is impossible for one route to do two different actions until the method, and it is not a very recommended idea even if it is forced to do something.
Looking at the questions you posted before, it's a matter that you just have to do well in the arrangement of the members whose birthday is today, but I think you're getting farther away from the starting point. Why don't you upload more code and show us more about how the data is in the DB?
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
919 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
575 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.