Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Problems configuring urls.py to respond to / [RSS Feed]

#1 Oct. 26, 2005 15:12:24

Clint E.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Problems configuring urls.py to respond to /


Just a quick question, I played with this last night, but I didn't have much luck.How would I set up my urls.py to redirect people who attempt to access
the root URL of the site, (ie.http://mydomain.com/) to the application
I want people to use (ie.http://mydomain.com/myapp/)For whatever reason I couldn't figure out how to set up the url regexp to respond to a request for /thanks in advance!Clint

Offline

#2 Oct. 26, 2005 15:32:50

Andreas S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Problems configuring urls.py to respond to /


Hi Clint,

> How would I set up my urls.py to redirect people who attempt to access the
> root URL of the site, (ie.http://mydomain.com/) to the application I want
> people to use (ie.http://mydomain.com/myapp/)

The regex that catches the root URL is ^/?$ (r'^/?$' in urls.py). In
order to redirect, just use a view that returns
HttpResponseRedirect('/myapp/').

Andreas

Offline

  • Root
  • » Django
  • » Problems configuring urls.py to respond to / [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support