[Solved]-Is it possible to stop Django from creating .pyc files, whilst in development?

10👍

You can use this, where applicable:

import sys

sys.dont_write_bytecode = True

9👍

You can try setting the PYTHONDONTWRITEBYTECODE environment variable:

PYTHONDONTWRITEBYTECODE

If this is set, Python won’t try to write .pyc or .pyo files on the import of source modules.

New in version 2.6.

4👍

Very late reply but I got here after Googling. You can try this:

python -B manage.py [any other commands/options]

For example:

python -B manage.py sql yourapp

However, this doesn’t work for some reason:

python -B manage.py runserver 0.0.0.0:5000

2👍

Edit your dispatcher, so the hashbang reads:

#!/usr/bin/env python -B

Leave a comment