Users could use SQLite instead of MySQL

This commit is contained in:
Zhuoyun Wei 2016-08-12 16:15:38 +08:00
parent 68dc4f4148
commit 635cc8c3b3
3 changed files with 8 additions and 4 deletions

View File

@ -37,11 +37,15 @@ This will enable API access in PowerDNS so PowerDNS-Admin can intergrate with Po
### Create Database
We will create a database which used by this web application. Please note that this database is difference from pdns database itself.
You could use any database that SQLAlchemy supports. For example MySQL (you will need to `pip install MySQL-python` to use MySQL backend):
```
MariaDB [(none)]> CREATE DATABASE powerdnsadmin;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON powerdnsadmin.* TO powerdnsadmin@'%' IDENTIFIED BY 'your-password';
```
For testing purpose, you could also use SQLite as backend. This way you do not have to install `MySQL-python` dependency.
### PowerDNS-Admin

View File

@ -19,7 +19,8 @@ LOG_FILE = 'logfile.log'
UPLOAD_DIR = os.path.join(basedir, 'upload')
# DATABASE CONFIG
SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@192.168.59.103/pdns'
SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@192.168.59.103/pdns' # You'll need MySQL-python
#SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/your/pdns.db'
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SQLALCHEMY_TRACK_MODIFICATIONS = True

View File

@ -2,7 +2,6 @@ Flask>=0.10
Flask-WTF>=0.11
Flask-Login>=0.2.11
configobj==5.0.5
MySQL-python==1.2.5
py-bcrypt==0.4
requests==2.7.0
python-ldap==2.4.21