Skip to content
Browse files

Allow psycopg2 or sqlite3 to not be installed

  • Loading branch information...
1 parent ec34a9a commit 5c5d6933e383748a99cdf5e092076a61884feebb @coleifer committed Feb 11, 2011
Showing with 13 additions and 2 deletions.
  1. +13 −2 peewee.py
View
15 peewee.py
@@ -10,11 +10,22 @@
from datetime import datetime
import logging
import os
-import psycopg2
import re
-import sqlite3
import time
+try:
+ import sqlite3
+except ImportError:
+ sqlite3 = None
+
+try:
+ import psycopg2
+except ImportError:
+ psycopg2 = None
+
+if sqlite3 is None and psycopg2 is None:
+ raise ImproperlyConfigured('Either sqlite3 or psycopg2 must be installed')
+
DATABASE_NAME = os.environ.get('PEEWEE_DATABASE', 'peewee.db')
logger = logging.getLogger('peewee.logger')

0 comments on commit 5c5d693

Please sign in to comment.
Something went wrong with that request. Please try again.