Skip to content

Commit

Permalink
setting site name and admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonimdo committed Aug 20, 2016
1 parent a399362 commit 887e465
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions server/management/management/commands/populate.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
from django.contrib.auth.models import User
from django.core.management import BaseCommand
from django.contrib.sites.models import Site
# from emessages import console as emc
# from tips import console as tc


class Command(BaseCommand):
@staticmethod
def populate():
# setting the admin user
print("setting the admin user.")
user = User.objects.create_superuser(
username="root",
email='root@example.com',
username="admin",
email='admin@gistx.com',
password='123456789')
user.full_clean()
user.save()
# example of using the apps in our django
# emc.save_emessages(emc.get_wiki_http_errors())
# tc.save_tips(tc.load_tips_from_dlsv())


# setting the site name
print("setting the site name.")
site = Site.objects.all()[0]
site.domain = 'gistx.com'
site.name = 'WIP'
site.save()

# TODO: create a soical app
print("create a soical app (url in README file).")


def handle(self, *args, **options):
self.populate()

0 comments on commit 887e465

Please sign in to comment.