Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Dec. 9, 2010 22:56:42

Álex G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Beta page and "under construction"


Hi!

I like to upload my beta page to a server, but I only want to show this beta
to certains IPs. If get the IP of the cliente could be possible in the
urls.py file this will be easy, but I can't do that.

I read about request.META, really I'm using it on certain views, but in
urls.py I can't do that.

My idea is create a different urlpatterns depending of the IP or if someone
have another idea I'm really interesting in hear it.

Thanks!

--
@agonzalezro <http://twitter.com/agonzalezro>
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
and/or .pptx

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 9, 2010 23:05:00

Christophe P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Beta page and "under construction"


On Dec 9, 2010, at 2:56 PM, Álex González wrote:
> I like to upload my beta page to a server, but I only want to show this beta
> to certains IPs. If get the IP of the cliente could be possible in the
> urls.py file this will be easy, but I can't do that.

This seems like a good application for a customer middleware module that
redirects to the beta page on the basis of the IP.

--
-- Christophe Pettus
x...@thebuild.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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Dec. 10, 2010 10:25:31

Álex G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Beta page and "under construction"


Lot of thanks for your idea Christophe!

I made this simple middleware:

from django.http import HttpResponseRedirect

class BetaOrSplash(object):

allowed_ips =

def process_request(self, request):
if request.META in self.allowed_ips:
pass
else:
return HttpResponseRedirect('http://example.com/index.html')

And it works perfectly! :)

On Fri, Dec 10, 2010 at 00:04, Christophe Pettus <x...@thebuild.com> wrote:

>
> On Dec 9, 2010, at 2:56 PM, Álex González wrote:
> > I like to upload my beta page to a server, but I only want to show this
> beta to certains IPs. If get the IP of the cliente could be possible in the
> urls.py file this will be easy, but I can't do that.
>
> This seems like a good application for a customer middleware module that
> redirects to the beta page on the basis of the IP.
>
> --
> -- Christophe Pettus
> x...@thebuild.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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>


--
@agonzalezro <http://twitter.com/agonzalezro>
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt
and/or .pptx

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 20th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support