- edited description
django_site
Postman requires the django_site table in order to work, but 'django.contrib.sites' is an optional package, and I prefer not to have it in my app.
Is it possible to add RequestSite to places where Site is used so that Postman will work even if I don't have django_site?
E.g.:
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
if Site._meta.installed:
site = Site.objects.get_current()
else:
site = RequestSite(request)
Comments (5)
-
reporter -
repo owner - changed status to open
Your proposal is a step but it doesn't cover the situation where there is not even a request object available, which is the case of the API access. The site object is used only in two templates, to render the subject of email notifications. In the worst situation (no Site, no request) - you may say it's not yours but the app must deal with it - , you would have to overwrite these templates to hard-code the site name, or change the sentence. I believe it is acceptable, do you agree?
-
repo owner -
assigned issue to
-
assigned issue to
-
reporter Ah, I haven't considered the API access case. I think your proposal is acceptable.
-
repo owner - changed status to resolved
- Log in to comment