Skip to content

Commit

Permalink
Generalized a project layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Lobunets committed Feb 6, 2013
1 parent f0139ca commit df83d56
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -12,4 +12,4 @@ var/
*.log

# Locally generated configuration
src/reimagine/settings_local.py
src/project/settings_local.py
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
ReImagine
Project
===================

Project layout is based on the file-uploads-server buildout layout:
Expand Down
44 changes: 19 additions & 25 deletions profiles/common.cfg
Expand Up @@ -12,12 +12,7 @@ newest = false
unzip = true

# Separate from system
#allowed-eggs-from-site-packages = false

# Dump downloaded eggs versions to versions.cfg
#extensions = buildout.dumppickedversions
#dump-picked-versions-file = profiles/versions.cfg
#overwrite-picked-versions-file = false
allowed-eggs-from-site-packages = false

# Hard-coded eggs versions to install
versions = versions
Expand All @@ -44,17 +39,16 @@ parts =
make-dirs
reset-env
reset-pyc
reimagine
reimagine-configure
django
django-configure
python
# nginx-upload
# nginx
# nginx-conf
# nginx-index-conf
# nginx-ssl-cert
# nginx-ssl-key
# supervisor

nginx-upload
nginx
nginx-conf
nginx-index-conf
nginx-ssl-cert
nginx-ssl-key
supervisor

[project]

Expand Down Expand Up @@ -157,7 +151,7 @@ cmds =
recipe = collective.recipe.template
inline =
#!/bin/bash -ex
cd ${buildout:directory} && rm -rf bin .installed.cfg develop-eggs eggs etc parts *.sqlite var src/reimagine/settings_local.py
cd ${buildout:directory} && rm -rf bin .installed.cfg develop-eggs eggs etc parts *.sqlite var src/project/settings_local.py
output = ${buildout:bin-directory}/reset-env.sh
mode = 755

Expand All @@ -171,12 +165,12 @@ inline =
output = ${buildout:bin-directory}/reset-pyc.sh
mode = 755

[reimagine]
[django]
recipe = djangorecipe
versions =
Django = 1.5c1
project = reimagine
projectegg = reimagine
project = project
projectegg = project
settings = settings
control-script = django
wsgi = true
Expand All @@ -187,12 +181,12 @@ extra-paths =
eggs =
${buildout:eggs}

[reimagine-configure]
[django-configure]
recipe = collective.recipe.template
input = ${buildout:directory}/templates/django/settings_local.py.in
output = ${buildout:directory}/src/reimagine/settings_local.py
output = ${buildout:directory}/src/project/settings_local.py

[pcre_fix_configure]
[pcre-fix-configure]
recipe = iw.recipe.cmd
on_install = true
on_update = true
Expand All @@ -208,7 +202,7 @@ strip-top-level-dir = true
recipe = zc.recipe.egg
initialization =
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'reimagine.settings'
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'
extra-paths =
${buildout:extra-paths}
eggs =
Expand All @@ -226,7 +220,7 @@ md5sum = 2681a6167551830a23336fa41bc539a1

[nginx]
recipe = zc.recipe.cmmi
depends = ${pcre_fix_configure:cmds}
depends = ${pcre-fix-configure:cmds}
url = http://nginx.org/download/nginx-1.2.6.tar.gz
configure-options =
--with-pcre=${pcre:destination}
Expand Down
2 changes: 1 addition & 1 deletion profiles/development.cfg
Expand Up @@ -10,4 +10,4 @@ db-host = localhost
db-port =
db-user = oleksandr
db-pass =
db-name = reimagine_dev
db-name = project_dev
13 changes: 13 additions & 0 deletions profiles/production.cfg
@@ -0,0 +1,13 @@
#
# Development buildout configuration
#

[buildout]
extends = common.cfg

[project]
db-host = localhost
db-port =
db-user = project
db-pass =
db-name = project_prod
File renamed without changes.
File renamed without changes.
Empty file added src/project/core/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/reimagine/settings.py → src/project/settings.py
@@ -1,5 +1,5 @@
#
# Default Django settings for reimagine project.
# Default Django settings for the project.
#
import os

Expand Down Expand Up @@ -100,7 +100,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'reimagine.urls'
ROOT_URLCONF = 'project.urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
Expand Down Expand Up @@ -167,4 +167,4 @@
#
# Include settings overrides
#
from reimagine.settings_local import *
from project.settings_local import *
Empty file added src/project/templates/.gitkeep
Empty file.
File renamed without changes.
8 changes: 4 additions & 4 deletions templates/django/settings_local.py.in
Expand Up @@ -35,14 +35,14 @@ STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
'${buildout:directory}/src/reimagine/assets',
'${buildout:directory}/src/project/assets',
)

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
'${buildout:directory}/src/reimagine/templates',
'${buildout:directory}/src/project/templates',
)

AUTH_USER_MODEL = 'core.User'
Expand All @@ -61,6 +61,6 @@ INSTALLED_APPS = (
'gunicorn',
'south',
'django_extensions',
'reimagine',
'reimagine.core',
'project',
'project.core',
)

0 comments on commit df83d56

Please sign in to comment.