Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Piet van Oostrum
Ferrous Cranus writes: > Ok i see its just a convention. > Can you help on this: > > so we need to remove since the apache cant > see to open it and let Python open it which we know it can because it has > access to any system file the user has access too. > > httpd cannot open this file bec

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Michael Torrie
On 01/19/2013 01:01 AM, Ferrous Cranus wrote: > # render html template and print it data = f.read() counter = > ''' mailto:supp...@superhost.gr";> src="/data/images/mail.png"> > > > Αριθμός Επισκεπτών %d ''' % hits[0] > > > While from within the sam

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Michael Torrie
On 01/21/2013 07:55 AM, Ferrous Cranus wrote: > Yes Dave so we need to remove > since the apache cant see to open it and let Python open it which we > know it can because it has access to any system file the user has > access too. What are you trying to accomplish? I don't see how opening the fi

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Michael Torrie
On 01/21/2013 09:02 AM, Ferrous Cranus wrote: > Ok i see its just a convention. Can you help on this: > > so we need to remove since the > apache cant see to open it and let Python open it which we know it > can because it has access to any system file the user has access too. Is this link gene

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Ferrous Cranus
Ok i see its just a convention. Can you help on this: so we need to remove since the apache cant see to open it and let Python open it which we know it can because it has access to any system file the user has access too. httpd cannot open this file because the location of the image is past

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Michael Torrie
On 01/18/2013 06:02 AM, Ferrous Cranus wrote: > Yes my Python scripts exist in a linux web host. > > os.environ['HOME'] will indeed give the home directory of the user. > > to me /home/nikos/ > > but i want a variable to point to > > /home/nikos/public_html whice is called DocumentRoot. Not it

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Ferrous Cranus
Τη Δευτέρα, 21 Ιανουαρίου 2013 2:33:22 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/21/2013 01:25 AM, Ferrous Cranus wrote: > > > Τη Σάββατο, 19 Ιανουαρίου 2013 10:01:15 μ.μ. UTC+2, ο χρήστης Piet van > > Oostrum έγραψε: > > >> Ferrous Cranus writes: > > > > > While > > > > > > /home/n

Re: Forcing Python to detect DocumentRoot

2013-01-21 Thread Dave Angel
On 01/21/2013 01:25 AM, Ferrous Cranus wrote: Τη Σάββατο, 19 Ιανουαρίου 2013 10:01:15 μ.μ. UTC+2, ο χρήστης Piet van Oostrum έγραψε: Ferrous Cranus writes: While /home/nikos/public_html/cafebar-idea.gr/cgi-bin/counter.py that has also embedded this line: mailto:supp...@superhost.gr";>

Re: Forcing Python to detect DocumentRoot

2013-01-20 Thread Ferrous Cranus
Τη Σάββατο, 19 Ιανουαρίου 2013 10:01:15 μ.μ. UTC+2, ο χρήστης Piet van Oostrum έγραψε: > Ferrous Cranus writes: > > > > > This is addon domain's counter.py snippet tried to load an image mail.png > > and failed because it cant see past its document root > > > > > > =

Re: Forcing Python to detect DocumentRoot

2013-01-19 Thread alex23
On Jan 16, 11:51 pm, Ferrous Cranus wrote: > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html > > f = open( '../' + page ) > > How to say the same thing in an absolute way by forcing Pyth

Re: Forcing Python to detect DocumentRoot

2013-01-19 Thread Piet van Oostrum
Ferrous Cranus writes: > This is addon domain's counter.py snippet tried to load an image mail.png and > failed because it cant see past its document root > > > # render html template and print it > data = f.read() > counter = ''' >

Re: Forcing Python to detect DocumentRoot

2013-01-19 Thread Barry Scott
On 16 Jan 2013, at 13:51, Ferrous Cranus wrote: > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html > > f = open( '../' + page ) > > How to say the same thing in an absolute way

Re: Forcing Python to detect DocumentRoot

2013-01-19 Thread Ferrous Cranus
Τη Παρασκευή, 18 Ιανουαρίου 2013 11:34:05 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Sat, Jan 19, 2013 at 5:58 AM, Ferrous Cranus wrote: > > > Τη Παρασκευή, 18 Ιανουαρίου 2013 3:28:10 μ.μ. UTC+2, ο χρήστης Joel > > Goldstick έγραψε: > > > > > >> DocumentRoot = os.environ['HOME'] + 'pub

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Chris Angelico
On Sat, Jan 19, 2013 at 5:58 AM, Ferrous Cranus wrote: > Τη Παρασκευή, 18 Ιανουαρίου 2013 3:28:10 μ.μ. UTC+2, ο χρήστης Joel Goldstick > έγραψε: > >> DocumentRoot = os.environ['HOME'] + 'public_html' > > Yes, iam using this and it works. > One last thing: > > my python script file is located at

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Ferrous Cranus
Yes, iam using this and it works. One last thing: my python script file is located at /home/nikos/public_html/addon_domain/cgi-bin/ How python is able to run the following statement? f = open( '/home/nikos/public_html/' + page ) which is clearly levels up of addon domain's DocumentRoot?

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Joel Goldstick
On Fri, Jan 18, 2013 at 1:58 PM, Ferrous Cranus wrote: > Τη Παρασκευή, 18 Ιανουαρίου 2013 3:28:10 μ.μ. UTC+2, ο χρήστης Joel > Goldstick έγραψε: > > > DocumentRoot = os.environ['HOME'] + 'public_html' > > Yes, iam using this and it works. > One last thing: > > my python script file is located at >

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Ferrous Cranus
Τη Παρασκευή, 18 Ιανουαρίου 2013 3:28:10 μ.μ. UTC+2, ο χρήστης Joel Goldstick έγραψε: > DocumentRoot = os.environ['HOME'] + 'public_html' Yes, iam using this and it works. One last thing: my python script file is located at /home/nikos/public_html/addon_domain/cgi-bin/ How python is able to r

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Rodrick Brown
; > > > > > > > > > f = open( '../' + page ) > > > > > > > > > > How to say the same thing in an absolute way by forcing Python to > detect > > > > > DocumentRoot by itself? > > $ export DOCUMENT_ROOT=${HOME

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Joel Goldstick
; > > > > f = open( '../' + page ) > > > > > > > > > > How to say the same thing in an absolute way by forcing Python to > detect > > > > > DocumentRoot by itself? > > > > > > > > Can you give us more

Re: Forcing Python to detect DocumentRoot

2013-01-18 Thread Ferrous Cranus
> When trying to open an html template within Python script i use a relative > > > path to say go one folder back and open index.html > > > > > > f = open( '../' + page ) > > > > > > How to say the same thing in an absolute way by forcin

Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread Joel Goldstick
and open index.html > > > > f = open( '../' + page ) > > > > How to say the same thing in an absolute way by forcing Python to detect > > DocumentRoot by itself? > > Can you give us more details of what you're doing. Is there some web > frame

Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread Roy Smith
t; How to say the same thing in an absolute way by forcing Python to detect > DocumentRoot by itself? Can you give us more details of what you're doing. Is there some web framework you're using? Can you post some code that's not working for you? -- http://mail.python.org/mailman/listinfo/python-list

Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread rusi
On Jan 16, 6:51 pm, Ferrous Cranus wrote: > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html > > f = open( '../' + page ) > > How to say the same thing in an absolute way by forcing Python

Re: Forcing Python to detect DocumentRoot

2013-01-17 Thread Ferrous Cranus
Document Root for me is /home/nikos/public_html Is where Apache store the user www files. How to tell it my using a variable? -- http://mail.python.org/mailman/listinfo/python-list

Re: Forcing Python to detect DocumentRoot

2013-01-16 Thread Joel Goldstick
i use a > relative path to say go one folder back and open index.html > > > > > > > > > > f = open( '../' + page ) > > > > > > > > How to say the same thing in an absolute way by forcing Python to detect > DocumentRoot by itsel

Re: Forcing Python to detect DocumentRoot

2013-01-16 Thread Ferrous Cranus
; > > > > f = open( '../' + page ) > > > > How to say the same thing in an absolute way by forcing Python to detect > DocumentRoot by itself? > > -- > > http://mail.python.org/mailman/listinfo/python-list > > > > I don't th

Re: Forcing Python to detect DocumentRoot

2013-01-16 Thread Joel Goldstick
On Wed, Jan 16, 2013 at 8:51 AM, Ferrous Cranus wrote: > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html > > f = open( '../' + page ) > > How to say the same thing in an absolute way

Forcing Python to detect DocumentRoot

2013-01-16 Thread Ferrous Cranus
When trying to open an html template within Python script i use a relative path to say go one folder back and open index.html f = open( '../' + page ) How to say the same thing in an absolute way by forcing Python to detect DocumentRoot by itself? -- http://mail.python.org/mailma