Setting APPEND_SLASH = False and PREPEND_WWW = True

1,348 views
Skip to first unread message

JJ Zolper

unread,
Aug 9, 2012, 10:41:44 PM8/9/12
to django...@googlegroups.com
Hello all,

I am interested in making these two changes to Django: Setting APPEND_SLASH = False and PREPEND_WWW = True.

The following links describe what each of these do but do not tell me actually where these settings reside so that I can actually change them:


I did not see them in my settings.py file where I expected them and I don't want to go through my Django source trying to helplessly find it.

Thanks a lot,

JJ Zolper

Russell Keith-Magee

unread,
Aug 9, 2012, 10:50:26 PM8/9/12
to django...@googlegroups.com
When you generate your project, Django generates a sample settings.py
that contains the settings you're most likely going to need to
override -- things that involve paths, the list of apps you want to
install, and so on.

There are *many* other settings that can form part of a Django project
-- they're all documented at the last link you provided. You can put
any of these settings in your own settings.py file. If you don't
provide them, the default value is used; if you do, your value is
used.

If you want, you can even invent your own settings for your own app.
This might be handy for storing things like authentication keys for
third-party services.

So - just put:

APPEND_SLASH = False
PREPEND_WWW = True

in your project's settings.py file, and you'll be off and running.

Yours,
Russ Magee %-)

JJ Zolper

unread,
Aug 10, 2012, 6:05:25 PM8/10/12
to django...@googlegroups.com
Such a clean cut and knowledgeable answer.

10/10 thanks so much Russell!

I'll make sure to add both to my settings file.

Cheers,

JJ
Reply all
Reply to author
Forward
0 new messages