57π
Every django app needs a Site
to run. Here you do not seem to have it.
Log into your django shell
$> ./manage.py shell
>>> from django.contrib.sites.models import Site
>>> site = Site()
>>> site.domain = 'example.com'
>>> site.name = 'example.com'
>>> site.save()
or
$> ./manage.py shell
>>> from django.contrib.sites.models import Site
>>> site = Site.objects.create(domain='example.com', name='example.com')
>>> site.save()
You should be all set.
43π
Add django.contrib.sites
in django INSTALLED_APPS
and
also add SITE_ID=1
in your django setting file.
- [Django]-How to create a custom decorator in Django?
- [Django]-Django: how do I query based on GenericForeignKey's fields?
- [Django]-How to get the common name for a pytz timezone eg. EST/EDT for America/New_York
- [Django]-Django-Bower + Foundation 5 + SASS, How to configure?
- [Django]-How to tell if a task has already been queued in django-celery?
- [Django]-What is the path that Django uses for locating and loading templates?
9π
You also need to make sure that the site domain is the same with the one you actually use. For example if you are you are accessing the admin site from http://127.0.0.1:8000/admin/ then your site.domain should be: site.domain = β127.0.0.1:8000β.
- [Django]-Django {% static 'path' %} in javascript file
- [Django]-Django Management Command Argument
- [Django]-How can I see the raw SQL queries Django is running?
- [Django]-Django URL Redirect
- [Django]-Can WordPress be replaced by a Framework like Django or Ruby on Rails?
- [Django]-Django models: get list of id
3π
SITE_ID = 1
i didnβt work for me
I had to go to the python shell
./manage.py shell
Then get the existing site id using name or domain
from django.contrib.sites.models import Site
Site.objects.get(name='back').id
> 6
For me it was 6, all i had to do then is to change the SITE_ID = 6
and it worked fine
- [Django]-Django dynamic model fields
- [Django]-Table thumbnail_kvstore doesn't exist
- [Django]-How can I restrict Django's GenericForeignKey to a list of models?
0π
Iβm using wsgi, so I had to reboot twice, not sure why.
then clear cache and that was it.
- [Django]-Django multiprocessing and database connections
- [Django]-TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'
- [Django]-Return the current user with Django Rest Framework