1
1

Saw with great interest Evgeny's answer to this question here about setting up more than one site to run on a single OSQA install.

Here were the steps outlined as to what was needed for each site:

  1. an empty database
  2. settings files, e.g. site_a_settings.py and - site_a_settings_local.py
  3. *.wsgi file (and within specify which settings.py to use)
  4. directory for uploaded files (server-writable) - and save path to that in MEDIA_ROOT settings parameter (in your site_a_settings_local.py)
  5. run python manage.py --settings=site_a_settings.py syncdb to create the database (always use --settings option with the manage.py with multi-site setup)

I think I understand all steps except step 3. I looked at the existing .wsgi files, and poked around parts of the Python documentation, but couldn't see how to accomplish step 3.

How would I specify the particular settings.py file in the *.wsgi file?

Thanks!

asked 04 Jul '10, 00:05

JW's gravatar image

JW
3365912
accept rate: 33%

Hi JW. Did you successfully implemented multi-site set up? I'm stuck. I can use some guidance

(12 Apr, 12:02) Dream

In the line where you specify the environment variable DJANGO_SETTINGS_MODULE, you just change settings to match the file name for each site, so for example, on site A you can have:

os.environ['DJANGO_SETTINGS_MODULE'] = 'osqa.settings_site_a'

and site B:

os.environ['DJANGO_SETTINGS_MODULE'] = 'osqa.settings_site_b'
link

answered 04 Jul '10, 16:34

Hernani%20Cerqueira's gravatar image

Hernani Cerq... ♦♦
16.8k65975
accept rate: 52%

Thank you very much!

(08 Jul '10, 01:29) JW

Hey Hernani,

Can someone write this as a wiki? I'm sure this will come handy for anyone who wants to run multiple sites.

(11 Jul '10, 01:35) pgardiye
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×30
×12
×7

Asked: 04 Jul '10, 00:05

Seen: 899 times

Last updated: 12 Apr, 12:02

powered by OSQA