[Django]-Django "TypeError: an integer is required" on form.save

4πŸ‘

βœ…

In your settings.py script, you have this line:

FILE_UPLOAD_PERMISSIONS '0760'

It should not have quotes around it. You are trying to call os.chmod() with a string as the second argument when it expects an integer. Specifically, the octal permissions value. In python, numbers with a leading 0 are automatically considered to be octal values and are converted to integers. So, just use this line instead:

FILE_UPLOAD_PERMISSIONS = 0760

By the way, why aren’t you using equals signs in your settings.py?

πŸ‘€C0deH4cker

0πŸ‘

Updated Solution to the above problem isjust add this snippet in your settings.py file.

FILE_UPLOAD_PERMISSIONS = 0o760

Keep it in mind that you have to use o .

πŸ‘€marxmit7

Leave a comment