#596 closed Bug (wontfix)
Allow Django to be packaged as a Python egg
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | bhuztez@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
This patch allows Django to be packaged as a Python egg file. This means that you can download the Django source and build an egg file with "python setup.py bdist_egg", and that egg contains all of Django and can be dropped onto sys.path and used like other eggs. In particular, this makes it easier to use Django when you don't want to install it into your Python directory (either with "setup.py install" or with a symlink).
This patch incorporates some code from ticket #582.
Attachments (7)
Change History (32)
comment:1 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:3 by , 19 years ago
Status: | new → assigned |
---|
by , 19 years ago
Attachment: | django_as_egg_2.patch added |
---|
comment:4 by , 19 years ago
Changed the patch so that it doesn't break every existing Django project. :-) Using an egg-based Django will require editing of settings/admin.py to make ADMIN_TEMPLATE_PATH be a path that includes the .egg file. Create a new project with an egg-based Django and examine settings/admin.py to see what is meant here.
This patch could do with some testing.
comment:5 by , 19 years ago
Stuart (or somebody else) -- When you use Django as an egg, how do you access django-admin.py?
comment:6 by , 19 years ago
milestone: | → Version 1.0 |
---|
comment:7 by , 19 years ago
You have to copy django-admin.py out of the egg. I haven't come up with a good solution to this yet :( The TurboGears people have setuptools *create* their tg-admin.py, which might be an acceptable solution.
comment:9 by , 19 years ago
comment:10 by , 19 years ago
At this point, all we need to do is apply the patches to django/core/servers/basehttp.py and django/core/management.py.
comment:11 by , 19 years ago
What still would be open (after the i18n merge) would be handling of the .po/.mo files. Currently they are expected only in the filesystem (either application, project or django-wide), not in eggs. Since I don't have an egged environment for python running, it would be better if somebody who knows eggs could look into that. The problem is that gettext.find() searches for translations and I don't think that it will take eggs into consideration (and the behaviour of gettext.find itself isn't driven by something subclasseable, at least not IIRC).
Maybe the egg patching could wait until after the i18n merge, so that we have some time to check into this and provide a patch?
comment:12 by , 18 years ago
Component: | Core framework → Admin interface |
---|---|
milestone: | Version 1.0 → Version 0.91 |
priority: | normal → highest |
Severity: | normal → trivial |
Type: | enhancement → defect |
Version: | → 0.91 |
comment:13 by , 18 years ago
priority: | highest → normal |
---|---|
Severity: | trivial → normal |
Type: | defect → enhancement |
comment:16 by , 18 years ago
Component: | Admin interface → Core framework |
---|---|
Has patch: | set |
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
comment:17 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Django dropped setuptools support (for Django itself) some time ago due to maintenance headaches; marking wontfix because of that.
comment:20 by , 17 years ago
Please ask support questions on the mailing list, rather than in Trac. Thanks.
comment:21 by , 13 years ago
Easy pickings: | unset |
---|---|
Needs documentation: | set |
Resolution: | wontfix |
Severity: | normal → Normal |
Status: | closed → reopened |
Type: | enhancement → Bug |
UI/UX: | unset |
Version: | 0.91 → SVN |
add support for PEP 302 importers should fix this.
some related tickets #294 #8238 #8280 #12206 #13334 #13587 #14087 #16718 #17331
I will move zip_egg_fixed patch here from #14087 and add PEP 302 importers support to the following components
- templates
- fixtures
- static files
- translations
- django.db.utils.load_backend
comment:22 by , 13 years ago
I am going to separate patch into three, because they are three different problems.
- Django will try not to import any app when finding management commands, thus we have to make assumption on (pseudo-)filesystem layout on app modules.
- Django will import app before finding templates, fixtures, static files and locale files, and will skip some of the apps if a specific directory under app path does not exist.
django.db.utils.load_backend will be maintained under #8238. management commands from PEP-302 importers will be under #8280. Others will be remained here.
comment:23 by , 13 years ago
Cc: | added |
---|
the resource-pep-302 patch focus on loading resources from apps imported by PEP-302 importers
follow-up: 25 comment:24 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
Please don't reopen tickets that have been closed for years by core developers. Adding support for PEP 302 import hooks is only slightly related to egg files which to be honest are a no go for me too. Feel free to open a discussion about that on the developer mailing list if you haven't already.
comment:25 by , 13 years ago
Replying to jezdez:
Please don't reopen tickets that have been closed for years by core developers.
I will leaved it closed.
Feel free to open a discussion about that on the developer mailing list if you haven't already.
I did. But got no response unfortunately.
Better patch: ignore previous one