Q:

How to make syncdb work automatically in Django?

When I have a view that helps in uploading of a file , I want it to be stored in the database , which is only possible if I run syncdb . But , till now I know how to run python manage.py syncdb at the python command line . How do I make it run automatically when I upload some data ? 

A:

A little bit hacky way: 
import sys
sys.argv.append('syncdb')

from django.core.management import execute_manager
import settings # Your project's settings. Assumed to be in the same directory. 

execute_manager(settings)    

