Code

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#18206 closed New feature (wontfix)

Disable bytecode in manage.py 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

Description

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/manage.py and will not affect production deployments of Django applications.

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by anonymous

comment:1 Changed 2 years ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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 2 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 :-)

Cheers.

comment:3 Changed 2 years ago by aaugustin

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.