Re: what do you do to take your site down?

2010-08-06 Thread Eric Chamberlain

On Aug 6, 2010, at 8:36 AM, Margie Roginski wrote:

> Could anyone give me some pointers as to how you deal with taking your
> site down for maintenance?  Is there some standard thing that people
> do to redirect all page requests to some sort of "Sorry, the site is
> down" page?Do you do this directly via apache or do you do it via
> django?
> 

We have the front end web server redirect all web traffic to a static 
maintenance page.  If we are upgrading the site, it typically means that the 
database or the django app server is unavailable.

--
Eric Chamberlain, Founder
RF.com - http://RF.com/







-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: what do you do to take your site down?

2010-08-06 Thread JHeasly
Also, see
"Maintenance Mode for Django Sites"
http://www.weavingtheweb.com/professional-blogs/78-maintenance-mode
and this related link
http://pypi.python.org/pypi/django-maintenancemode/

HTH,
John

On Aug 6, 9:24 am, Margie Roginski  wrote:
> Thank you very much - that all makes perfect sense.
>
> Margie
>
> On Aug 6, 9:09 am, akaariai  wrote:
>
> > On 6 elo, 18:36, Margie Roginski  wrote:
>
> > > Could anyone give me some pointers as to how you deal with taking your
> > > site down for maintenance?  Is there some standard thing that people
> > > do to redirect all page requests to some sort of "Sorry, the site is
> > > down" page?    Do you do this directly via apache or do you do it via
> > > django?
>
> > Make a simple model for notifications and use that on your front page
> > to notify upcoming maintenance breaks. I also use this style to inform
> > updates done etc. The model could be something like this:
>
> > class Notification(models.Model):
> >     notification = models.TextField()
> >     show_from = models.DateTimeField()
> >     show_until = models.DateTimeField()
>
> >     def __unicode__(self):
> >         return self.notification
>
> > Put notifictions =
> > Notification.objects.filter(show_from__lte=datetime.now(),
> > show_until__gte=datetime.now()) into your template and show the
> > notification list there. Use apache to show the actual maintenance
> > break message when the site is down.
>
> > > I additionally have a situation where when our mail server goes down,
> > > I would like to allow people to do GETS, but not POSTS.  If you have
> > > any ideas on this I would be interested.
>
> > One approach is to use middleware, and in the middleware check:
> > if request.method == 'POST' and email_is_down():
> >     return error page.
>
> > You could also use a default context processor which puts
> > posts_allowed variable in the context and then in base.html have {% if
> > not posts_allowed %} Technical problems... saving not allowed {% endif
> > %}. You could also wrap your submit buttons in {% if posts_allowed %}.
> > Maybe disable also the edit links...
>
> > - Anssi
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: what do you do to take your site down?

2010-08-06 Thread Margie Roginski
Thank you very much - that all makes perfect sense.

Margie

On Aug 6, 9:09 am, akaariai  wrote:
> On 6 elo, 18:36, Margie Roginski  wrote:
>
> > Could anyone give me some pointers as to how you deal with taking your
> > site down for maintenance?  Is there some standard thing that people
> > do to redirect all page requests to some sort of "Sorry, the site is
> > down" page?    Do you do this directly via apache or do you do it via
> > django?
>
> Make a simple model for notifications and use that on your front page
> to notify upcoming maintenance breaks. I also use this style to inform
> updates done etc. The model could be something like this:
>
> class Notification(models.Model):
>     notification = models.TextField()
>     show_from = models.DateTimeField()
>     show_until = models.DateTimeField()
>
>     def __unicode__(self):
>         return self.notification
>
> Put notifictions =
> Notification.objects.filter(show_from__lte=datetime.now(),
> show_until__gte=datetime.now()) into your template and show the
> notification list there. Use apache to show the actual maintenance
> break message when the site is down.
>
> > I additionally have a situation where when our mail server goes down,
> > I would like to allow people to do GETS, but not POSTS.  If you have
> > any ideas on this I would be interested.
>
> One approach is to use middleware, and in the middleware check:
> if request.method == 'POST' and email_is_down():
>     return error page.
>
> You could also use a default context processor which puts
> posts_allowed variable in the context and then in base.html have {% if
> not posts_allowed %} Technical problems... saving not allowed {% endif
> %}. You could also wrap your submit buttons in {% if posts_allowed %}.
> Maybe disable also the edit links...
>
> - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: what do you do to take your site down?

2010-08-06 Thread akaariai
On 6 elo, 18:36, Margie Roginski  wrote:
> Could anyone give me some pointers as to how you deal with taking your
> site down for maintenance?  Is there some standard thing that people
> do to redirect all page requests to some sort of "Sorry, the site is
> down" page?    Do you do this directly via apache or do you do it via
> django?

Make a simple model for notifications and use that on your front page
to notify upcoming maintenance breaks. I also use this style to inform
updates done etc. The model could be something like this:

class Notification(models.Model):
notification = models.TextField()
show_from = models.DateTimeField()
show_until = models.DateTimeField()

def __unicode__(self):
return self.notification

Put notifictions =
Notification.objects.filter(show_from__lte=datetime.now(),
show_until__gte=datetime.now()) into your template and show the
notification list there. Use apache to show the actual maintenance
break message when the site is down.

> I additionally have a situation where when our mail server goes down,
> I would like to allow people to do GETS, but not POSTS.  If you have
> any ideas on this I would be interested.

One approach is to use middleware, and in the middleware check:
if request.method == 'POST' and email_is_down():
return error page.

You could also use a default context processor which puts
posts_allowed variable in the context and then in base.html have {% if
not posts_allowed %} Technical problems... saving not allowed {% endif
%}. You could also wrap your submit buttons in {% if posts_allowed %}.
Maybe disable also the edit links...

- Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



what do you do to take your site down?

2010-08-06 Thread Margie Roginski
Could anyone give me some pointers as to how you deal with taking your
site down for maintenance?  Is there some standard thing that people
do to redirect all page requests to some sort of "Sorry, the site is
down" page?Do you do this directly via apache or do you do it via
django?

I additionally have a situation where when our mail server goes down,
I would like to allow people to do GETS, but not POSTS.  If you have
any ideas on this I would be interested.

Thanks for any pointers!

Margie

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.