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

django site framework: Which models should be associated with a site (foreign, manytomany)?

according to the docu this is pretty straight forward: class Article(models.Model): headline = models.CharField(max_length=200) # ... site = models.ForeignKey(Site) but what if i have an additional Model? i.e.: class…
fetzig
  • 1,642
  • 1
  • 13
  • 25
0
votes
0 answers

Best solution to integrate independent applications into a Django (& React) platform?

I have a general platform that I want to evolve. The platform is hosted on a domain like "https://www.example.com". For certain specific users, I would like to give them access to a completely independent application (several applications,…
0
votes
1 answer

How to restrcit users to their Site in Django?

I'm getting to know the Sites framework in Django. One thing I cannot find in the documentation is how to restrict users to "their" sites. Lets say I have example.com and sexyblog.com. Both sites run of the same code base and share the same db using…
JasonTS
  • 2,479
  • 4
  • 32
  • 48
0
votes
0 answers

How to have multiple SITE IDs?

I'm trying to wrap my head around the Site framework in Django. One part I don't really get is the SITE ID. I am working on a db for my photographer friends to store their content. They have different domains und using the "get_current_site()"…
JasonTS
  • 2,479
  • 4
  • 32
  • 48
0
votes
0 answers

Sites-Framework and static_root

In my project, 3 different sites are working in a virtual environment. I have a 4th dashboard design to organize these sites. site1_settings.py STATIC_URL = 'static/site1/' STATIC_ROOT = BASE_DIR / 'static/site1/' STATICFILES_DIRS = [ …
0
votes
0 answers

Django Sites Framework __str__ representation

I'm experimenting with the Django Site framework. In an UpdateView form, the Site model _str_ representation is self.domain, but I want to use self.name. For example, instead of 'www.test.com', I'd like 'Test, Inc.' to appear. I guess I could…
0
votes
0 answers

Self-hosting multiple sites via one Django project + apache - Django Sites framework

I have a self-hosted (raspberry pi) website running on Django - one project with several apps all serving on one domain name. I'm more of a programmer than a server admin, but it works! Now, I'd like to break one of those apps out onto a second…
VMills
  • 183
  • 3
  • 4
  • 12
0
votes
0 answers

Access other domain files through Django sites framework

I'm trying to change the stripe api keys on the three domains that are on a digital ocean droplet. The project is using the Django sites framework to host these three domains. Therefore when I change the key it works only for one domain and not for…
Christophe
  • 63
  • 5
0
votes
1 answer

Django- Incorporate django-sites with multiple models

I am trying to build a white labled product and I am thinking to use django-sites module. I have multiple models of a particular site. I have found an example like add foreign key of a Site model to a single model. but adding foreign key of Site…
0
votes
1 answer

Django siteframework, How often django create sitemap.xml file?

I have a Django siteframework to create dynamic sitemap.xml sheet. class NewsSitemap(Sitemap): changefreq = "daily" priority = 0.8 protocol = 'https' def items(self): return News.objects.all() # news objects def…
anoop
  • 47
  • 1
  • 1
  • 5
0
votes
1 answer

Django access site name/url in template - views, contexts and settings

(It feels like "best practices" type of question, sorry if these don't belong here) I'm building a website which has user registration and password reset feature, both of which would send email to the user with a link to click to complete the…
0
votes
1 answer

Django "[object] instance with id X does not exist" error when creating/updating object foreign key in admin, using sites framework

I have a Django application using the sites framework. I have a Category model and a Topic model. The Topic model has a "category" attribute pointing to a specific Category object. Both of these models have "site" attributes linking them to specific…
0
votes
1 answer

Django (v3.1) PASSWORD RESET LINK: AssertionError at line 260 of django/contrib/auth/views.py assert 'uidb64' in kwargs and 'token' in kwargs

I am having trouble getting past an Assertion error when clicking the password reset link in Django 3.1.2. I have Django running within a Docker container. The emailed link appears to be correct, as it uses the proper domain 'localhost'. However,…
0
votes
1 answer

Are subdomains considered "websites" in Django sites framework?

I am developing a language-based web application using Django. I would like to separate content using language subdomains (similar to Wikipedia, Quora, and other multilingual websites). For example, if my website were website.com, I would like to…
fredperk
  • 737
  • 1
  • 9
  • 22
0
votes
1 answer

Django admin misbehaves after adding for django.contrib.sites on server

Django Admin Site was working fine on local server. But the same thing when deployed on server. Admin CSS misbehaves See Screenshot Admin panel screenshot on server admin panel site also working fine on mobile responsive view or small screens On…