Hi Carlos,

The sites framework is used for storing a human readable name of a domain 
(in case you are serving your site from multiple domains). It does not 
change or modify the url structure of your site.

There are only two places where you can actually change the URL structure. 
First option is to specify the exact URLs in urls.py. The second option is 
outside Django and involves manipulating the URL by the webserver or using 
WSGI middleware. For example, if you are using Apache as your web server 
you can trivially perform URL rewriting using .htaccess files (
http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/
)

In your case, I suggest the first option. I guess you are using 
django-registrations app, then you will need to modify the urls app as 
follows: url(r'^accounts/formhub/', include(
'registration.backends.simple.urls')),

Regards,
Arun

On Tuesday, January 7, 2014 5:22:36 AM UTC+5:30, Carlos Quiros wrote:
>
> Hello.
>
> I have a Django application running in my server 
> http://data.ilri.org/formhub
>
> However the links of the application are broken for example 
> *http://data.ilri.org/accounts/register/ 
> <http://data.ilri.org/accounts/register/>* instead of 
> *http://data.ilri.org/formhub/accounts/register/ 
> <http://data.ilri.org/formhub/accounts/register/> *
>
> I been looking on the internet and also configured the site framework with:
>
> python manage.py shell
> >>> from django.contrib.sites.models import Site
> >>> one = Site.objects.all()[0]
> >>> one.domain = 'http://data.ilri.org/formhub/'
> >>> one.name = 'Formhub'
> >>> one.save()
> >>> quit()
> (formhub-env)[cquiros@rmg formhub]$ python manage.py dumpdata sites
> Your environment is:"formhub.preset.default_settings"
> [{"pk": 1, "model": "sites.site", "fields": {"domain": "
> http://data.ilri.org/formhub/";, "name": "Formhub"}}](formhubnv)
>
> But still the links are broken.
>
> What else do I need to do?
>
> Any help is much appreciated.
>
> Carlos.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/331ed190-f6f9-4e97-8319-8f565ea7f58c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to