WebFaction
Community site: login faq
0
2

Hello,

On other hosts, I structure my Django applications like this:

/
    /templates
        base.html
        ...
    /media
        /admin
        /css
        ...
    /myapp
        manage.py
        blog/
            models/
            ...
        events/
        ...

I do it this way so I can keep everything under one directory, keep the whole thing under version control, and use Fab to deploy it to the server. Is there any way of setting up sites this way on WebFaction, or do myapp, media, and templates all need a separate application (and thus a separate directory in webapps?

asked 23 Jan '11, 04:04

Sam Starling
647
accept rate: 0%


There is no problem to use whatever directory structure you wish on our side - Django applications are under your complete control.

"myapp" and "templates" have no reason to use a separate application whatsoever, so these would be under the same app by default. You can change the directory that templates are read from by updating the TEMPLATE_DIRS variable in your settings.py

Creating a separate application for your media is recommended. You can use an application of the type "Symlink to a static-only app" to point the media to some folder within your main application, in order to comply with the structure you have chosen.

permanent link

answered 23 Jan '11, 04:20

tie
1.4k13
accept rate: 44%

edited 23 Jan '11, 04:21

Thanks tie - in the Control Panel, if I set up a new Django application, then it'll create a directory - for example, "myproject". How do I then tell the application to in fact look in "myapp" (see example above) for all the Django bits, rather than in that directory?

(23 Jan '11, 04:26) Sam Starling

Check http://docs.webfaction.com/software/django/getting-started.html#configuring-your-django-installation - it lists the steps you need to take in order to serve your project from a directory other than "myproject". If you do not have a ready app that oyu can upload, you can rename the "myproject" directory, instead of removing it.

(23 Jan '11, 04:32) tie
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

Question tags:

×909
×19
×4
×2
×1

question asked: 23 Jan '11, 04:04

question was seen: 3,973 times

last updated: 23 Jan '11, 04:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM