Re: Getting URL root

2013-07-02 Thread Jirka Vejrazka
> I know them, but I need to programmatically get it in a way that works everywhere. Sorry, you can't. You might be able to do in in some circumstances, but not reliably "everywhere". There is too many unknowns involved if you are out of the request-response cycle (e.g. named virtual hosts, CNAME

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 7:12 AM, Drew Ferguson wrote: > On Tue, 2 Jul 2013 06:13:23 -0600 > Larry Martell wrote: > >> On Tue, Jul 2, 2013 at 6:06 AM, Mike Dewhirst >> wrote: >> > On 2/07/2013 9:51pm, Larry Martell wrote: >> >> >> >> On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst >> >> wrote: >> >

Re: Getting URL root

2013-07-02 Thread Drew Ferguson
On Tue, 2 Jul 2013 06:13:23 -0600 Larry Martell wrote: > On Tue, Jul 2, 2013 at 6:06 AM, Mike Dewhirst > wrote: > > On 2/07/2013 9:51pm, Larry Martell wrote: > >> > >> On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst > >> wrote: > >>> > >>> On 2/07/2013 5:07pm, Larry Martell wrote: > > >

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 6:46 AM, Mike Dewhirst wrote: > On 2/07/2013 4:43pm, Larry Martell wrote: >> >> On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube >> wrote: >>> >>> It sounds like you want to get the subdomain. Havew a look at the >>> urlparse >>> module and its usage. >>> >>> >>> htt

Re: Getting URL root

2013-07-02 Thread Mike Dewhirst
On 2/07/2013 4:43pm, Larry Martell wrote: On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube wrote: It sounds like you want to get the subdomain. Havew a look at the urlparse module and its usage. http://stackoverflow.com/questions/6925825/get-subdomain-from-url-using-python Perhaps I

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 6:06 AM, Mike Dewhirst wrote: > On 2/07/2013 9:51pm, Larry Martell wrote: >> >> On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst >> wrote: >>> >>> On 2/07/2013 5:07pm, Larry Martell wrote: I need to get it from a standalone program. It's a django script, but >>>

Re: Getting URL root

2013-07-02 Thread Mike Dewhirst
On 2/07/2013 9:51pm, Larry Martell wrote: On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst wrote: On 2/07/2013 5:07pm, Larry Martell wrote: I need to get it from a standalone program. It's a django script, but not invoked from a request. import socket def get_fully_qualified_domain_name():

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst wrote: > On 2/07/2013 5:07pm, Larry Martell wrote: >> >> I need to get it from a standalone program. It's a django script, but >> not invoked from a request. > > > import socket > def get_fully_qualified_domain_name(): > return socket.getfqdn()

Re: Getting URL root

2013-07-02 Thread Mike Dewhirst
On 2/07/2013 5:07pm, Larry Martell wrote: I need to get it from a standalone program. It's a django script, but not invoked from a request. import socket def get_fully_qualified_domain_name(): return socket.getfqdn() -- You received this message because you are subscribed to the Google Gr

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 1:02 AM, Jirka Vejrazka wrote: > If you need it when you already have a request object, (i.e. not during > initial setup/install), check out request.META options in the documentation. I need to get it from a standalone program. It's a django script, but not invoked from a r

Re: Getting URL root

2013-07-02 Thread Jirka Vejrazka
If you need it when you already have a request object, (i.e. not during initial setup/install), check out request.META options in the documentation. HTH Jirka On Tue, Jul 2, 2013 at 8:43 AM, Larry Martell wrote: > On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube > wrote: > > It s

Re: Getting URL root

2013-07-01 Thread Larry Martell
On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube wrote: > It sounds like you want to get the subdomain. Havew a look at the urlparse > module and its usage. > > http://stackoverflow.com/questions/6925825/get-subdomain-from-url-using-python Perhaps I wasn't clear. I don't know the URL - I'

Re: Getting URL root

2013-07-01 Thread Mike Dewhirst
On 2/07/2013 10:09am, Larry Martell wrote: I have an app I distribute to clients. When I run the app on my local machine I connect to http://127.0.0.1/... When I'm VPN-ed into a client site I connect to the app on their machine with http://xx.xx.xx.xx/... When a client is running locally at thei

Re: Getting URL root

2013-07-01 Thread Sithembewena Lloyd Dube
It sounds like you want to get the subdomain. Havew a look at the urlparse module and its usage. http://stackoverflow.com/questions/6925825/get-subdomain-from-url-using-python On Tue, Jul 2, 2013 at 2:09 AM, Larry Martell wrote: > I have an app I distribute to clients. > > When I run the app on

Getting URL root

2013-07-01 Thread Larry Martell
I have an app I distribute to clients. When I run the app on my local machine I connect to http://127.0.0.1/... When I'm VPN-ed into a client site I connect to the app on their machine with http://xx.xx.xx.xx/... When a client is running locally at their site they connect with http://myappsname.co