diff --git a/README.md b/README.md index 301fcca..da4fd72 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Instant Articles

- +

diff --git a/config b/config deleted file mode 100644 index 2153059..0000000 --- a/config +++ /dev/null @@ -1,9 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = https://github.com/yubarajshrestha/masonite-filemanager.git - fetch = +refs/heads/*:refs/remotes/origin/* diff --git a/config/database.py b/config/database.py new file mode 100644 index 0000000..091d99f --- /dev/null +++ b/config/database.py @@ -0,0 +1,56 @@ +from masonite.environment import LoadEnvironment, env +from masoniteorm.connections import ConnectionResolver + +# Loads in the environment variables when this page is imported. +LoadEnvironment() + +""" +The connections here don't determine the database but determine the "connection". +They can be named whatever you want. +""" +DATABASES = { + "default": env("DB_CONNECTION", "sqlite"), + "sqlite": { + "driver": "sqlite", + "database": env("SQLITE_DB_DATABASE", "masonite.sqlite3"), + "prefix": "", + "log_queries": env("DB_LOG"), + }, + "mysql": { + "driver": "mysql", + "host": env("DB_HOST"), + "user": env("DB_USERNAME"), + "password": env("DB_PASSWORD"), + "database": env("DB_DATABASE"), + "port": env("DB_PORT"), + "prefix": "", + "grammar": "mysql", + "options": { + "charset": "utf8mb4", + }, + "log_queries": env("DB_LOG"), + }, + "postgres": { + "driver": "postgres", + "host": env("DB_HOST"), + "user": env("DB_USERNAME"), + "password": env("DB_PASSWORD"), + "database": env("DB_DATABASE"), + "port": env("DB_PORT"), + "prefix": "", + "grammar": "postgres", + "log_queries": env("DB_LOG"), + }, + "mssql": { + "driver": "mssql", + "host": env("MSSQL_DATABASE_HOST"), + "user": env("MSSQL_DATABASE_USER"), + "password": env("MSSQL_DATABASE_PASSWORD"), + "database": env("MSSQL_DATABASE_DATABASE"), + "port": env("MSSQL_DATABASE_PORT"), + "prefix": "", + "log_queries": env("DB_LOG"), + }, +} + +DB = ConnectionResolver().set_connection_details(DATABASES) diff --git a/requirements.txt b/requirements.txt index 0b97a80..7e7c104 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ masonite>=4,<5 masonite-orm>=2,<3 +black==22.3.0 +flake8==4.0.1 diff --git a/setup.py b/setup.py index ef599dd..37e2b78 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.0.7', + version='0.0.8', packages=[ 'instant_article', 'instant_article.config', @@ -81,4 +81,4 @@ package_data={ 'templates/index.html': [], }, -) \ No newline at end of file +) diff --git a/src/instant_article/__init__.py b/src/instant_article/__init__.py index 3d0bba8..a6c49ea 100644 --- a/src/instant_article/__init__.py +++ b/src/instant_article/__init__.py @@ -1 +1,2 @@ +# flake8: noqa F401 from .providers.instant_article_provider import InstantArticleProvider diff --git a/src/instant_article/config/instant_article.py b/src/instant_article/config/instant_article.py index 446129e..804c953 100644 --- a/src/instant_article/config/instant_article.py +++ b/src/instant_article/config/instant_article.py @@ -5,7 +5,8 @@ | Masonite Instant Articles |-------------------------------------------------------------------------- | -| You can configure various routes for either rss feeds or instant articles depending upon your needs. +| You can configure various routes for either rss feeds or +| instant articles depending upon your needs. | """ diff --git a/src/instant_article/providers/__init__.py b/src/instant_article/providers/__init__.py index 2039aa4..3d1dc13 100644 --- a/src/instant_article/providers/__init__.py +++ b/src/instant_article/providers/__init__.py @@ -1 +1,2 @@ +# flake8: noqa F401 from .instant_article_provider import InstantArticleProvider diff --git a/src/instant_article/routes/__init__.py b/src/instant_article/routes/__init__.py index eac3194..53b6fbf 100644 --- a/src/instant_article/routes/__init__.py +++ b/src/instant_article/routes/__init__.py @@ -1 +1,2 @@ +# flake8: noqa F401 from .route import ROUTES diff --git a/tests/integrations/config/instant_article.py b/tests/integrations/config/instant_article.py index 446129e..804c953 100644 --- a/tests/integrations/config/instant_article.py +++ b/tests/integrations/config/instant_article.py @@ -5,7 +5,8 @@ | Masonite Instant Articles |-------------------------------------------------------------------------- | -| You can configure various routes for either rss feeds or instant articles depending upon your needs. +| You can configure various routes for either rss feeds or +| instant articles depending upon your needs. | """