Answer the question
In order to leave comments, you need to log in
How to organize the development of a reusable app for Django?
Something I can not think of a folder structure and the development process itself.
The documentation says how to build a package for pypi, but how to make development convenient for the whole team ... So that you can immediately download and install the application for your needs. And at the same time, what could be cloned from the git, run a demo site, fix something, upload it back - here is the new version, which after updating the packages other sites will be able to pull up.
How to organize a package if you need several apps in it?
What other tricks are there for developing reusable-apps? I just came across getmodel. Are there any other goodies?
Answer the question
In order to leave comments, you need to log in
We actively use our own batteries for Django . Here is a typical structure of one:
scr - the root of the Python package (as for PyPi )
dvhb_docs - the battery itself
testproject - a minimal Django project for testing the battery Setup.py
example :
# -*- coding: utf-8 -*-
import os
from distutils.core import setup
__version__ = "0.1.0"
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
tests_require = [
'Django>=1.5',
'model-mommy',
'south',
'pyelasticsearch',
'elasticsearch',
'django-haystack>=2.1.0',
'djangorestframework',
'django-appconf',
'webtest',
'django-webtest',
'django-celery',
'django-mptt'
]
setup(
name='dvhb_docs',
version=__version__,
packages=['dvhb_docs'],
include_package_data=True,
license='private',
description='Django application for document store and management.',
long_description=README,
url='https://github.com/dvhb/dvhb_docs',
author='Vadim Lopatyuk',
author_email='[email protected]',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
install_requires=[
'Django>=1.5',
'south',
'pyelasticsearch',
'elasticsearch',
'django-haystack>=2.1.0',
'djangorestframework',
'django-appconf',
'django-celery',
'django-mptt'
],
)
{
…
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
}
}
from django.conf import settings
…
{
…
settings.AUTH_USER_MODEL.lower(): {
'Meta': {'object_name': settings.AUTH_USER_MODEL.split('.')[-1]},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question