title: Django tasks, reminders, notifications
body: <p>I have a fairly simple web app in Django (Apache, Ubuntu) for keeping some meetings documentation. Meetings have their appointment time stored in database (postgres) in datetime format. Now, I'd like to have a custom reminder module that would enable to user to setup their preferred reminders. </p>
  
  <p>For example:</p>
  
  <p>Meeting will be held at a certain date (let's say 25th of April 2018, 8:00 PM) and user should be able to setup a custom reminder (via SMS for example but the question is not about the sending texts or emails - I got this covered) to be fired up 24h before the time of meeting. </p>
  
  <p>It got me thinking that this requires some kind of a permanent process browsing through the meetings table and checking if now() is the appointment time -24h and if yes then perform the reminder. </p>
  
  <p>I started with rabbitmq and celery but these look a bit complicated at first glance (<a href="https://simpleisbetterthancomplex.com/tutorial/2017/08/20/how-to-use-celery-with-django.html" rel="nofollow noreferrer">here's one of the tutorials I found</a>) and looks like it's not designed for what I need. </p>
  
  <p>So, question is - how to setup a permanent process that would check if a set reminder time is now and if yes - perform the reminder task?</p>
  
  <hr>
  
  <p>EDIT: some errors after trying to follow the tutorial in answer. Got stuck at step 3:</p>
  
  <pre><code>    (dj2_env) adrian@dev:~$ celery -A dj2 worker -l info
  Traceback (most recent call last):
    File "/home/adrian/dj2_env/lib/python3.5/site-packages/celery/app/utils.py", line 361, in find_app
      found = sym.app
  AttributeError: module 'dj2' has no attribute 'app'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/adrian/dj2_env/bin/celery", line 11, in &lt;module&gt;
      sys.exit(main())
    File "/home/adrian/dj2_env/lib/python3.5/site-packages/celery/__main__.py", line 14, in main
      _main()
    File "/home/adrian/dj2_env/lib/python3.5/site-packages/celery/bin/celery.py", line 326, in main
      cmd.execute_from_commandline(argv)
    File "/home/adrian/dj2_env/lib/python3.5/site-packages/celery/bin/celery.py", line 488, in execute_from_commandline
      super(CeleryCommand, self).execute_from_commandline(argv)))
    File "/home/adrian/dj2_env/lib/python3.5/site-packages/celery/bin/base.py", line 279, in execute_from_commandline
      argv = self.setup_app_from_commandline(argv)
    File "/home/adrian/dj2_env/lib/python3.5/site-packages/celery/bin/base.py", line 481, in setup_app_from_commandline
      self.app = self.find_app(app)
    File "/home/adrian/dj2_env/lib/python3.5/site-packages/celery/bin/base.py", line 503, in find_app
      return find_app(app, symbol_by_name=self.symbol_by_name)
    File "/home/adrian/dj2_env/lib/python3.5/site-packages/celery/app/utils.py", line 366, in find_app
      found = sym.celery
  AttributeError: module 'dj2' has no attribute 'celery'
  </code></pre>
  
  <p>Ok, got the above error figured out - it's weird however, as when I ran the worker command from dj2 (project) directory it worked 8|</p>