Skip to content

Instantly share code, notes, and snippets.

@wynemo
Created November 27, 2018 02:58
Show Gist options
  • Save wynemo/a7fef93ae81b995c0da8f635551b28c5 to your computer and use it in GitHub Desktop.
Save wynemo/a7fef93ae81b995c0da8f635551b28c5 to your computer and use it in GitHub Desktop.
django admin hello world
~/miniconda2/envs/py2k/bin/django-admin startproject mytrans
zdbdeMacBook-Air:hashlong zdb$ cd mytrans/
zdbdeMacBook-Air:mytrans zdb$ ls
manage.py mytrans
~/miniconda2/envs/py2k/bin/python manage.py startapp polls
~/miniconda2/envs/py2k/bin/python manage.py runserver
~/miniconda2/envs/py2k/bin/python manage.py migrate
zdbdeMacBook-Air:mytrans zdb$ cat polls/models.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class MyDict(models.Model):
hanzi_text = models.CharField(max_length=200)
esperanto_text = models.CharField(max_length=200)
modified_date = models.DateTimeField('date modified')
cat Mytrans/settings.py
INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
~/miniconda2/envs/py2k/bin/python manage.py makemigrations polls
~/miniconda2/envs/py2k/bin/python manage.py migrate
~/miniconda2/envs/py2k/bin/python manage.py createsuperuser
Admin/django+1s
~/miniconda2/envs/py2k/bin/python manage.py runserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment