Re: reverse funtion gives me url including server path
Solved... I just delete this line with PythonOption and now, everything works right. Thanks for you advice! Jirka Dne čtvrtek, 20. června 2013 10:35:02 UTC+2 Jiří Kupka napsal(a): > > Ok, I rewrote it on PythonOption django.root /. Now, reverse returns > right url, but... for some reason, on every page like /page/xx I get error > 404. It's not only /page/xx, it's media and static files folder too. The > only page that works is homepage without css and js, as a result of error > 404 in media and static directory. > > Anything else, what I forgot to do? > > Thanks, > Jirka > > Dne středa, 19. června 2013 20:19:37 UTC+2 Timster napsal(a): >> >> It's this line: >> >> PythonOption django.root /var/www/project >> >> Change that to / or anything else and you should be all set. >> >> On Wednesday, June 19, 2013 10:32:12 AM UTC-4, Jiří Kupka wrote: >>> >>> Hi! I have little trouble with reverse function in my project. When I >>> run it over ./manage runserver, everything is fine - reverse gives me url >>> in /page/xx format. When I run my project over apache2 using this conf file: >>> >>> Listen 8001 >>> >>> >>> ServerName project.tld >>> DocumentRoot "/var/www/project" >>> ErrorLog /var/www/project/error.log >>> CustomLog /var/www/project/access.log combined >>> >>> SetHandler python-program >>> PythonHandler django.core.handlers.modpython >>> SetEnv DJANGO_SETTINGS_MODULE settings >>> PythonOption django.root /var/www/project >>> PythonDebug Off >>> PythonPath >>> "['/var/www/','/var/www/project','/usr/local/lib/site-packages/django'] + >>> sys.path" >>> >>> >>> >>> reverse gives me url in /var/www/project/page/xxx format -> >>> http://project.tld/var/www/project/page/xxx. What is interesting, I can >>> open http://project.tld/page/xxx and >>> http://project.tld/var/www/project/page/xxx and I get same results, but >>> reverese function returns "ugly" full path... >>> >>> Any suggestions, how can I fix it? >>> >>> Thanks, >>> Jirka >>> >> -- 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.
Re: reverse funtion gives me url including server path
Ok, I rewrote it on PythonOption django.root /. Now, reverse returns right url, but... for some reason, on every page like /page/xx I get error 404. It's not only /page/xx, it's media and static files folder too. The only page that works is homepage without css and js, as a result of error 404 in media and static directory. Anything else, what I forgot to do? Thanks, Jirka Dne středa, 19. června 2013 20:19:37 UTC+2 Timster napsal(a): > > It's this line: > > PythonOption django.root /var/www/project > > Change that to / or anything else and you should be all set. > > On Wednesday, June 19, 2013 10:32:12 AM UTC-4, Jiří Kupka wrote: >> >> Hi! I have little trouble with reverse function in my project. When I run >> it over ./manage runserver, everything is fine - reverse gives me url in >> /page/xx format. When I run my project over apache2 using this conf file: >> >> Listen 8001 >> >> >> ServerName project.tld >> DocumentRoot "/var/www/project" >> ErrorLog /var/www/project/error.log >> CustomLog /var/www/project/access.log combined >> >> SetHandler python-program >> PythonHandler django.core.handlers.modpython >> SetEnv DJANGO_SETTINGS_MODULE settings >> PythonOption django.root /var/www/project >> PythonDebug Off >> PythonPath >> "['/var/www/','/var/www/project','/usr/local/lib/site-packages/django'] + >> sys.path" >> >> >> >> reverse gives me url in /var/www/project/page/xxx format -> >> http://project.tld/var/www/project/page/xxx. What is interesting, I can >> open http://project.tld/page/xxx and >> http://project.tld/var/www/project/page/xxx and I get same results, but >> reverese function returns "ugly" full path... >> >> Any suggestions, how can I fix it? >> >> Thanks, >> Jirka >> > -- 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.
reverse function gives me url including server path
Hi! I have little trouble with reverse function in Django. When I run my project as ./manage runserver, everything is just fine - reverse gives me url in /page/xxx format. When I run it as apache2 instance using this conf file: Listen 8001 ServerName project.tld DocumentRoot "/var/www/project" ErrorLog /var/www/project/error.log CustomLog /var/www/project/access.log combined SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE settings PythonOption django.root /var/www/project PythonDebug Off PythonPath "['/var/www/','/var/www/project','/usr/local/lib/site-packages/django'] + sys.path" reverse function returns url including server path - /var/www/project/page/xxx. It means, reverse returns url in this format: http://project.tld/var/www/project/page/xxx. What is interesting, http://project.tld/var/www/project/page/xxx and http://project.tld/page/xxx gives me same results, but reverse() returns url with "ugly" server path. Any suggestions how can I fix it? Thanks, Jirka -- 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.
reverse funtion gives me url including server path
Hi! I have little trouble with reverse function in my project. When I run it over ./manage runserver, everything is fine - reverse gives me url in /page/xx format. When I run my project over apache2 using this conf file: Listen 8001 ServerName project.tld DocumentRoot "/var/www/project" ErrorLog /var/www/project/error.log CustomLog /var/www/project/access.log combined SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE settings PythonOption django.root /var/www/project PythonDebug Off PythonPath "['/var/www/','/var/www/project','/usr/local/lib/site-packages/django'] + sys.path" reverse gives me url in /var/www/project/page/xxx format -> http://project.tld/var/www/project/page/xxx. What is interesting, I can open http://project.tld/page/xxx and http://project.tld/var/www/project/page/xxx and I get same results, but reverese function returns "ugly" full path... Any suggestions, how can I fix it? Thanks, Jirka -- 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.