mirror of
https://github.com/agresdominik/predictify.git
synced 2026-04-21 09:51:56 +00:00
Move .env file to config dir, change db path for improved project structure
* Change path of db and token to `data` which helps to sperate source code from data files like `tokens.json` & `spotify_scraped.db` * Change path of `.env` `src/env/` to `config/` for the same reason as mentioned above * Added the newly created files to `.gitigore` accordingly
This commit is contained in:
+2
-2
@@ -9,7 +9,7 @@ from urllib.parse import parse_qs, urlencode, urlparse
|
||||
import dotenv
|
||||
import requests
|
||||
|
||||
TOKEN_FILE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'env', 'tokens.json')
|
||||
TOKEN_FILE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../data', 'tokens.json')
|
||||
|
||||
|
||||
def simple_authenticate(grant_type: str = "client_credentials") -> str:
|
||||
@@ -102,7 +102,7 @@ def _read_env_file() -> tuple:
|
||||
:return: tuple
|
||||
"""
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
dotenv_folder_path = os.path.join(current_dir, 'env')
|
||||
dotenv_folder_path = os.path.join(current_dir, '../config')
|
||||
dotenv_path = os.path.join(dotenv_folder_path, '.env')
|
||||
contents = dotenv.dotenv_values(dotenv_path=dotenv_path)
|
||||
spotify_client_id = contents['SPOTIFY_CLIENT_ID']
|
||||
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
SPOTIFY_CLIENT_ID=your_token_here
|
||||
SPOTIFY_CLIENT_SECRET=your_token_here
|
||||
SPOTIFY_REDIRECT_URI=http://localhost:8888/callback
|
||||
+1
-1
@@ -3,7 +3,7 @@ import requests
|
||||
from auth import authenticate, simple_authenticate
|
||||
from database_handler import Database, Table
|
||||
|
||||
db = Database('spotify_scraped.db')
|
||||
db = Database('./data/spotify_scraped.db')
|
||||
|
||||
|
||||
def scraping():
|
||||
|
||||
Reference in New Issue
Block a user