31π
I managed to find out what the problem was (no thanks to the error message). As it turns out, I needed to set up my e-mail server:
Note that in order to send e-mail using send_mail(), your server must be configured to send mail, and Django must be told about your outbound e-mail server. See http://docs.djangoproject.com/en/dev/topics/email/ for the specifics.
I guess I thought little of what was meant by it, but I was pointed in the direction of this guide, and things eventually started to click.
Thanks to everyone for chiming in with their advice. That is one useless error message, and I can only assume the people who helped me out only knew the answer because they had experienced the exact same thing.
12π
I got this error attempting to use django.core.mail.send_mail
. I only need this for running through some tutorials. I donβt need it to actually send mail.
The solution for me was to add this single variable to settings.py
:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
It sends the content of the email to console output, which is perfect given what Iβm doing.
Docs: https://docs.djangoproject.com/en/1.7/topics/email/#django.core.mail.backends.smtp.EmailBackend
- Return image url in Django Rest Framework
- Django no csrftoken in cookie
- Django: why are Django model fields class attributes?
2π
10061 isnβt the port number, thatβs the error number. You want to open port 8000.
See this answer for someone who was having the same problem because they were using the wrong port: No connection could be made because the target machine actively refused it
- Django filter through multiple fields in a many-to-many intermediary table
- Django REST Framework: Validate before a delete
- How do I update an already existing row when using ModelForms?
- Django: Possible to load fixtures with date fields based on the current date?
- TypeError: create_superuser() missing 1 required positional argument: 'profile_picture'
2π
In settings.py, For console output, you need
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
For smtp
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
Also refer this doc here
https://docs.djangoproject.com/en/1.6/topics/email/
0π
The code tries to connect to http://127.0.0.1:8000/contact/ β the port 8000 is not reachable (firewall) or there is no server running.
- Getting a list from Django into Javascript as an array
- Django-allauth HTML email not send
- Creation of dynamic model fields in django
- Variable not found. Declare it as envvar or define a default value
0π
Iβve never used DJango myself but judging by the error, there is no server listening at port 8000 (or some firewall/server restriction is blocking port 8000 on localhost)
- In django, is there a way to directly annotate a query with a related object in single query?
- Django & TastyPie: request.POST is empty
- Django queryset filter GT, LT, GTE, LTE returns full object list
- Django AttributeError: 'DatabaseOperations' object has no attribute 'select'
0π
If you are using gmail, you have to unlock Captcha to enable
Django to send it for you.https://accounts.google.com/displayunlockcaptcha
I could solve my issue of this type by unlocking Captcha for the gmail account I used in the app.You can go to this link in other to unlock Captcha.
I hope thisβs gonnβbe useful π
- Commit manually in Django data migration
- Django query with distinct and order_by
- Django: values_list() multiple fields concatenated
0π
This is probably a noob mistake but I hit this error because I was trying to call as_view() on a Function-Based View.
Error case:
urlpatterns = [
path('scratch/echo/', views.scratch_echo.as_view()),
]
Working case:
urlpatterns = [
path('scratch/echo/', views.scratch_echo),
]
I think I just copy-pasted the setup for a Class-Based View from a different tutorial and my server stopped running.
- Redirect from Generic View DetailView in Django
- Django: Duplicated logic between properties and queryset annotations