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
2
votes
1 answer

Is there a way to add fields onto Django's Sites Framework?

I really like the idea of the sites framework for making an application functional across multiple web sites. Is there a way to add fields onto the Site object for the database, or should I just create a foreign-key one-to-one relationship?
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
2
votes
2 answers

Changing default Django site name and domain from example.com to the proper ones

According to the Django documentation (here): django.contrib.sites registers a post_migrate signal handler which creates a default site named example.com with the domain example.com. This site will also be created after Django creates the test…
mahyard
  • 1,230
  • 1
  • 13
  • 34
2
votes
1 answer

How can a person extend django.contrib.sites.admin so as to include a field from a model with a foreign key pointing at sites?

I am struggling to extend the django.contrib.sites.admin. I am having a difficult time finding how to add a field to the sites admin page due to the fact that django.contrib.sites knows nothing of my foreign model. Is there an easy way which I am…
wilbbe01
  • 1,931
  • 1
  • 24
  • 38
2
votes
2 answers

How to solve filer and sites dependencies problem in my project

Currently I have started working on Django project given by me for learning purpose. I have done all kind of necessary setup in my virtualenv and when running migrate command on my project I am getting below kind of dependencies problems as below. I…
Moon
  • 4,014
  • 3
  • 30
  • 66
2
votes
0 answers

Django: how to have multiple sites with different default language

The situation: I have a instance of Django that runs multiple sites, each site can be configured by an admin user (it doesn't use Django admin but an admin app created by me). The problem: The problem is that each site should have a different…
Nazkter
  • 1,040
  • 1
  • 11
  • 31
2
votes
1 answer

Django: What is the proper way to include multiple settings.py files (or include a dynamic SITE_ID) using the sites framework?

I'm getting this error on my Django site in production: You're using the Django "sites framework" without having set the SITE_ID setting. Create a site in your database and set the SITE_ID setting or pass a request to Site.objects.get_current() to…
YPCrumble
  • 26,610
  • 23
  • 107
  • 172
2
votes
1 answer

In the Django Admin, how can I force the "View on Site" button to ignore Sites?

Before I added the Sites application to my Django app, the "View on Site" button used a relative path. This was helpful because my site is accessed through several different domains and a staging environment. I recently started using the Flat Pages…
bfox
  • 274
  • 2
  • 13
2
votes
2 answers

django cross-site reverse a url

I have a similar question than django cross-site reverse. But i think I can't apply the same solution. I'm creating an app that lets the users create their own site. After completing the signup form the user should be redirected to his site's new…
tutuca
  • 3,444
  • 6
  • 32
  • 54
2
votes
2 answers

Django 1.6: What should be the location of the sitemap.py file?

I want to implement django sitemaps but I'm little confused about where to put the sitemaps.py file and which urls.py file should i modify to include: url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.index', {'sitemaps': sitemaps}), Shall I…
James L.
  • 1,143
  • 22
  • 52
2
votes
1 answer

How to set site domain without Django sites framework in place?

I'm moving my site from Django 1.5.x to Django 1.6.0, and I noted this in the release notes: [..] The admin is now enabled by default in new projects; the sites framework no longer is. [..] How to set the default domain (instead of…
Joseph Victor Zammit
  • 14,760
  • 10
  • 76
  • 102
2
votes
2 answers

django.contrib.sites.models.Site gives example.com as the server url

I want to get the server url in django. So I went through stackoverflow and found out that in order to do this I will have to do the following: >>> from django.contrib.sites.models import Site >>> mysite = Site.objects.get_current() I tried the…
Indradhanush Gupta
  • 4,067
  • 10
  • 44
  • 60
2
votes
2 answers

Grammatical cases in multi-site Django deployments

I am deploying a single Django project for managing a certain kind of an event. There are two deployments with a single database, the sites are in Slovak. They are for events called „Akadémia Trojstenu“ and „Klub Trojstenu“. The simple part is I can…
koniiiik
  • 4,240
  • 1
  • 23
  • 28
2
votes
1 answer

Different database for each django site

Suppose we have multiple sites (using sites-framework of Django) running on the same django instance. MyModel.objects.filter(site_id=request.site, slug=slug)[0] might be an overhead in the future. So I was wondering if I could split the databases…
aladagemre
  • 592
  • 5
  • 16
2
votes
1 answer

How to centralize logins OpenID in django?

I have split my Django application into two sites with different databases. I use OpenID (python_openid-2.2.5) for authetication/registration but users of site A are different from site B. How can I do to centralize logins between apps running on…
Adam
  • 173
  • 1
  • 3
  • 11
1
vote
2 answers

Fetching Django-comments from all sites for a given object

I am sharing objects between different sites using the Django-sites framework. This works fine because I was able to define a many-to-many relationship within my models. However, while retrieving the comments (Django-comments) for the objects using…
Alex Gonzalez
  • 981
  • 1
  • 11
  • 17