Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

Place a file in an object from command-line (Python 3.x only)

You can place this snippet in management/commands/ and have it upload files from disk into objects in your database.

Usage: python manage.py upload_file_to_model myapp mymodel myfield 1 field_name /some/file/path

Don't be the product, buy the product!