Questions tagged [django-sites]

django-sites is a framework for associating objects and functionality to particular Web sites. Is used when a single Django instance power more than one site.

django-sites is a framework for associating objects and functionality to particular Web sites. Is used when a single Django instance power more than one site.

119 questions
62
votes
13 answers

Getting Site Matching Query Does Not Exist Error after creating django admin

I'm going through the standard Django tutorial to create an admin for an app. After commenting the admin related stuff in settings and running syncdb I'm getting this message: DoesNotExist at /admin/ Site matching query does not exist. Can anyone…
David Haddad
  • 3,796
  • 8
  • 32
  • 40
60
votes
5 answers

Django 'Sites' Model - what is and why is 'SITE_ID = 1'?

I am trying to work with Sites Model of Django. I dont quite understand why SITE_ID should be SITE_ID = 1. in the docs: The ID, as an integer, of the current site in the django_site database table. This is used so that application data can hook…
doniyor
  • 36,596
  • 57
  • 175
  • 260
27
votes
5 answers

Where do I set the domain for my Django Sites framework site, when I only have one?

I have a Django project for a simple blog/forum website I’m building. I’m using the syndication feed framework, which seems to generate the URLs for items in the feed using the domain of the current site from the Sites framework. I was previously…
Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
26
votes
3 answers

How to get unique users across multiple Django sites powered by the "sites" framework?

I am building a Django site framework which will power several independent sites, all using the same apps but with their own templates. I plan to accomplish this by using multiple settings-files and setting a unique SITE_ID for them, like suggested…
westmark
  • 909
  • 8
  • 15
18
votes
3 answers

Django Sites Framework: Initial Data Migration Location

Before Django 1.7, when using the Django Sites Framework one could/should define the initial data using Initial Fixtures. myproject/fixtures/initial_data.json [ { "pk": 1, "model": "sites.site", "fields": { "domain":…
JCJS
  • 3,031
  • 3
  • 19
  • 25
15
votes
6 answers

How can I get the Django admin's "View on site" link to work?

I've been working with a Django app for a while, and the Django admin interface works great, except that the "View on site" link doesn't work. Whenever I try to use it, I get an OperationalError with the message: no such table: django_site. I've…
mipadi
  • 398,885
  • 90
  • 523
  • 479
13
votes
2 answers

Is the current Site accessible from a template?

I'm trying to simply get the current Site from within a template for parsing like so:

{{ site.name }}

Unfortunately, this isn't bringing anything up. Is there a way to get access to the current site from a template?
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
12
votes
3 answers

auto populate when syncdb with fixture for django-site

i want to populate django_site table when i run after syncdb initially how can i do that i have one site only
soField
  • 2,536
  • 9
  • 36
  • 44
12
votes
3 answers

How to locally test Django's Sites Framework

Django has the sites framework to support multiple web site hosting from a single Django installation. EDIT (below is an incorrect assumption of the system) I understand that middleware sets the settings.SITE_ID value based on a lookup/cache of…
Daniel Rhoden
  • 6,117
  • 6
  • 26
  • 28
9
votes
1 answer

Django allauth with email as username and multiple sites

Is it possible to use Django allauth with the authentication method set to 'email' when using it on multiple sites? I'm aiming to allow a user with the email address bob@example.com to create an account at site1.com and a separate account at…
bodger
  • 1,112
  • 6
  • 24
9
votes
2 answers

what is the use of SITE_ID settings in django?

When I am doing the flatpage tutorial, I was getting error for SITE_ID not being set. I inserted SITE_ID=1 in the settings file and everything worked fine. But I don't know what this actually means. I read through the django docs. but I am not…
brain storm
  • 30,124
  • 69
  • 225
  • 393
8
votes
1 answer

cannot add inline to django site admin framework

The admin.py is as follows :- class SiteDetailInline(admin.TabularInline): model = SiteDetail form = SiteDetailForm fields = ('name', ) can_delete = False extra = 1 max_num = 1 def get_readonly_fields(self, request,…
8
votes
1 answer

Multiple Django sites with shared codebase and DB

I have created a Django proyect with 20 sites (one different domain per site) for 20 different countries. The sites share everything: codebase, database, urls, templates, etc. The only thing they don't share are small customizations (logo,…
Alex Gonzalez
  • 981
  • 1
  • 11
  • 17
7
votes
3 answers

Django - Multiple Sites Site Caching

I have a number of sites under one Django application that I would like to implement site wide caching on. However it is proving to be a real hassle. what happens is that settings.CACHE_MIDDLEWARE_KEY_PREFIX is set once on startup, and I cannot go…
Werda
  • 279
  • 1
  • 3
  • 9
7
votes
2 answers

Django 1.7 multisite User model

I want to serve a Django application that serves multiple web sites by single database but different user sets. Think like a blog application, it will be used by several domains with different themes, but use same database by adding a site field to…
1
2 3 4 5 6 7 8