Is it possible to have two different urls.py files for one project, using one of them all the time, but then invoking the second for development purposes?

What I want is this:

For production (and is live 24/7) I want the following links:

www.mydomain.com
www.mydomain.com/about/
www.mydomain.com/contact/

But for development (which I use the runserver now and then as I test) I want all the base links, plus a few more:

www.mydomain.com
www.mydomain.com/about/
www.mydomain.com/contact/
www.mydomain.com/secret/sauce/
www.mydomain.com/punchanella/in/the/zoo/
www.mydomain.com/me/too/

So effectively the outside world does not even know that my extra links exist since they don't have any access to them.

Is this even possible?

link|improve this question

42% accept rate
feedback

1 Answer

up vote 1 down vote accepted

I would do it like this

In your settings.py set the following

LOCAL_DEV = True

then in your urls.py

from django.conf import settings
if settings.LOCAL_DEV:
  urlpatterns = patterns('',
   #
   # all your other urls here for dev
   #
)
link|improve this answer
Interesting. Thanks for the help. – Garfonzo Aug 27 '11 at 21:52
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.