Skip to content

Commit d38873a

Browse files
committed
Merge pull request #9 from smajda/master
Updates for local development
2 parents c6221d7 + 0b84c71 commit d38873a

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
pythonkc_site/pythonkc.sqlite
44
pythonkc_site/local_settings.py
55
pythonkc_site/private_settings.py
6+
pythonkc_site/.env

docs/local_development.rst

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Running PythonKC.com Locally
1010

1111
#. ``pip install -r requirements/project.txt``
1212

13-
#. ``python manage.py syncdb``
14-
1513
#. Create ``local_settings.py``, with::
1614

1715
DEBUG = TEMPLATE_DEBUG = True
@@ -20,23 +18,21 @@ Running PythonKC.com Locally
2018
# Otherwise, you probably want emails you test with to come to you:
2119
CONTACT_EMAIL_TO = ['me@gmail.com']
2220

23-
#. Create ``private_settings.py`` with:
21+
#. Create a `.env` file with:
2422

25-
#. Meetup.com API key::
23+
#!/bin/sh
24+
export MEETUP_API_KEY="<your meetup.com API key>"
2625

27-
MEETUP_API_KEY = "<your API key for meetup.com>"
26+
# if you're not using console.EmailBackend:
27+
export EMAIL_HOST_USER="<your email user>"
28+
export EMAIL_HOST_PASSWORD="<your email password>"
2829

29-
#. SMTP settings (if you kept the default email backend of SMTP above)::
30+
#. Source your .env file: ``source .env``.
3031

31-
# For example....
32-
EMAIL_HOST = "smtp.gmail.com"
33-
EMAIL_PORT = 587
34-
EMAIL_USE_TLS = True
35-
EMAIL_HOST_USER = "contact@pythonkc.com"
36-
EMAIL_HOST_PASSWORD = "*******************"
32+
#. ``python manage.py syncdb``
3733

3834
#. ``python manage.py runserver``
3935

4036
#. Profit!!!
4137

42-
Note that both ``local_settings.py`` and ``private_settings.py`` are in our ``.gitignore``, so you don't commit what you do there.
38+
Note that both ``local_settings.py`` and ``.env`` are in our ``.gitignore``, so you don't commit what you do there.

pythonkc_site/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@
163163
EMAIL_HOST = "smtp.gmail.com"
164164
EMAIL_PORT = 587
165165
EMAIL_USE_TLS = True
166-
EMAIL_HOST_USER = os.environ["EMAIL_HOST_USER"]
167-
EMAIL_HOST_PASSWORD = os.environ["EMAIL_HOST_PASSWORD"]
166+
EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER")
167+
EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD")
168168
MEETUP_API_KEY = os.environ["MEETUP_API_KEY"]
169169

170170
try:
@@ -174,7 +174,7 @@
174174

175175

176176
try:
177-
# NOTE The GONDOR_REDIS_* settings are placed in local_settings by the
177+
# NOTE The GONDOR_REDIS_* settings are placed in local_settings by the
178178
# Gondor runtime.
179179
CACHES = {
180180
'default': {

0 commit comments

Comments
 (0)