Incorrect links in translations stats website

Bug #971432 reported by Rachid
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Translations Stats
Fix Released
High
David Planella

Bug Description

On the website http://91.189.93.77/stats/precise/

The links in the clickable list of countries are incorrect. For example the URL of the first one (Slovenian) links to:
http://91.189.93.77/stats/precise/precise/sl
It should be:
http://91.189.93.77/stats/precise/sl

Related branches

Rachid (rachidbm)
description: updated
Gabor Kelemen (kelemeng)
Changed in ubuntu-translations:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → David Planella (dpm)
David Planella (dpm)
affects: ubuntu-translations → ubuntu-translations-stats
Revision history for this message
David Planella (dpm) wrote :

Thanks Rachid for reporting this bug.

This is due to the Apache config and the Django URL definitions not playing together well.

In the meantime, as a workaround, you should be able to access the correct URLs by discarding the last forward slash (/) in the URL, e.g.

    http://91.189.93.77/stats/precise

I'm not an expert in Apache, so any help is appreciated!

See the details below:

In Apache
---------

        AliasMatch /admin/css/([^/]*\.css) /home/ubuntu/ul10nstats/admin-media/css/$1
        AliasMatch /admin/img/([^/]*) /home/ubuntu/ul10nstats/admin-media/img/$1
        AliasMatch /admin/js/([^/]*\.js) /home/ubuntu/ul10nstats/admin-media/js/$1
        AliasMatch /(ui-lightness/)([^/]*\.css) /home/ubuntu/ul10nstats/stats/static/css/$1/$2
        AliasMatch /([^/]*\.css) /home/ubuntu/ul10nstats/stats/static/css/$1
        AliasMatch /([^/]*\.js) /home/ubuntu/ul10nstats/stats/static/js/$1
        AliasMatch /([^/]*\.png) /home/ubuntu/ul10nstats/stats/static/img/$1
        AliasMatch /([^/]*\.ico) /home/ubuntu/ul10nstats/stats/static/img/$1

In Django
---------

$ cat ul10nstats/urls.py
from django.conf.urls.defaults import *
from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns('',
    url(r'^stats/', include('stats.urls')),
    url(r'^admin/', include(admin.site.urls)),
)

$ cat ul10nstats/stats/urls.py
from django.conf.urls.defaults import *

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('stats.views',
    url(r'^$', 'release_list', name='release-list'),
    url(r'^(?P<release_name>[a-z]+)/?$', 'language_list', name='language-list'),
    url(r'^(?P<release_name>[a-z]+)/(?P<language_code>[a-zA-Z\@\-\_\.\+?]+)$', 'language_details', name='language_details'),
)

I'm also not using APPEND_SLASH = True in Django

Revision history for this message
Rachid (rachidbm) wrote :

I can look into this bug.

To test if my solution works I think it would be wise to set up this project on my workstation. I branched the code and installed Django 1.2.5. I can start the Django server with the command 'manage.py runserver' (no errors). But when I access the website I get: No module named ul10nstats.urls

Can you give me some more information about how the webserver is running? Apache obviously. Does it matter which Django version I use? Do I need some specific settings in Apache?
I can find out myself how to run Django with Apache...

David Planella (dpm)
tags: added: bite-size config
Revision history for this message
David Planella (dpm) wrote :

Sure, thanks!

I've just sent the deployment instructions via e-mail

I think your issue might have to do with the name of the project. Try changing the name of the 'ubuntu-translations-stats' folder to 'ul10nstats'.

Changed in ubuntu-translations-stats:
assignee: David Planella (dpm) → nobody
Rachid (rachidbm)
Changed in ubuntu-translations-stats:
assignee: nobody → Rachid (rachidbm)
status: Triaged → In Progress
Rachid (rachidbm)
Changed in ubuntu-translations-stats:
status: In Progress → Fix Committed
David Planella (dpm)
Changed in ubuntu-translations-stats:
status: Fix Committed → Triaged
David Planella (dpm)
Changed in ubuntu-translations-stats:
importance: Medium → High
David Planella (dpm)
Changed in ubuntu-translations-stats:
assignee: Rachid (rachidbm) → David Planella (dpm)
status: Triaged → In Progress
Revision history for this message
David Planella (dpm) wrote :

Fixed on revision 55 by using the Django 'url' template tag.

Changed in ubuntu-translations-stats:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.