add migration to update "Site" info
This commit is contained in:
12
procat2/migrations/0001_initial.py
Normal file
12
procat2/migrations/0001_initial.py
Normal file
@ -0,0 +1,12 @@
|
||||
# Change the initial site info
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
23
procat2/migrations/0002_site_changes.py
Normal file
23
procat2/migrations/0002_site_changes.py
Normal file
@ -0,0 +1,23 @@
|
||||
# Change the name and domain of the initial site
|
||||
|
||||
from django.db import migrations
|
||||
from django.contrib.sites.models import Site
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def update_site(apps, schema_editor):
|
||||
site = Site.objects.get(pk=1)
|
||||
site.name = settings.TREE_NAME
|
||||
site.domain = settings.PUBLIC_WEB_HOST
|
||||
site.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('procat2', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(update_site),
|
||||
]
|
||||
0
procat2/migrations/__init__.py
Normal file
0
procat2/migrations/__init__.py
Normal file
@ -73,6 +73,7 @@ INSTALLED_APPS = [
|
||||
'django_extensions',
|
||||
'account',
|
||||
'lazysignup',
|
||||
'procat2',
|
||||
'dashboard',
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user