diff --git a/docs/ubuntu.md b/docs/ubuntu.md index 7bf6dad3..646dd332 100644 --- a/docs/ubuntu.md +++ b/docs/ubuntu.md @@ -95,15 +95,6 @@ remember to rerun this command if you open a new terminal window.* umap runserver 0.0.0.0:8000 -## Add at least one license - -Go to [http://localhost:8000/admin/leaflet_storage/licence/add/](http://localhost:8000/admin/leaflet_storage/licence/add/) and create -a new Licence object. -For example: - -- name: `ODbL` -- URL: `http://opendatacommons.org/licenses/odbl/` - You can now go to [http://localhost:8000/](http://localhost:8000/) and try to create a map for testing. When you're done with testing, quit the demo server (type Ctrl-C). diff --git a/umap/migrations/0002_add_licence.py b/umap/migrations/0002_add_licence.py new file mode 100644 index 00000000..3edfb73d --- /dev/null +++ b/umap/migrations/0002_add_licence.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.3 on 2016-11-26 16:11 +from __future__ import unicode_literals + +from django.db import migrations + + +def add_licence(apps, *args): + Licence = apps.get_model('leaflet_storage', 'Licence') + if Licence.objects.count(): + return + Licence( + name='ODbL', + details='http://opendatacommons.org/licenses/odbl/').save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('umap', '0001_add_tilelayer'), + ] + + operations = [ + migrations.RunPython(add_licence), + ]