On Wed, Jun 19, 2013 at 3:32 PM, Jiří Kupka <kupka.ji...@gmail.com> 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
>
> <VirtualHost *:8001>
>         ServerName project.tld
>         DocumentRoot "/var/www/project"
>         ErrorLog /var/www/project/error.log
>         CustomLog /var/www/project/access.log combined
>         <Directory "/var/www/project/">
>                 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"
>         </Directory>
> </VirtualHost>
>
> 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?

Don't use mod_python to serve django. Use wsgi or fcgi. From the docs:

Chapter 12 of the Django Book (second edition) discusses deployment
and especially scaling in more detail. However, note that this edition
was written against Django version 1.1 and has not been updated since
mod_python was first deprecated, then completely removed in Django
1.5.

https://docs.djangoproject.com/en/1.5/howto/deployment/

Cheers

Tom

-- 
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.


Reply via email to