第8月第21天 django lbforum项目记录

时间:2022-07-11 14:35:08

1.

  django-admin.py startproject lbforum01
ls
cd lbforum01/
ls
python manage.py startapp forum
sudo pip install lbforum
ls
python manage.py bower install
python manage.py bower migrate sudo pip install django-bower sudo pip install postmarkup
python manage.py runserver
python manage.py makemigrations
python manage.py migrate
python manage.py runserver

https://github.com/vicalloy/LBForum

install

  • Clone LBForum repository from git://github.com/vicalloy/lbforum-site.git
  • use source env.rc to start lbforum environment.
  • $mg is a shortcut for "python manage.py "
  • $mg migrate
  • $mg createsuperuser
  • $mg bower install
  • $mg runserver

django 1.10.0出错

try changing the MIDDLEWARE_CLASSES

MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
]
https://*.com/questions/37914645/custom-settings-and-wsgi-in-django-1-10-give-me-error

mysql

pip install MySQL-python

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'lbforum',
'USER': 'root',
'PASSWORD': '',
'HOST': '127.0.0.1',
# 'HOST': '139.199.133.195',
'PORT': '3306',
'OPTIONS':{'init_command':'SET storage_engine=INNODB;'},
}
}

  

初始化数据

add categories

add forum

2.

http://www.cnblogs.com/esperyong/archive/2012/12/20/2826690.html

https://docs.djangoproject.com/en/1.11/topics/auth/customizing/

http://python.usyiyi.cn/django/index.html

http://blog.chinaunix.net/uid/21633169/abstract/3.html

http://zhongwei-leg.iteye.com/blog/658435

3.django 001

http://www.cnblogs.com/chenchao1990/p/5311531.html

4.进入127.0.0.1/admin

http://www.cnblogs.com/kongzhagen/p/6679365.html