Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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
   #
)
share|improve this answer
    
Interesting. Thanks for the help. –  Garfonzo Aug 27 '11 at 21:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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