1

First of all I have found several solutions for my problem but no one fits. So i use Django 1.5 + Python 3.3 + Gunicorn + Nginx as webserver.

My Django project directory look like:

fv/
  frontend/
    static/
    templates/
      index.html
    models.py
    views.py
  fv/ -- this is only a folder where logic calculating files are stored
  media/
  static/
  manage.py
  settings.py
  urls.py
  wsgi.py

Now I would like to have the app homepage like frontend but these two apps should be like a standalone website which different domains like www.homepage.com and www.frontend.com. But they should use the same model, because the only model table I would like to share is the Django user model. And every app should have his own template files and urls.py.

I've already read the Django sites framework documentation but i have no idea how to redesign my project dir and arrange other necessary parts like the settings.py, urls.py.

I hope anyone could help me? :)

user2412771
  • 509
  • 2
  • 7
  • 10
  • 1
    I recently answered very similar, more general, question. [The answer](http://stackoverflow.com/a/19013555/262618) might help you. – Ludwik Trammer Oct 07 '13 at 12:40
  • Great, now its a bit clear. so the things i have to do is, to make two settings.py files for every site and one base_settings.py file. But how must i reorganize my directory structure? – user2412771 Oct 07 '13 at 12:53
  • 1
    You don't have to, really. The only thing you have to do is to have two settings.py with appropriate `INSTALLED_APPS` setting and most likely `ROOT_URLCONF` setting pointing to two different urls.py. – Ludwik Trammer Oct 07 '13 at 13:04
  • Thanks for your fast response. I'll try it immediately ;) – user2412771 Oct 07 '13 at 13:06
  • BTW - is it a good idea, to have only one static/ and media/ folder in the root of my project for both websites? – user2412771 Oct 07 '13 at 13:10
  • That solely depends on you preferences. If you know for sure they won't share any static media or user uploaded content you can have two. – Ludwik Trammer Oct 07 '13 at 13:14
  • Ok - in dev mode its clear for me how to start the sites (via the --settings option), but how can I run both at the same time and access it via a different domain who I have defined in my sites model? And how can I get access to the site in production mode using gunicorn as webserver? – user2412771 Oct 08 '13 at 05:16

0 Answers0