Skip to content

Commit 93ac49e

Browse files
Refactoring
1 parent ecf3986 commit 93ac49e

File tree

10 files changed

+68
-14
lines changed

10 files changed

+68
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Instant Articles
22

33
<p align="center">
4-
<img src="https://banners.beyondco.de/instant-article.png?theme=light&packageManager=pip+install&packageName=masonite-instant-article&pattern=topography&style=style_1&description=File management solution for Masonite&md=1&showWatermark=1&fontSize=100px&images=https%3A%2F%2Fgblobscdn.gitbook.com%2Fspaces%2F-L9uc-9XAlqhXkBwrLMA%2Favatar.png">
4+
<img src="https://banners.beyondco.de/Masonite%20Instant%20Article.png?theme=light&packageManager=pip+install&packageName=masonite-instant-article&pattern=charlieBrown&style=style_2&description=generate%20facebooks%20instant%20articles%20and%20feeds.&md=1&showWatermark=1&fontSize=100px&images=adjustments&widths=50&heights=50">
55
</p>
66

77
<p align="center">

config

Lines changed: 0 additions & 9 deletions
This file was deleted.

config/database.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
from masonite.environment import LoadEnvironment, env
2+
from masoniteorm.connections import ConnectionResolver
3+
4+
# Loads in the environment variables when this page is imported.
5+
LoadEnvironment()
6+
7+
"""
8+
The connections here don't determine the database but determine the "connection".
9+
They can be named whatever you want.
10+
"""
11+
DATABASES = {
12+
"default": env("DB_CONNECTION", "sqlite"),
13+
"sqlite": {
14+
"driver": "sqlite",
15+
"database": env("SQLITE_DB_DATABASE", "masonite.sqlite3"),
16+
"prefix": "",
17+
"log_queries": env("DB_LOG"),
18+
},
19+
"mysql": {
20+
"driver": "mysql",
21+
"host": env("DB_HOST"),
22+
"user": env("DB_USERNAME"),
23+
"password": env("DB_PASSWORD"),
24+
"database": env("DB_DATABASE"),
25+
"port": env("DB_PORT"),
26+
"prefix": "",
27+
"grammar": "mysql",
28+
"options": {
29+
"charset": "utf8mb4",
30+
},
31+
"log_queries": env("DB_LOG"),
32+
},
33+
"postgres": {
34+
"driver": "postgres",
35+
"host": env("DB_HOST"),
36+
"user": env("DB_USERNAME"),
37+
"password": env("DB_PASSWORD"),
38+
"database": env("DB_DATABASE"),
39+
"port": env("DB_PORT"),
40+
"prefix": "",
41+
"grammar": "postgres",
42+
"log_queries": env("DB_LOG"),
43+
},
44+
"mssql": {
45+
"driver": "mssql",
46+
"host": env("MSSQL_DATABASE_HOST"),
47+
"user": env("MSSQL_DATABASE_USER"),
48+
"password": env("MSSQL_DATABASE_PASSWORD"),
49+
"database": env("MSSQL_DATABASE_DATABASE"),
50+
"port": env("MSSQL_DATABASE_PORT"),
51+
"prefix": "",
52+
"log_queries": env("DB_LOG"),
53+
},
54+
}
55+
56+
DB = ConnectionResolver().set_connection_details(DATABASES)

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
masonite>=4,<5
22
masonite-orm>=2,<3
3+
black==22.3.0
4+
flake8==4.0.1

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Versions should comply with PEP440. For a discussion on single-sourcing
99
# the version across setup.py and the project code, see
1010
# https://packaging.python.org/en/latest/single_source_version.html
11-
version='0.0.7',
11+
version='0.0.8',
1212
packages=[
1313
'instant_article',
1414
'instant_article.config',
@@ -81,4 +81,4 @@
8181
package_data={
8282
'templates/index.html': [],
8383
},
84-
)
84+
)

src/instant_article/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# flake8: noqa F401
12
from .providers.instant_article_provider import InstantArticleProvider

src/instant_article/config/instant_article.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
| Masonite Instant Articles
66
|--------------------------------------------------------------------------
77
|
8-
| You can configure various routes for either rss feeds or instant articles depending upon your needs.
8+
| You can configure various routes for either rss feeds or
9+
| instant articles depending upon your needs.
910
|
1011
"""
1112

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# flake8: noqa F401
12
from .instant_article_provider import InstantArticleProvider
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# flake8: noqa F401
12
from .route import ROUTES

tests/integrations/config/instant_article.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
| Masonite Instant Articles
66
|--------------------------------------------------------------------------
77
|
8-
| You can configure various routes for either rss feeds or instant articles depending upon your needs.
8+
| You can configure various routes for either rss feeds or
9+
| instant articles depending upon your needs.
910
|
1011
"""
1112

0 commit comments

Comments
 (0)