finding domain name

Bobby Roberts tchendrix at gmail.com
Tue Sep 23 09:00:34 EDT 2008


On Sep 23, 8:54 am, "Joe Riopel" <goo... at gmail.com> wrote:
> On Tue, Sep 23, 2008 at 8:37 AM, Bobby Roberts <tchend... at gmail.com> wrote:
> > hi group.  I'm new to python and need some help and hope you can
> > answer this question.  I have a situation in my code where i need to
> > create a file on the server and write to it.  That's not a problem if
> > i hard code the path.  However, the domain name needs to be dynamic so
> > it is picked up automatically.  The path to our websites is
>
> > home/sites/xxxxx/
>
> > where xxxxx represents the domain name.
>
> > How can I find the domain name of the current url being viewed.
>
> I would guess that a pretty simple regular expression might do it.

can you explain?



More information about the Python-list mailing list