Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More pythonic Playdoh layout: no top level __init__, no apps

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...
commit e5b058a1070230fe7eb86f549b6d66feb757fc2e 1 parent b48e29c
@kumar303 authored
View
2  .gitignore
@@ -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
View
2  MANIFEST.in
@@ -0,0 +1,2 @@
+recursive-include */*/templates *.*
+recursive-include */locale *.*
View
0  __init__.py
No changes.
View
7 apps/examples/urls.py
@@ -1,7 +0,0 @@
-from django.conf.urls.defaults import *
-
-
-urlpatterns = patterns('examples.views',
- url(r'^$', 'home', name='examples.home'),
- url(r'^bleach/?$', 'bleach_test', name='examples.bleach'),
-)
View
5 manage.py
@@ -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
@@ -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()
View
0  apps/examples/__init__.py → project/__init__.py
File renamed without changes
View
1  project/base/__init__.py
@@ -0,0 +1 @@
+"""Application base, containing global templates."""
View
0  apps/examples/models.py → project/base/models.py
File renamed without changes
View
0  templates/.gitignore → project/base/templates/.gitignore
File renamed without changes
View
0  templates/example_base.html → project/base/templates/example_base.html
File renamed without changes
View
0  apps/__init__.py → project/examples/__init__.py
File renamed without changes
View
0  apps/.gitignore → project/examples/models.py
File renamed without changes
View
0  apps/examples/templates/examples/bleach.html → project/examples/templates/examples/bleach.html
File renamed without changes
View
0  apps/examples/templates/examples/home.html → project/examples/templates/examples/home.html
File renamed without changes
View
0  apps/examples/templates/examples/mobile/home.html → project/examples/templates/examples/mobile/home.html
File renamed without changes
View
9 project/examples/urls.py
@@ -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'),
+)
View
0  apps/examples/views.py → project/examples/views.py
File renamed without changes
View
0  locale/en_US/LC_MESSAGES/messages.po → project/locale/en_US/LC_MESSAGES/messages.po
File renamed without changes
View
0  locale/fr/LC_MESSAGES/messages.po → project/locale/fr/LC_MESSAGES/messages.po
File renamed without changes
View
0  locale/templates/LC_MESSAGES/messages.pot → project/locale/templates/LC_MESSAGES/messages.pot
File renamed without changes
View
0  settings/__init__.py → project/settings/__init__.py
File renamed without changes
View
7 settings/base.py → project/settings/base.py
@@ -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 = {
@@ -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',
]
View
1  settings/local.py-dist → project/settings/local.py-dist
@@ -5,7 +5,6 @@
#from . import base
#INSTALLED_APPS = base.INSTALLED_APPS + ['debug_toolbar']
-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
View
4 urls.py → project/urls.py
@@ -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')),
View
17 setup.py
@@ -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=[])
Please sign in to comment.
Something went wrong with that request. Please try again.