In my app I need a module that will synchronize database periodically (eg. every 24h) trough xml on remote server.
What is the best option to do so - should I write separate app or create custom django command?
In my app I need a module that will synchronize database periodically (eg. every 24h) trough xml on remote server.
What is the best option to do so - should I write separate app or create custom django command?
You can actually do:
POST
ed with appropriate file, would call the django command withInMemoryUploadedFile
object.Take note that the second part would fit in scenarios where the file's is small as the memory wouldn't be returned to OS (yet it would be free for Python to use).
Wrap those two into an app for logical separation and you are golden. If you are going just for the django command - a separate app might be too much. I'd suggest putting the command into your main app in that case.