Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#18206 closed New feature (wontfix)

Disable bytecode in by default to avoid project clutter.

Reported by: anonymous Owned by: nobody
Component: Uncategorized Version: 1.4
Severity: Normal Keywords: bytecode
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Python's default setting is to have bytecode enabled (for very good reason) however this results in Django projects being littered with .pyc files if this is not turned off. The performance improvements from allowing bytecode in development are minimal and IMO the disadvantages (clutter, confusion for new users, having to set these as ignored in git/svn/etc), whilst minor, outweigh the advantages - especially as it's such an easy issue to fix.

It is a simple, one-line fix to django/conf/project_template/ and will not affect production deployments of Django applications.

Attachments (1)

bytecode.patch (421 bytes) - added by anonymous 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by anonymous

Attachment: bytecode.patch added

comment:1 Changed 7 years ago by Claude Paroz

Resolution: wontfix
Status: newclosed

This can be turned on or off with -B parameter or PYTHONDONTWRITEBYTECODE environment variable. I don't feel like hard-coding this like you are proposing, sorry.

comment:2 Changed 7 years ago by anonymous

Hi Claudep,

Fair enough. I will say one more thing on the matter though - whilst this can be done, it's another thing to do, and people new to the framework/language won't necessarily do it as they may be unaware. IMO it can hinder productivity.

Still, your choice. I'll continue to add it myself :-)


comment:3 Changed 7 years ago by Aymeric Augustin

FWIW I agree with Claude -- if Django's defaults diverged from Python's, most people would consider that a bug.

Note: See TracTickets for help on using tickets.
Back to Top