Skip to content

Commit be7f13b

Browse files
author
vagrant
committed
Move settings out of src/__init__.py
1 parent 77aa771 commit be7f13b

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

src/__init__.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1-
# -*- coding: utf-8 -*-
2-
3-
41
"""
52
nycpython.src
63
~~~~~~~~~~~~~
74
85
Main project
96
107
"""
11-
12-
13-
import os
14-
15-
16-
MEETUP_API_KEY = os.environ.get('MEETUP_API_KEY')
17-
18-
19-
GROUP_ID = 263790 # That the NYCPython Meetup Group ID
20-
21-
22-
GROUP_URL = 'http://www.meetup.com/nycpython/'

src/core/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
SECRET_KEY = b'\x7f\xebt.Y\xea\xd5\x19"\x1ftu5\x9d\xaa.FD\xac5\xbc\x86\xe7c=\xc5_\xfe\xf5\x96\x1eH' # NOQA
88

9+
MEETUP_API_KEY = os.environ.get('MEETUP_API_KEY')
10+
GROUP_ID = 263790 # The NYCPython Meetup Group ID
11+
GROUP_URL = 'http://www.meetup.com/nycpython/'
12+
913
SQLALCHEMY_DATABASE_URI = \
1014
'postgresql://nycpython:nycpython@localhost:5432/nycpython'
1115
TEMPLATE_FOLDER = os.path.join(PROJECT_ROOT, 'templates')

src/services/meetup/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
import requests
1616

17-
from src import MEETUP_API_KEY
17+
from core.app import app
18+
MEETUP_API_KEY = app.config['MEETUP_API_KEY']
1819

1920

2021
class MeetupAPIError(Exception):

src/services/meetup/events.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212

1313
from datetime import datetime
1414

15-
from src import GROUP_ID, GROUP_URL
16-
from src.services.meetup import MeetupAPIRequest
15+
from core.app import app
16+
GROUP_ID = app.config['GROUP_ID']
17+
GROUP_URL = app.config['GROUP_URL']
18+
from services.meetup import MeetupAPIRequest
1719

1820

1921
RECURRING_TAG = '#recurring'

0 commit comments

Comments
 (0)