Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
More pythonic Playdoh layout: no top level __init__, no apps
Browse files Browse the repository at this point in the history
The base app has moved to a single module named project. All apps are
submodules of project and must be imported as such.
  • Loading branch information
kumar303 committed Jan 9, 2012
1 parent b48e29c commit e5b058a
Show file tree
Hide file tree
Showing 25 changed files with 43 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
settings_local.py
settings/local.py
*/settings/local.py
*.py[co]
*.sw[po]
.coverage
pip-log.txt
docs/_gh-pages
build.py
build
.DS_Store
*-min.css
*-all.css
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include */*/templates *.*
recursive-include */locale *.*
7 changes: 0 additions & 7 deletions apps/examples/urls.py

This file was deleted.

5 changes: 4 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import os
import sys

# Edit this if necessary or override the variable in your environment.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')

try:
# For local development in a virtualenv:
from funfactory import manage
Expand All @@ -18,7 +21,7 @@
sys.path.remove(tmp_path)


manage.setup_environ(__file__)
manage.setup_environ(__file__, more_pythonic=True)

if __name__ == "__main__":
manage.main()
File renamed without changes.
1 change: 1 addition & 0 deletions project/base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Application base, containing global templates."""
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions project/examples/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.conf.urls.defaults import *

from . import views


urlpatterns = patterns('',
url(r'^$', views.home, name='examples.home'),
url(r'^bleach/?$', views.bleach_test, name='examples.bleach'),
)
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions settings/base.py → project/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from funfactory.settings_base import *


# Bundles is a dictionary of two dictionaries, css and js, which list css files
# and js files that can be bundled together by the minify app.
MINIFY_BUNDLES = {
Expand All @@ -24,10 +23,14 @@
}
}

# Defines the views served for root URLs.
ROOT_URLCONF = 'project.urls'

INSTALLED_APPS = list(INSTALLED_APPS) + [
# Application base, containing global templates.
'project.base',
# Example code. Can (and should) be removed for actual projects.
'examples',
'project.examples',
]


Expand Down
1 change: 0 additions & 1 deletion settings/local.py-dist → project/settings/local.py-dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#from . import base
#INSTALLED_APPS = base.INSTALLED_APPS + ['debug_toolbar']


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
Expand Down
4 changes: 3 additions & 1 deletion urls.py → project/urls.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from django.conf import settings
from django.conf.urls.defaults import *

from .examples import urls

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
# Example:
(r'', include('examples.urls')),
(r'', include(urls)),

# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
Expand Down
17 changes: 17 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os

from setuptools import setup, find_packages


setup(name='project',
version='1.0',
description='Django application.',
long_description='',
author='',
author_email='',
license='',
url='',
include_package_data=True,
classifiers = [],
packages=find_packages(exclude=['tests']),
install_requires=[])
Empty file removed templates/.gitignore
Empty file.

0 comments on commit e5b058a

Please sign in to comment.