On Tue, Jul 2, 2013 at 1:02 AM, Jirka Vejrazka <jirka.vejra...@gmail.com> 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 request. > On Tue, Jul 2, 2013 at 8:43 AM, Larry Martell <larry.mart...@gmail.com> > wrote: >> >> On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube >> <zebr...@gmail.com> 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'm not trying to parse >> it, I need to find out what it is. >> >> >> >> > On Tue, Jul 2, 2013 at 2:09 AM, Larry Martell <larry.mart...@gmail.com> >> > 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 their site they connect with >> >> http://myappsname.company.com/.... >> >> >> >> I need to get that initial part of the URL from the python side. Is >> >> there some way to do that? (I may be using the wrong terminology here >> >> when I say 'url root'.) >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups >> >> "Django users" group. >> >> To unsubscribe from this group and stop receiving emails from it, send >> >> an >> >> email to django-users+unsubscr...@googlegroups.com. >> >> To post to this group, send email to django-users@googlegroups.com. >> >> Visit this group at http://groups.google.com/group/django-users. >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> >> >> > >> > >> > >> > -- >> > Regards, >> > Sithu Lloyd Dube >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Django users" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an >> > email to django-users+unsubscr...@googlegroups.com. >> > To post to this group, send email to django-users@googlegroups.com. >> > Visit this group at http://groups.google.com/group/django-users. >> > For more options, visit https://groups.google.com/groups/opt_out. >> > >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/django-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.