forked from stormzhang/9GAG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |