Draft: Django application repository

just dumping ideas about the realization of a public application repository:

goals:

  • central Django application repository
  • integration with setuptools via django-admin.py
  • easy download and searchable

requirements:

  • file management (aka upload)
  • community features
  • style
  • application based (eat your own..)

future:

  • Paste hooks
  • SVN/Bazaar/.. hooks

implementation:

  1. standard setuptools procedures are used to register & upload the release of a django app to the Cheesshop
  2. uploaded files have all the same keyword “django.contrib”
  3. the homepage URL in the release.py of each django app is a sluggified url to the public repository entry (e.g. http://djangopackages.com/p/django-registration/)
  4. a standalone Django application scans periodically the Cheesshop and adds new applications with the keyword “django.contrib” to the repository database (can be cron, signals and/or something else) see: cheeseshop_import.py (cheeserater.com, thanks to Jakob)
  5. built with the common django-* application to provide standard community features (now on Google Code): django-registration
    django-openid
    django-voting or django-score-voting
    django-tagging
    django-utils
    django-contact-form
    typogrify
    cab (?)
    django-captcha (?)
    django-discussion (?)
    django-profile-images (?)
  6. needed models: Package, Owner

questions

  • would it make sense to wrap the register and upload process? (e.g. django-admin.py uploadapp)
  • encourage BestPracticesToWorkWith3rdPartyAppsAndMakingYoursPortable !/?
  • should dependencies be shown in the repository? are owners allowed to pick?
  • if needed, what is the best way to administrate the repository editorially?
Google Summer of Code Aug. 11, 2007, 2:30 p.m. comments (4)

django-package and beyond

I’m catching up right now with my Summer of Code project after some horrible exams and have now the time to read the very interesting discussions on the Django developers list.

First, as you may know I wrote some code which changes django.core.management (django-admin.py/manage.py) to ask for basic metadata as soon as the user creates a new django application with “startapp”. The metadata gets stored in a release.py for easy manipulation. A setup.py is also provided to use any functionality of the setuptools.

Unfortunately the problem isn’t just a matter of the actual process of packaging. As pointed out in the discussion about best practices and default application layouts it’s mere the problem of giving the not-so-pro-developers the chance to use pre-built applications without forgetting the needs of the pros.

One proposal was a better documentation of best practices to help beginners understand why “projects” are good to dive into django but are awkward when it comes to distribution and deployment. A great default application scheme was written by Sebastian Macias, even if it confused me a little at first because it imitates Python’s “site-packages”..

I’m sure some of you already have solutions for distribution/deployment because it is obligatory for high traffic sites (or is it?). Server arrangements are pretty cool too, but there must be more. Django applications should be treated like applications not like websites.

Anyway the fact remains: a standard system to manage Django-based modules is required, whether we call them apps, snippets, components, extensions or plugins (think of Wordpress). I proposed to use setuptools even if a lot of people seem to be annoyed about it (why exactly?).

Turbogears and Pylons are using Paste and Setuptools in combination to provide reusability and deployment - considering the different code structure and software strategy a smart decision. Django may need some own handlers to solve the different aspects of this whole topic. Why not rethink the way Django gets deployed?

UPDATE: You may be interested in reading this: Ian Bicking’s view on the failures of setuptools and python packaging. Well then.. so then just don’t do for Django either? Naah..

Google Summer of Code Aug. 2, 2007, 11:03 p.m. comments (1)

GSoC 2007 status update: Django package management

This week I continued to work on the

startapp
command of django.core.management and changed its default behaviour to create a standalone application (with skeleton files) when you run:
django- 
admin.py startapp myapp
. Current skeleton files are:
release.py, 
setup.py, MANIFEST.in, docs/, test/, myapp/, myapp/templates/myapp
. Are there any generic files/folders to add?

Besides editing release.py manually you can now edit the meta information by running inside an application dir:

django-admin.py 
editapp
. This also moves the app directory on a name change.

You can find a

ReleaseWrapper
dictionary object at
django.utils.package
which can be used to read and edit your release manually:

>> import os 
   >>> from django.utils.package import ReleaseWrapper, DEFAULT_DIRECTORIES, DEFAULT_FILES 
   >>> release = ReleaseWrapper(os.getcwd()) 
   >>> print (release.NAME, release.VERSION) 
   ('myapp', '0.1') 
   >>> release.previous_name = release.NAME 
   >>> release.NAME = "myapp2" 
   >>> release['VERSION'] = "0.2" 
   >>> release.update(os.getcwd(), DEFAULT_DIRECTORIES, DEFAULT_FILES)
   Moved: /Users/Jannis/Desktop/test_app/myapp to /Users/Jannis/Desktop/ 
   test_app/myapp2 
   Created: /Users/Jannis/Desktop/test_app/myapp2/templates/myapp2 
   Written: /Users/Jannis/Desktop/test_app/release.py 
   Written: /Users/Jannis/Desktop/test_app/setup.py 
   Written: /Users/Jannis/Desktop/test_app/MANIFEST.in
   

The application is ready to be used by setuptools, e.g. creating a zip- like “

egg
” file (
python setup.py bdist_egg
) which then can be distributed and installed with setuptools’
easy_install
command.

Creating a stripped down project-based application (

__init__.py, models.py, 
views.py
), which is currently recommended by the tutorials, run:
django-admin.py --noskeleton startapp mysimpleapp

Please have a look at http://code.google.com/p/django-package/ for further details, full installation instructions and of course the patch.

And please, tell me what you think :)

Google Summer of Code July 5, 2007, 1:04 p.m. comments (1)

1 2 3 4 5 6 7 8 9 10 11