How to do an initial south migration for a plugin

46 views
Skip to first unread message

Fanthomas90

unread,
Feb 22, 2013, 3:00:28 PM2/22/13
to djang...@googlegroups.com
Hi!
First of all: great project!
Never the less I have some issues getting my own plugin working. I want to combine the wiki with a forum on a "per-article" basis.
I therefore need to create some models which form a basis of my plugin (i attached it)

So now I was trying to create the initial migration in south (python manage.py schemamigration campusshare.forum --initial), but it just created an empty migration (attached as well).

Does anybody know why this is happening?

My plugin is located campusshare/forum and the settings file calls the app campusshare and the slug forum.

Cheers,
Fanthomas
models.py
0001_initial.py

Benjamin Bach

unread,
Feb 22, 2013, 5:38:23 PM2/22/13
to Fanthomas90, djang...@googlegroups.com
Hi Fanthomas!

Thanks, I love your blog as well :)

It's Meta.app_label that's causing this. Remove it, and it'll work. I tested to be sure, and it's still related to a wiki.models.SimplePlugin instance.

From the Django docs:

Options.app_label
If a model exists outside of the standard models.py (for instance, if the app’s models are in submodules of myapp.models), the model must define which app it is part of

What they do not write, however, is that it *has* to be a submodule, so app_label is only relevant for the core plugins.

I'll add a note in models.pluginbase!

- Ben

--
You received this message because you are subscribed to the Google Groups "django-wiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-wiki...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Fanthomas90

unread,
Feb 22, 2013, 5:56:16 PM2/22/13
to djang...@googlegroups.com, Fanthomas90
Thanks a lot!
Now everything works :)

Jan Lána

unread,
Aug 30, 2017, 2:52:19 PM8/30/17
to django-wiki, tomlot...@gmail.com
Hi!

I created test plugin in src/wiki/plugins/inputs with a few modes. How to create migrations?

testproject/manage.py makemigrations --pythonpath=src wiki.plugins.inputs

says "App 'wiki.plugins.inputs' could not be found. Is it in INSTALLED_APPS?"

but I have the wiki.plugins.inputs in the testproject INSTALLED_APPS and it works (worked... until I add the models)

What I am missing there?

- jenda

Jan Lána

unread,
Aug 30, 2017, 2:59:23 PM8/30/17
to django-wiki, tomlot...@gmail.com
I found answer: instead of wiki.plugins.inputs I have to use the the SLUG name from src/wiki/plugins/inputs/settings.py, i.e

testproject/manage.py makemigrations --pythonpath=src inputs

in my case.
Reply all
Reply to author
Forward
0 new messages