1

Django プロジェクト レイアウトに対する古くから受け入れられている回答glueでは、他のさまざまなアプリケーション (ホームページなど) からのデータを結合するアプリケーションを作成することをお勧めします。

Django 1.4 が../project_name/project_name/フォルダを自動的に作成するようになったproject_nameので、アプリケーションをアプリケーションとして使用する必要がありglueますか? それとも、coreアプリを作成して、自動作成されたproject_nameアプリケーションをそのままにしておくべきですか?

4

1 に答える 1

0

Over the last couple of projects, I've found the following layout to work quite well:

The common folder above contains all the stuff that doesn't really fit elsewhere, including the base urls.py, sitemaps.py, general template tags, general context processors and so on. I find this pretty clean and easy to maintain. Most importantly, the entire directory can be easily checked into git.

I wouldn't worry about the default layout for 1.4. Do whatever suits you.

- apps/ 
  - /foo_app
  - /bar_app
- common # The equivalent of the glue app you talk about
- confs # Uwsgi/supervisor/nginx/gunicorn etc. configurations
  - /production  
  - /staging
  - /dev
- docs
- fixtures
- media
- static
- requirements # for `pip freeze > ...`
  - /production 
  - /staging
  - /development
- scripts
- settings
  - private.py # Secret Key etc., not put on VCS
  - database.py # DB Settings, also no in VCS
  - development.py
  - production.py
  - staging.py
  - default.py # All Django's settings
  - custom.py # Custom application settings
- templates
于 2012-08-12T14:30:20.270 に答える