How can I add Celery to an existing project? #5292
Answered
by
browniebroke
LucasLeone
asked this question in
Q&A
-
I'm doing a project without Celery, but I need it now. How can I add it? I need add functionality for send confirmation email with this code: @task(name='send_confirmation_email', max_retries=3)
def send_confirmation_email(user_pk):
"""Send account verification link to given user."""
user = User.objects.get(pk=user_pk)
verification_token = gen_verification_token(user)
subject = 'Welcome @{}! Verify your account to start using project.format(user.username)
from_email = 'project <[email protected]>'
content = render_to_string(
'emails/users/account_verification.html',
{'token': verification_token, 'user': user}
)
msg = EmailMultiAlternatives(subject, content, from_email, [user.email])
msg.attach_alternative(content, "text/html")
msg.send() Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
browniebroke
Aug 9, 2024
Replies: 1 comment
-
I see a few options:
There is currently (AKAIK) no official way of updating an existing project (#1047) nevermind changing the original options after generation. As 3rd party/extension, there is cruft, which supports updating and claims to be fully compatible with cookiecutter. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
browniebroke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see a few options:
use_celery
is: https://github.com/search?q=repo%3Acookiecutter%2Fcookiecutter-django+use_celery+path%3A%2F%5E%5C%7B%5C%7Bcookiecutter%5C.project_slug%5C%7D%5C%7D%5C%2F%2F&type=code and make similar changes in your generated projectThere is currently (AKAIK) no official way of updating an existing project (#1047) nevermind changing the original options after generation.
As 3rd party/extension, there is cruft, which supports updating and claims to be fully compatible with cookiecutter.