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
6
votes
3 answers

Separate Django sites with a common authetication/registration backend

I need split my current Django application into two sites. Site A will contain the public facing site which would contain all the static pages and the registration system. The other site — Site B — is the site for registered users. They can also…
Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382
6
votes
1 answer

Django Sites - Different urls.py for two sites

I maintain a Django webapp for a client of mine. We built it out in Django and for computer users, it's great. We now want to cater to mobile device users. On top of a template switch, we also need things to work differently. The application will…
Oli
  • 235,628
  • 64
  • 220
  • 299
5
votes
3 answers

Django: relation "django_site" does not exist in app with psql using sites framework

after switching from sqlite to postgres for local dev db, I am unable to run migrations for my app. Several fixes and approaches I've attempted have not resolved (ex: Django: relation "django_site" does not exist). python: 3.6.3 Django Version:…
Chris B.
  • 1,505
  • 5
  • 26
  • 48
5
votes
2 answers

Is it possible to use the Django Sites Framework with multiple Sites on the same instance?

I have defined multiple sites as the documentation of the Site Framework suggested. I understand that if I would run mulitple instances of my application with each of them having a different settings file (different SITE_ID), Django would always…
matyas
  • 2,696
  • 23
  • 29
5
votes
1 answer

Safe to modify settings.SITE_ID from middleware in Django?

I have modified the multihost.py middleware I found at http://effbot.org/zone/django-multihost.htm to set the settings.SITE_ID dynamically, but have some concerns that I may have just left the reservation. Most examples I have found for multiple…
Ryan Townshend
  • 2,404
  • 21
  • 36
5
votes
1 answer

Upgrading Django to 1.8 produces irrelevant Sites-framework warnings

The following warning appears twice when I run ./manage.py runserver after upgrading Django from 1.7 to 1.8. .../django/contrib/sites/models.py:78: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn't declare an explicit…
Teekin
  • 12,581
  • 15
  • 55
  • 67
4
votes
1 answer

How do I make Django figure out which Site object to use based on "Host" header in the HTTP request?

Consider a Django app built to serve multiple sites with slightly differing content using the standard Django sitesframework. The traditional way to host this would be to configure multiple Site objects and setup the app in multiple Django projects…
knorv
  • 49,059
  • 74
  • 210
  • 294
4
votes
1 answer

Multiple Django Sites, one server

I have multiple sites for the same client, on the same server, running django, e.g. fooplumbing.com and bazheating.org. These two sites would each have different django apps, that is the plumbing site shouldn't be able to access the heating apps,…
Lexo
  • 470
  • 4
  • 20
3
votes
2 answers

Django Sitemaps : Get only pages of the current website

I would like to create a Site specific Sitemap using Django Sitemaps. My idea was to do something like this : def items(self): current_site = Site.objects.get_current(self.request) return current_site.pages.filter(draft=False) But I have…
Natim
  • 17,274
  • 23
  • 92
  • 150
3
votes
1 answer

One Django app instance for multiple domains

I try to create an Django app which will work for multiple domains with single app instance. For example: there are three domains: group1.com, group2.com, group3.com each domain has restricted content available after login user1 is associated with…
matulik
  • 41
  • 2
3
votes
1 answer

Generate Django sitemap while using site framework

I am using sites framework with RequestSite (no SITE_ID set) to generate content based on domain. I need to generate sitemaps for each domain with different results but I didnt find a way how to make this two frameworks work together. Is there any…
igo
  • 6,359
  • 6
  • 42
  • 51
3
votes
4 answers

Django Migrations ValueError: Could not find manager in django.db.models.manager

I'm trying to update from Django 1.7 to Django 1.8 One of my models uses CurrentSiteManager from django.contrib.sites.managers like so: from django.contrib.sites.managers import CurrentSiteManager class NewsQuerySet(models.QuerySet): …
Todor
  • 15,307
  • 5
  • 55
  • 62
3
votes
1 answer

how to setup sites framework in django

I am trying to setup multiple sites from a single project in django. I was trying to set this up following https://docs.djangoproject.com/en/1.8/ref/contrib/sites/ but there is no mention of setup only how to use the sites framework once…
Atma
  • 29,141
  • 56
  • 198
  • 299
3
votes
2 answers

Automatically prompt to update default site domain name when running Django’s ./manage.py syncdb?

Regarding Django Sites module and manage.py syncdb The Auth module can prompt to ask for default superuser for the admin site, during .\manage.py syncdb. I would like to see similar things happen for the default site domain name. Currently it is…
peiwei
  • 91
  • 5
3
votes
2 answers

Django-CMS multi-regional and multilingual subsite

We have to create multi-regional and multilingual web site. For example: http://mysite.com/jp/us/ For Japan in English http://mysite.com/jp/jp/ For Japan in Japanese http://mysite.com/au/us/ For Australia in English For multiligual,…
James
  • 13,571
  • 6
  • 61
  • 83