Questions tagged [django-subdomains]

Django Subdomains is a package aimed at allowing subdomains to be used with the django webframework

The package works by placing a subdomain urlconfs in your settings:

SUBDOMAIN_URLCONFS = {
    None: 'myproject.urls.frontend',  # no subdomain, e.g. ``example.com``
    'www': 'myproject.urls.frontend',
    'api': 'myproject.urls.api',
}

With a key per subdomain.

Other utilities are provided for reversing urls on subdomains.

18 questions
7
votes
2 answers

One view for multiple sub-domains using django-hosts

I need to have multiple sub domains for my project. Each sub domain represents some company. For example: company1.myproject.io, company2.myproject.io. I used django-hosts library to set up sub domains. hosts file: 127.0.0.1 …
belek
  • 907
  • 9
  • 35
7
votes
2 answers

TypeError: object() has no parameters using Django-subdomains

I am trying to configure sub-domains in my Django project using the django-subdomains app. These are steps I took: Installed django-subdomains using pip. Added 'subdomains.middleware.SubdomainURLRoutingMiddleware' to my MIDDLEWARE, just b Added…
darkhorse
  • 8,192
  • 21
  • 72
  • 148
3
votes
1 answer

Get the subdomain in a Django view? using django-hosts library

I'm making a project in django. The aplication have to show diferent images and languages depending on the subdomain. For example: www.mysite.com will be the default page in english, but if the subdomain is mx.mysite.com the language must be…
Sergio Mendez
  • 1,311
  • 8
  • 33
  • 56
2
votes
0 answers

Login redirect to main domain using django-subdomains

My project is using django-subdomains and django-allauth to handle subdomains and auth system. It has a couple of subdomains: company1.project.com, company2.project.com Some of views are using @login_required decorator that redirects user to…
belek
  • 907
  • 9
  • 35
2
votes
1 answer

Testing sub-domains in my localhost using Django

I set up django-subdomains following this guide. I set my subdomain urlconfs as follows: SUBDOMAIN_URLCONFS = { None: 'mysite.urls', 'www': 'mysite.urls', 'shop': 'mysite.urls.shop', 'blog': 'mysite.urls.blog' } Everything works…
darkhorse
  • 8,192
  • 21
  • 72
  • 148
2
votes
1 answer

Trying to find the circular reference in my django urlpatterns using django-subdomains?

I'm getting a the url conf correct for my web app, and I'm at a loose end. I think the idea behind django-subdomains is that the subdomain routing is stored in the SUBDOMAIN_URLCONFS ROOT_URLCONF = 'creativeflow' # A dictionary of urlconf module…
AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173
1
vote
0 answers

Django subdomains unexpected behaviour

My two subdomains aren't routing correctly. Here is my middleware class MIDDLEWARE_CLASSES = [ 'subdomains.middleware.SubdomainURLRoutingMiddleware', 'django.middleware.security.SecurityMiddleware', …
xander cage
  • 219
  • 1
  • 4
  • 11
1
vote
3 answers

Using django subdomain and it says localhost does not belong to the domain example.com

I'm using the Django Package django-subdomain, and I don't think I've configured it correctly. Now that I'm trying to load data from the DB I'm getting this error in the terminal The host localhost:8000 does not belong to the domain example.com,…
AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173
0
votes
0 answers

django subdomains error namespace does not exist

Trying to configure subdomains. ie. two.example.com default domain www.example.com but getting error "app_two is not a registered namespace" via {% url 'app_two:app-two-list' %} in base.html I've also tried {% host_url 'app-two-list' host 'two' %}…
HelloWorld
  • 370
  • 1
  • 7
  • 18
0
votes
1 answer

Django SUB SUB domains

How can i make django ALLOWED_HOST for sub sub domain. For example: For subdomain I can use ALLOWED_HOSTS=['.domain.com'] such that a.domain.com,b.domain.com etc.. will work. But I need x.x.domain.com where x value will change accordingly based on…
Akram
  • 958
  • 5
  • 11
0
votes
1 answer

how to make subdomains in django?

I want to make a panel which has two main urls by the name user and admin and also each of the "user" and "admin" urls have other urls. for example -> " site.com/panel/user/id/profile " OR " site.com/panel/admin/id/addItem " . but idk how can I…
Manny
  • 29
  • 4
0
votes
1 answer

The host 127.0.0.1:8000 does not belong to the domain example.com, unable to identify the subdomain for this request

I am new to Django. I was trying to launch "NewsBlur" (Django based) to my local PC , when everything is set. I ran "python3 manage.py runserver" . Whenever I tried to click btn or manually trigger http request I got error below on my server: The…
Jia
  • 2,417
  • 1
  • 15
  • 25
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

Whyis my django project returning "django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet" error

I am using django to try and create a website that allows usersubdomains. Something like john.stackoverflow.com. I'm currently trying to set up django tenant schamas and nothing seems to be working even though I'm following the documentation. I am…
Opp
  • 520
  • 1
  • 8
  • 21
0
votes
1 answer

Django writing view with sudomain

With my (Django v 1.17) project I am using django-subdomains. I have no problem to call index view and when I open my url https://subdomain.domain.com I will get index.html. My issue that I wrote a new view called example for the sub-domain but when…
Eyla
  • 5,751
  • 20
  • 71
  • 116
1
2