月度归档:2018年03月

HTML转markdown工具比较

Html2MarkDown - aTool在线工具

一款html和markdown标签互转的工具,直接输入Html,网页会自动帮你转换。

HTML2Markdown

Javascript Implementation for converting HTML to Markdown text.

html2markdown

Javascript implementation for converting HTML to Markdown text. Browser and Node.js support.

Turndown

Convert HTML into Markdown with JavaScript.

Python 新轮子 Tomd: HTML 转 Markdown 工具库

用途: 爬虫爬文章保存到本地为 Markdown 格式

LCTT选题工具

将内容复制到左侧输入框内,点击生成MD,在中部编辑器处进行二次修改,并在右侧的预览框中查看效果。 确认无误后点击上方的复制代码按钮即可将代码复制到剪贴板中!

html-to-markdown

An HTML-to-markdown conversion helper for PHP

Markdown Navigator 2.0

Markdown language support for IntelliJ platform

django2 + uwsgi + nginx

安装uwsgi模块

pip install uwsgi

测试uwsgi服务

uwsgi --http 0.0.0.0:8080 --file project/wsgi.py --static-map=/static=static

配置uwsgi.ini

# uwsig使用配置文件启动
[uwsgi]
# 项目目录
chdir=/data/pyproject/zc1024
# 指定项目的application
module=zc1024.wsgi:application
# 指定sock的文件路径
socket=/data/pyproject/zc1024/tmp/uwsgi.sock
# 进程个数
workers=4
pidfile=/data/pyproject/zc1024/tmp/uwsgi.pid
# 指定IP端口
http=127.0.0.1:8080
# 指定静态文件
static-map=/static=/data/pyproject/zc1024/static
# 启动uwsgi的用户名和用户组
uid=ning
gid=ning
# 启用主进程
master=true
# 自动移除unix Socket和pid文件当服务停止的时候
vacuum=true
# 序列化接受的内容,如果可能的话
thunder-lock=true
# 启用线程
enable-threads=true
# 设置自中断时间
harakiri=30
# 设置缓冲
post-buffering=4096
# 设置日志目录
daemonize=/data/pyproject/zc1024/tmp/uwsgi.log

运行配置

uwsgi --ini uwsgi.ini

配置nginx

 # 指定项目路径uwsgi
location / { # 这个location就和咱们Django的url(r'^admin/', admin.site.urls),
include uwsgi_params; # 导入一个Nginx模块他是用来和uWSGI进行通讯的
uwsgi_connect_timeout 30; # 设置连接uWSGI超时时间
uwsgi_pass unix:/data/pyproject/zc1024/tmp/uwsgi.sock; # 指定uwsgi的sock文件所有动态请求就会直接丢给他
}

# 指定静态文件路径
location /static/ {
alias /data/pyproject/zc1024/static/;
index index.html index.htm;
}

重新加载nginx配置

nginx -s reload

CentOS7通过yum安装PostgreSQL10

发现最新的postgresql版本

https://www.postgresql.org/download/linux/redhat/

下载

yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm

安装

yum install postgresql10-server

设置数据目录

创建数据目录并修改权限

mkdir -p /data/postgresql/
chown postgres:postgres /data/postgresql/

复制开机启动文件

sudo cp /usr/lib/systemd/system/postgresql-10.service /etc/systemd/system/

修改开机启动文件

vim /etc/systemd/system/postgresql-10.service

找到

Environment=PGDATA=/var/lib/pgsql/10/data/

修改为

Environment=PGDATA=/data/postgresql/

初始化数据库

/usr/pgsql-10/bin/postgresql-10-setup initdb

开机自启动

systemctl enable postgresql-10
systemctl start postgresql-10
systemctl status postgresql-10

修改本地帐户权限

vim /data/postgresql/pg_hba.conf

host    all             all             127.0.0.1/32            ident

修改为

host    all             all             127.0.0.1/32            md5

重新加载配置

systemctl restart postgresql-10

新增用户和数据库

su - postgres
createuser dbuser
createdb -e -O dbuser dbname

设定密码

su - postgres
psql
\password dbuser (输入两次密码)

新用户登录数据库

psql -U dbuser -d dbname -h 127.0.0.1 (输入之前的密码)

允许非本机ip登录

  • 编辑data/postgresql.conf修改listen_addresses = 'localhost'listen_addresses = 'localhost'
  • 编辑data/pg_hba.conf

    host all all 192.168.1.0/24 md5

Django CMS比较

Mezzanine

Mezzanine is a powerful, consistent, and flexible content management platform. Built using the Django framework, Mezzanine provides a simple yet highly extensible architecture that encourages diving in and hacking on the code. Mezzanine is BSD licensed and supported by a diverse and active community.

In some ways, Mezzanine resembles tools such as WordPress, providing an intuitive interface for managing pages, blog posts, form data, store products, and other types of content. But Mezzanine is also different. Unlike many other platforms that make extensive use of modules or reusable applications, Mezzanine provides most of its functionality by default. This approach yields a more integrated and efficient platform.

Django Fiber

Django Fiber - a simple, open-source, user-friendly CMS for all your django projects. It complements your project, it doesn't take it over. It allows you to create simple textual, template based pages, add simple content items in pages and views, and adds simple menus that always work. All this can be maintained by a friendly frontend admin.

django CMS

Enterprise content management with django

Django-Fluent

A smooth, flexible CMS to create the designs you like, built on top of the powerful Django framework.

Django-Fluent CMS is a Open Source CMS, designed for the following needs:

  • Shape the CMS according to the client's needs.
  • Make any kind of design editable for end-users.
  • Be easy to use
  • Be easy to code with -Be usable for small up to large sites

The CMS is flexible for your own needs. You can install parts of the CMS you like to use, and leave everything else out of your project. The system is designed to perform well (blocks are cached in memcache), models and admin screens can be modified to your needs easily.

FeinCMS

One of the most advanced Content Management Systems built on Django

Wagtail

There are plenty of great open source content management systems. We've used Drupal very successfully on big sites for clients including high profile campaigning NGOs, fundraising charities, think tanks, universities and public sector organisations. There are also some excellent Django CMSs, including Mezzanine, Fein and Django CMS, with thriving developer communities and impressive case studies.

But having built content-managed websites for 14 years we have strong opinions about the editor experience and how a CMS should work and be structured, and we need to manage a more rapid pace of development than we can achieve by contributing to existing projects.