I am in the process of converting a Webapp2 app to Django on Google App Engine. Everything is relatively straightforward, and the models have been converted from the webapp models to the django equivalents.
However, I feel this may be have been glossed over in the posts from the app engine team Refering This... Do I need to perform a data migration in order to re-use existing data, or can I simply use the existing NDB models somehow? (If so, what configurations are needed? I can't seem to figure this out).
After looking into this a little further, I noticed that by default GAE would create db_tables with the default names as <app_label>_<model_name>
(i.e. coreapp_GuestBook).
As a result, if you specify the model meta options in Django, matching the converted apps name with the original apps name, you will be able to access the same models with Django. Note that the field values may be inaccessible or possible corrupted if you did not do the conversion of webapp fields to the appropriate Django fields one for one.
See reference: https://cloud.google.com/appengine/articles/django-nonrel
For example, in my case, the Article
app would be retrieved by specifying:
class Article(models.Model):
title = models.CharField(max_length=255)
class Meta:
db_table = 'Article'
verbose_name = 'Article'
verbose_name_plural = 'Articles'