Hi Matt,
The recommended pattern is to register signal receivers in your app
config's
ready() method[1]. From the Django documentation:
> Where should this code live?
>
> Strictly speaking, signal handling and registration code can live
anywhere you
> like, although it’s recommended to avoid
Hi Simon,
Thank you very much for your prompt reply! I've added the following to my
app, which seems to work just fine:
@receiver(models.signals.post_migrate)
def gen_site_config_post_migrate(plan, **kwargs):
# A migration of the `django.contrib.sites` app was applied.
if plan and
Hi Matt,
I worked on the changes that broke your code.
Starting with 1.10 the migration signals are passed an `apps` kwarg
representing
the state of models before and after the specified migrations are applied.
This allows signal receivers to manipulate model definitions that are
synchronized
Hi All,
I have a small Django app that uses the sites framework and has a post_save
signal on Site that does some bits and bobs when a new site is created. On
1.9.7, when you run migrations for the first time, it correctly triggers
the post_save signal. However, after upgrading to 1.10.1,
This is task for apache not for django.
G
26 лют. 2016 23:06 пише:
> no
> Hi,
>
>
> Shouldn’t django.contrib.sites.models.SiteManager.get_current() first
check the given request to determine the current site and then look at the
SITE_ID setting?
>
>
> I would like to have multiple
Hi,
Shouldn’t django.contrib.sites.models.SiteManager.get_current() first check
the given request to determine the current site and then look at the
SITE_ID setting?
I would like to have multiple Sites and choose the current site based on
the context of the request, but fall back to the
Hi,
how can I assign a default siteID to my flatpages during saving it?
I use only 1 Site and want to attach ID=1 to each added flatpage
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
7 matches
Mail list logo