зеркало из https://github.com/mozilla/pontoon.git
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.
This commit is contained in:
Родитель
b48e29c88a
Коммит
e5b058a107
|
@ -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
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
recursive-include */*/templates *.*
|
||||
recursive-include */locale *.*
|
|
@ -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'),
|
||||
)
|
|
@ -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 @@ except ImportError:
|
|||
sys.path.remove(tmp_path)
|
||||
|
||||
|
||||
manage.setup_environ(__file__)
|
||||
manage.setup_environ(__file__, more_pythonic=True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
manage.main()
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
"""Application base, containing global templates."""
|
|
@ -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'),
|
||||
)
|
|
@ -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 @@ MINIFY_BUNDLES = {
|
|||
}
|
||||
}
|
||||
|
||||
# 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',
|
||||
]
|
||||
|
||||
|
|
@ -5,7 +5,6 @@
|
|||
#from . import base
|
||||
#INSTALLED_APPS = base.INSTALLED_APPS + ['debug_toolbar']
|
||||
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
|
@ -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')),
|
|
@ -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=[])
|
Загрузка…
Ссылка в новой задаче