From 168e19acac396433fa92b4b7b77950407862d24b Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sat, 26 Nov 2011 18:09:17 -0600 Subject: [PATCH 01/49] Upgraded to pythonkc-meetups 0.0.6 --- pythonkc_site/requirements/project.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 2efc7bd..9d444af 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -2,5 +2,5 @@ Django==1.3.1 gondor==1.0 psycopg2==2.4.2 South==0.7.3 -pythonkc-meetups==0.0.5 +pythonkc-meetups==0.0.6 django-redis-cache==0.9.2 From b260315bad15a1d0e325c0e5f236e2a184cf89fe Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Fri, 8 Jun 2012 20:42:27 -0500 Subject: [PATCH 02/49] Style past-events with no photo to take up full width of slider * When there's no photo, add no-photo class to past-event article * Style past-event details to take up full width when there is no photo --- pythonkc_site/static/screen.css | 3 +++ pythonkc_site/templates/index.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pythonkc_site/static/screen.css b/pythonkc_site/static/screen.css index 3ea2e68..49f0209 100644 --- a/pythonkc_site/static/screen.css +++ b/pythonkc_site/static/screen.css @@ -125,6 +125,9 @@ h3{ width: 400px; float: left; } +.past-event.no-photo .details { + width: 910px; +} .past-event .event-photo { float: left; width: 500px; diff --git a/pythonkc_site/templates/index.html b/pythonkc_site/templates/index.html index 2cba288..552e1a1 100644 --- a/pythonkc_site/templates/index.html +++ b/pythonkc_site/templates/index.html @@ -53,7 +53,7 @@

Past Events

{% for event in past_events %} -
+

From 5c2dd88d8518ff1828ec367afff8e52d161e4d29 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Fri, 8 Jun 2012 20:45:56 -0500 Subject: [PATCH 03/49] Fix GitHub ForkMe banner I guess the originally supported locations went away :/ Not very cool URLs then... --- pythonkc_site/templates/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pythonkc_site/templates/index.html b/pythonkc_site/templates/index.html index 552e1a1..c7a5b08 100644 --- a/pythonkc_site/templates/index.html +++ b/pythonkc_site/templates/index.html @@ -14,8 +14,7 @@
- - Fork me on GitHub + Fork me on GitHub {% if request.GET.contact_sent == 'yes' %} Thanks for dropping us a note! We look forward to getting in touch From eaf4954b3a06c88aee6bb0317a2c8a5ee0ba4bd9 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Fri, 8 Jun 2012 21:03:42 -0500 Subject: [PATCH 04/49] Add link to our IRC channel on freenode to the front page, above past events * I'd like the IRC link to be prominent, but not disrupt the current design, so it goes below next event, above past events and other resources --- pythonkc_site/templates/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pythonkc_site/templates/index.html b/pythonkc_site/templates/index.html index c7a5b08..b9319ad 100644 --- a/pythonkc_site/templates/index.html +++ b/pythonkc_site/templates/index.html @@ -43,6 +43,13 @@

{{ next_event.name|safe }}

+
+
+

Join us on IRC!

+

#pythonkc on freenode

+
+
+

Past Events

From 16d8c63ff1d89b43de5c8c9ff5dc167814d9086c Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Fri, 8 Jun 2012 21:12:54 -0500 Subject: [PATCH 05/49] Cache home page for 5 minutes Cache duration matches that of the meetup.com event data --- pythonkc_site/urls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pythonkc_site/urls.py b/pythonkc_site/urls.py index 9b998ce..b1d592c 100644 --- a/pythonkc_site/urls.py +++ b/pythonkc_site/urls.py @@ -4,6 +4,7 @@ from django.conf.urls.defaults import include from django.conf.urls.defaults import patterns from django.conf.urls.defaults import url +from django.views.decorators.cache import cache_page from pythonkc_site.views import PythonKCHome # Uncomment the next two lines to enable the admin: @@ -11,7 +12,7 @@ # admin.autodiscover() urlpatterns = patterns('', - url(r'^/?$', PythonKCHome.as_view(), name='home'), + url(r'^/?$', cache_page(60 * 5)(PythonKCHome.as_view()), name='home'), # Examples: # url(r'^$', 'pythonkc_site.views.home', name='home'), From 07e8d55c74e11a6d2ca2b7f60806c71a1c1e5d4c Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Fri, 8 Jun 2012 22:35:40 -0500 Subject: [PATCH 06/49] Update gondor client in pip requirements --- pythonkc_site/requirements/project.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 9d444af..ab8d89d 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,5 +1,5 @@ Django==1.3.1 -gondor==1.0 +gondor==1.0.5 psycopg2==2.4.2 South==0.7.3 pythonkc-meetups==0.0.6 From e7f64f3368ec08221170d12a886d6158554bb65d Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Fri, 8 Jun 2012 22:37:38 -0500 Subject: [PATCH 07/49] Use os.environ to load sensitive settings --- pythonkc_site/settings.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pythonkc_site/settings.py b/pythonkc_site/settings.py index 244225a..8c1665c 100644 --- a/pythonkc_site/settings.py +++ b/pythonkc_site/settings.py @@ -158,6 +158,13 @@ CONTACT_EMAIL_FROM = 'noreply@pythonkc.com' CONTACT_EMAIL_TO = ['pythonkc@gmail.com'] +EMAIL_HOST = "smtp.gmail.com" +EMAIL_PORT = 587 +EMAIL_USE_TLS = True +EMAIL_HOST_USER = os.environ["EMAIL_HOST_USER"] +EMAIL_HOST_PASSWORD = os.environ["EMAIL_HOST_PASSWORD"] +MEETUP_API_KEY = os.environ["MEETUP_API_KEY"] + try: from local_settings import * except ImportError: @@ -183,9 +190,3 @@ 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', } } - - -try: - from private_settings import * -except ImportError: - pass From 4daf92e53a8d1ce0e16cd871529058bb000e6893 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sat, 16 Feb 2013 19:07:47 -0600 Subject: [PATCH 08/49] bump From 8ab409a2403de094de3fcd3dcc4de00e9b4527a1 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sat, 16 Feb 2013 19:12:30 -0600 Subject: [PATCH 09/49] bump From 7617740254f223d2897e438936b6058aef991f43 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sat, 16 Feb 2013 19:16:10 -0600 Subject: [PATCH 10/49] bump From c7c91544e373ccb90fa99b3c0a7b24f151232d70 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sat, 16 Feb 2013 19:32:17 -0600 Subject: [PATCH 11/49] bump From 69fbb23aa9ae89a415395be568749ffc3b3f0bd6 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sat, 16 Feb 2013 19:48:12 -0600 Subject: [PATCH 12/49] bump From d832175e86ded9c2ff2bafe40d43fd5e061a9802 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sun, 17 Feb 2013 09:16:17 -0600 Subject: [PATCH 13/49] Pro-longed backedup cache --- pythonkc_site/meetups/events.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pythonkc_site/meetups/events.py b/pythonkc_site/meetups/events.py index f89e22d..7e9be9e 100644 --- a/pythonkc_site/meetups/events.py +++ b/pythonkc_site/meetups/events.py @@ -38,8 +38,8 @@ def memoize_in_cache(cache_key, cache_timeout_seconds=None): """ backup_cache_key = cache_key + '_backup' - backup_cache_timeout_seconds = (cache_timeout_seconds * 100 - if cache_timeout_seconds else + backup_cache_timeout_seconds = (cache_timeout_seconds * 10000 + if cache_timeout_seconds else 60 * 60 * 24) def decorator(func): @@ -50,7 +50,7 @@ def decorated(): try: value = func() cache.set(cache_key, value, cache_timeout_seconds) - cache.set(backup_cache_key, value, + cache.set(backup_cache_key, value, backup_cache_timeout_seconds) except: value = cache.get(backup_cache_key) From 1e894cd678ea95cb53cae8e09350514ce71fed86 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sun, 17 Feb 2013 22:21:39 -0600 Subject: [PATCH 14/49] Upgrade pythonkc-meetups to 0.1.0 and provide num_past_events to client object (based on django settings) --- pythonkc_site/meetups/events.py | 2 +- pythonkc_site/requirements/project.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonkc_site/meetups/events.py b/pythonkc_site/meetups/events.py index 7e9be9e..e6ca379 100644 --- a/pythonkc_site/meetups/events.py +++ b/pythonkc_site/meetups/events.py @@ -22,8 +22,8 @@ raise ImproperlyConfigured('MEETUP_API_KEY is required in settings') -meetups = PythonKCMeetups(api_key, http_timeout=6) num_past_events = getattr(settings, 'MEETUP_SHOW_PAST_EVENTS', 3) +meetups = PythonKCMeetups(api_key, num_past_events=num_past_events, http_timeout=6) def memoize_in_cache(cache_key, cache_timeout_seconds=None): diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index ab8d89d..d728548 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -2,5 +2,5 @@ Django==1.3.1 gondor==1.0.5 psycopg2==2.4.2 South==0.7.3 -pythonkc-meetups==0.0.6 +pythonkc-meetups==0.1.0 django-redis-cache==0.9.2 From ade905e6be2883744a3584d8f0ceaee3a86cdab2 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Thu, 28 Mar 2013 19:20:37 -0500 Subject: [PATCH 15/49] Make manage.py executable --- pythonkc_site/manage.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 pythonkc_site/manage.py diff --git a/pythonkc_site/manage.py b/pythonkc_site/manage.py old mode 100644 new mode 100755 From 56a5193a005efd4c79ac942ffe0f2f04a886c990 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Thu, 28 Mar 2013 19:28:23 -0500 Subject: [PATCH 16/49] Upgrade Django to 1.3.6 --- pythonkc_site/requirements/project.txt | 2 +- pythonkc_site/settings.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index d728548..4511f38 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,4 +1,4 @@ -Django==1.3.1 +Django==1.3.6 gondor==1.0.5 psycopg2==2.4.2 South==0.7.3 diff --git a/pythonkc_site/settings.py b/pythonkc_site/settings.py index 8c1665c..ff98a75 100644 --- a/pythonkc_site/settings.py +++ b/pythonkc_site/settings.py @@ -23,6 +23,8 @@ } } +ALLOWED_HOSTS = ['pythonkc.com'] + # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. From 3746268c62023593d267a82a0d2dca36e555eb82 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Thu, 28 Mar 2013 19:30:32 -0500 Subject: [PATCH 17/49] Remove that awful background color for input placeholders --- pythonkc_site/static/screen.css | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pythonkc_site/static/screen.css b/pythonkc_site/static/screen.css index 49f0209..ea6d780 100644 --- a/pythonkc_site/static/screen.css +++ b/pythonkc_site/static/screen.css @@ -324,17 +324,14 @@ section.resources{ } .contact-form *:-moz-placeholder { - background-color: #1B82B3; - color: #87CDED; + color: #219cd7; } /* Combining these as *::-webkit-input-placeholder didn't seem to work...*/ .contact-form input::-webkit-input-placeholder { - background-color: #1B82B3; - color: #87CDED; + color: #219cd7; } .contact-form textarea::-webkit-input-placeholder { - background-color: #1B82B3; - color: #87CDED; + color: #219cd7; } .contact-sent { From 85977b61130a4d6a3ca0510d294f9c2a4b325579 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Sat, 30 Mar 2013 11:20:12 -0500 Subject: [PATCH 18/49] Add www sub-domain to ALLOWED_HOSTS --- pythonkc_site/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/settings.py b/pythonkc_site/settings.py index ff98a75..2cadfd0 100644 --- a/pythonkc_site/settings.py +++ b/pythonkc_site/settings.py @@ -23,7 +23,7 @@ } } -ALLOWED_HOSTS = ['pythonkc.com'] +ALLOWED_HOSTS = ['pythonkc.com', 'www.pythonkc.com'] # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name From 5b0eb4f09f241fe006c3935efc474401f6d71cde Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Thu, 26 Sep 2013 06:40:11 -0500 Subject: [PATCH 19/49] Use environ.get for optional env vars. --- pythonkc_site/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pythonkc_site/settings.py b/pythonkc_site/settings.py index 2cadfd0..28d04cb 100644 --- a/pythonkc_site/settings.py +++ b/pythonkc_site/settings.py @@ -163,8 +163,8 @@ EMAIL_HOST = "smtp.gmail.com" EMAIL_PORT = 587 EMAIL_USE_TLS = True -EMAIL_HOST_USER = os.environ["EMAIL_HOST_USER"] -EMAIL_HOST_PASSWORD = os.environ["EMAIL_HOST_PASSWORD"] +EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER") +EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD") MEETUP_API_KEY = os.environ["MEETUP_API_KEY"] try: @@ -174,7 +174,7 @@ try: - # NOTE The GONDOR_REDIS_* settings are placed in local_settings by the + # NOTE The GONDOR_REDIS_* settings are placed in local_settings by the # Gondor runtime. CACHES = { 'default': { From 0b84c713fb4defec86f9b9fceaf1b8756c4f30e6 Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Thu, 26 Sep 2013 06:41:51 -0500 Subject: [PATCH 20/49] Update local dev docs with env var instructions --- .gitignore | 1 + docs/local_development.rst | 22 +++++++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 846ce65..5cfc71a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ pythonkc_site/pythonkc.sqlite pythonkc_site/local_settings.py pythonkc_site/private_settings.py +pythonkc_site/.env diff --git a/docs/local_development.rst b/docs/local_development.rst index 183fc59..ef3d9aa 100644 --- a/docs/local_development.rst +++ b/docs/local_development.rst @@ -10,8 +10,6 @@ Running PythonKC.com Locally #. ``pip install -r requirements/project.txt`` -#. ``python manage.py syncdb`` - #. Create ``local_settings.py``, with:: DEBUG = TEMPLATE_DEBUG = True @@ -20,23 +18,21 @@ Running PythonKC.com Locally # Otherwise, you probably want emails you test with to come to you: CONTACT_EMAIL_TO = ['me@gmail.com'] -#. Create ``private_settings.py`` with: +#. Create a `.env` file with: - #. Meetup.com API key:: + #!/bin/sh + export MEETUP_API_KEY="" - MEETUP_API_KEY = "" + # if you're not using console.EmailBackend: + export EMAIL_HOST_USER="" + export EMAIL_HOST_PASSWORD="" - #. SMTP settings (if you kept the default email backend of SMTP above):: +#. Source your .env file: ``source .env``. - # For example.... - EMAIL_HOST = "smtp.gmail.com" - EMAIL_PORT = 587 - EMAIL_USE_TLS = True - EMAIL_HOST_USER = "contact@pythonkc.com" - EMAIL_HOST_PASSWORD = "*******************" +#. ``python manage.py syncdb`` #. ``python manage.py runserver`` #. Profit!!! -Note that both ``local_settings.py`` and ``private_settings.py`` are in our ``.gitignore``, so you don't commit what you do there. +Note that both ``local_settings.py`` and ``.env`` are in our ``.gitignore``, so you don't commit what you do there. From 131b49abc4c0d37cf9202a7a9b6c74f8543377b7 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Thu, 26 Sep 2013 19:34:08 -0500 Subject: [PATCH 21/49] The README has been pitiful for some time Add a development quickstart --- README.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.rst b/README.rst index acc6f07..d21b073 100644 --- a/README.rst +++ b/README.rst @@ -2,3 +2,15 @@ PYTHONKC.COM WEBSITE ==================== Files for the PythonKC.com website. + +Development Quickstart +---------------------- +:: + + mkvirtualenv pythonkc + git clone git@github.com:pythonkc/pythonkc.com.git + cd pythonkc.com/pythonkc_site + pip install -r requirements/project.txt + python manage.py runserver + +Profit! $$$ From c6221d731f8465400e48813c5a7abfa314499f07 Mon Sep 17 00:00:00 2001 From: Steven Cummings Date: Thu, 26 Sep 2013 19:35:38 -0500 Subject: [PATCH 22/49] Add a link to local-dev docs --- README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.rst b/README.rst index d21b073..e6105ae 100644 --- a/README.rst +++ b/README.rst @@ -14,3 +14,8 @@ Development Quickstart python manage.py runserver Profit! $$$ + +More Detailed Instructions +-------------------------- + +See: docs/local_development From a4a73cff8b49d789da04d0b2987f0363de9adbea Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Thu, 26 Sep 2013 19:52:07 -0500 Subject: [PATCH 23/49] Changed os.environ key accesses to get calls. --- pythonkc_site/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/settings.py b/pythonkc_site/settings.py index 28d04cb..44833fc 100644 --- a/pythonkc_site/settings.py +++ b/pythonkc_site/settings.py @@ -165,7 +165,7 @@ EMAIL_USE_TLS = True EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER") EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD") -MEETUP_API_KEY = os.environ["MEETUP_API_KEY"] +MEETUP_API_KEY = os.environ.get("MEETUP_API_KEY") try: from local_settings import * From 03e18abcfd53255e461f3583f9df9a76c87b803e Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sat, 12 Oct 2013 11:10:59 -0500 Subject: [PATCH 24/49] Django 1.5 upgrade --- docs/local_development.rst | 17 +++++++++-------- pythonkc_site/requirements/project.txt | 11 +++++++++-- pythonkc_site/settings.py | 2 ++ pythonkc_site/templates/index.html | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/docs/local_development.rst b/docs/local_development.rst index ef3d9aa..6b484bc 100644 --- a/docs/local_development.rst +++ b/docs/local_development.rst @@ -18,14 +18,15 @@ Running PythonKC.com Locally # Otherwise, you probably want emails you test with to come to you: CONTACT_EMAIL_TO = ['me@gmail.com'] -#. Create a `.env` file with: - - #!/bin/sh - export MEETUP_API_KEY="" - - # if you're not using console.EmailBackend: - export EMAIL_HOST_USER="" - export EMAIL_HOST_PASSWORD="" +#. Create a `.env` file with:: + + #!/bin/sh + export MEETUP_API_KEY="" + export DJANGO_SECRET_KEY="" + + # if you're not using console.EmailBackend: + export EMAIL_HOST_USER="" + export EMAIL_HOST_PASSWORD="" #. Source your .env file: ``source .env``. diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 4511f38..0ccce0c 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,6 +1,13 @@ Django==1.3.6 +South==0.7.3 +distribute==0.7.3 +django-redis-cache==0.9.2 gondor==1.0.5 +mimeparse==0.1.3 +pip-tools==0.3.4 psycopg2==2.4.2 -South==0.7.3 +python-dateutil==1.5 pythonkc-meetups==0.1.0 -django-redis-cache==0.9.2 +redis==2.8.0 +requests==0.7.5 +wsgiref==0.1.2 diff --git a/pythonkc_site/settings.py b/pythonkc_site/settings.py index 44833fc..e2dbc38 100644 --- a/pythonkc_site/settings.py +++ b/pythonkc_site/settings.py @@ -12,6 +12,8 @@ MANAGERS = ADMINS +SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY') + DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. diff --git a/pythonkc_site/templates/index.html b/pythonkc_site/templates/index.html index b9319ad..55d3939 100644 --- a/pythonkc_site/templates/index.html +++ b/pythonkc_site/templates/index.html @@ -142,7 +142,7 @@

FOLLOW US

-
{% csrf_token %} From e6be00e06e399136fdc69ca43fcf69fb4dc45743 Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Wed, 10 Jun 2015 13:06:50 -0500 Subject: [PATCH 25/49] Added Vagrantfile, provision.sh, and made some minor changes. --- AUTHORS | 1 + README.markdown | 18 ++++++++++++++++++ README.rst | 21 --------------------- Vagrantfile | 34 ++++++++++++++++++++++++++++++++++ provision.sh | 10 ++++++++++ 5 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 README.markdown delete mode 100644 README.rst create mode 100644 Vagrantfile create mode 100644 provision.sh diff --git a/AUTHORS b/AUTHORS index ba1816e..e049345 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,3 +3,4 @@ Julia Elman Matthew Irish Mark Ransom Jeff Triplett +Chip Warden diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..157bb0b --- /dev/null +++ b/README.markdown @@ -0,0 +1,18 @@ +# PYTHONKC.COM WEBSITE + +Files for the PythonKC.com website. + +## Development Quickstart +``` +mkvirtualenv pythonkc +git clone git@github.com:pythonkc/pythonkc.com.git +cd pythonkc.com/pythonkc_site +pip install -r requirements/project.txt +python manage.py runserver +``` + +Profit! $$$ + +## More Detailed Instructions + +See: docs/local_development diff --git a/README.rst b/README.rst deleted file mode 100644 index e6105ae..0000000 --- a/README.rst +++ /dev/null @@ -1,21 +0,0 @@ -PYTHONKC.COM WEBSITE -==================== - -Files for the PythonKC.com website. - -Development Quickstart ----------------------- -:: - - mkvirtualenv pythonkc - git clone git@github.com:pythonkc/pythonkc.com.git - cd pythonkc.com/pythonkc_site - pip install -r requirements/project.txt - python manage.py runserver - -Profit! $$$ - -More Detailed Instructions --------------------------- - -See: docs/local_development diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..724d483 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,34 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + + # vagrant-hostmanager plugin is required + unless Vagrant.has_plugin?("vagrant-hostmanager") + raise 'vagrant-hostmanager is not installed. run: vagrant plugin install vagrant-hostmanager' + end + + # vagrant-vbguest plugin is required + unless Vagrant.has_plugin?("vagrant-vbguest") + raise 'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' + end + + config.vm.define "pythonkcdotdev" do |pythonkcdotdev| + pythonkcdotdev.vm.box = "box-cutter/debian81" + pythonkcdotdev.vm.hostname = "pythonkc.dev" + pythonkcdotdev.vm.network "private_network", ip: "192.168.100.101" + pythonkcdotdev.vm.synced_folder "./", "/vagrant/" + pythonkcdotdev.vm.synced_folder "./pythonkc_site", "/var/www/pythonkc_site" + # TODO: Create a synced folder location for Ansible playbooks + + pythonkcdotdev.vm.provider "virtualbox" do |vb| + vb.name = "pythonkcdotdev" + vb.memory = 1024 + vb.cpus = 2 + vb.customize ["modifyvm", :id, "--cpuexecutioncap", "80"] + end + pythonkcdotdev.vm.provision :shell, :path => "provision.sh" + end +end diff --git a/provision.sh b/provision.sh new file mode 100644 index 0000000..0767aae --- /dev/null +++ b/provision.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# -*- coding: utf-8 -*- + +export DEBIAN_FRONTEND=noninteractive + +aptitude update +aptitude dist-upgrade -y +aptitude install -y python3 python3-dev python3-pip ansible +ln -sf /vagrant /home/vagrant/ +# TODO: Run Ansible playbooks From 239115be3a77b50a190109bab9e5c5125b0f5a93 Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Wed, 10 Jun 2015 14:34:54 -0500 Subject: [PATCH 26/49] Initial ansible setup --- .gitignore | 1 + README.markdown | 24 +++++++++++++++++++++++- ansible/ansible.cfg | 3 +++ ansible/group_vars/all.yml | 2 ++ ansible/group_vars/production.yml | 2 ++ ansible/group_vars/vagrant.yml | 2 ++ ansible/hosts | 6 ++++++ ansible/roles/base/tasks/main.yml | 17 +++++++++++++++++ ansible/vagrant.yml | 14 ++++++++++++++ provision.sh | 13 +++++++++---- 10 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 ansible/ansible.cfg create mode 100644 ansible/group_vars/all.yml create mode 100644 ansible/group_vars/production.yml create mode 100644 ansible/group_vars/vagrant.yml create mode 100644 ansible/hosts create mode 100644 ansible/roles/base/tasks/main.yml create mode 100644 ansible/vagrant.yml diff --git a/.gitignore b/.gitignore index 5cfc71a..f6f1cb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .gondor +.vagrant *.pyc pythonkc_site/pythonkc.sqlite pythonkc_site/local_settings.py diff --git a/README.markdown b/README.markdown index 157bb0b..407f31e 100644 --- a/README.markdown +++ b/README.markdown @@ -2,7 +2,29 @@ Files for the PythonKC.com website. -## Development Quickstart +## Development Quickstart Option 1 (vagrant) + +``` +vagrant plugin install vagrant-hostmanager +vagrant plugin install vagrant-vbguest +vagrant up +``` + +`vagrant up` will run `provision.sh` which runs ansible on the VM. + +We've done this so you don't have to install ansible on your local machine. + +If you'd prefer you can always ssh in and run/re-run the provisioner manually +(the output is a little nicer this way): + +``` +vagrant ssh +cd ~/vagrant/ansible +ansible-playbook vagrant.yml +``` + +## Development Quickstart Option 2 (virtualenv) + ``` mkvirtualenv pythonkc git clone git@github.com:pythonkc/pythonkc.com.git diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg new file mode 100644 index 0000000..0b186f5 --- /dev/null +++ b/ansible/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +hostfile = ./hosts +transport = ssh diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml new file mode 100644 index 0000000..66ba6ee --- /dev/null +++ b/ansible/group_vars/all.yml @@ -0,0 +1,2 @@ +--- +example: true # TODO, put any common variables in here diff --git a/ansible/group_vars/production.yml b/ansible/group_vars/production.yml new file mode 100644 index 0000000..e5a7d4e --- /dev/null +++ b/ansible/group_vars/production.yml @@ -0,0 +1,2 @@ +--- +user: pythonkc diff --git a/ansible/group_vars/vagrant.yml b/ansible/group_vars/vagrant.yml new file mode 100644 index 0000000..f0da763 --- /dev/null +++ b/ansible/group_vars/vagrant.yml @@ -0,0 +1,2 @@ +--- +user: vagrant diff --git a/ansible/hosts b/ansible/hosts new file mode 100644 index 0000000..f163a81 --- /dev/null +++ b/ansible/hosts @@ -0,0 +1,6 @@ +[vagrant] +localhost ansible_connection=local + +# TODO +#[production] +#pythonkc.com diff --git a/ansible/roles/base/tasks/main.yml b/ansible/roles/base/tasks/main.yml new file mode 100644 index 0000000..8de92e2 --- /dev/null +++ b/ansible/roles/base/tasks/main.yml @@ -0,0 +1,17 @@ +--- +- name: Update apt + apt: update_cache=yes cache_valid_time=3600 + tags: apt + +- name: Install some base packages + apt: pkg="{{item}}" state=latest + tags: apt + with_items: + - build-essential + - python3 + - python3-dev + - python3-pip + - python3-software-properties + +# What else should go in here? +# vim + vim configuration for python? diff --git a/ansible/vagrant.yml b/ansible/vagrant.yml new file mode 100644 index 0000000..fa741db --- /dev/null +++ b/ansible/vagrant.yml @@ -0,0 +1,14 @@ +--- +- hosts: vagrant + sudo: yes + + # you can have tasks right here + tasks: + - name: Say hello + shell: echo `date` > /home/vagrant/hello.txt + + # and you can have 'roles' + roles: + - role: base + tags: base_role + diff --git a/provision.sh b/provision.sh index 0767aae..d098078 100644 --- a/provision.sh +++ b/provision.sh @@ -3,8 +3,13 @@ export DEBIAN_FRONTEND=noninteractive -aptitude update -aptitude dist-upgrade -y -aptitude install -y python3 python3-dev python3-pip ansible ln -sf /vagrant /home/vagrant/ -# TODO: Run Ansible playbooks + +if [[ -z "$(which ansible)" ]]; then + echo "Installing ansible" + aptitude update + aptitude install -y python3 python3-dev python3-pip ansible +fi + +cd /home/vagrant/vagrant/ansible +ansible-playbook vagrant.yml From b32b1e11653bb00e9c852fd5aba94d7b138b3b84 Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Wed, 10 Jun 2015 16:30:20 -0500 Subject: [PATCH 27/49] Added vim-nox, htop, and changed VM RAM to 512MB. --- Vagrantfile | 2 +- ansible/roles/base/tasks/main.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 724d483..27bd942 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -25,7 +25,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| pythonkcdotdev.vm.provider "virtualbox" do |vb| vb.name = "pythonkcdotdev" - vb.memory = 1024 + vb.memory = 512 vb.cpus = 2 vb.customize ["modifyvm", :id, "--cpuexecutioncap", "80"] end diff --git a/ansible/roles/base/tasks/main.yml b/ansible/roles/base/tasks/main.yml index 8de92e2..8f17219 100644 --- a/ansible/roles/base/tasks/main.yml +++ b/ansible/roles/base/tasks/main.yml @@ -12,6 +12,8 @@ - python3-dev - python3-pip - python3-software-properties + - vim-nox + - htop # What else should go in here? # vim + vim configuration for python? From 12498fd765f02f46f57e76f8a1e33128b27923c5 Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Wed, 10 Jun 2015 16:33:46 -0500 Subject: [PATCH 28/49] Really changed the RAM size of the VM to 512MB. --- Vagrantfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 27bd942..403524b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,20 +15,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| raise 'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' end - config.vm.define "pythonkcdotdev" do |pythonkcdotdev| - pythonkcdotdev.vm.box = "box-cutter/debian81" - pythonkcdotdev.vm.hostname = "pythonkc.dev" - pythonkcdotdev.vm.network "private_network", ip: "192.168.100.101" - pythonkcdotdev.vm.synced_folder "./", "/vagrant/" - pythonkcdotdev.vm.synced_folder "./pythonkc_site", "/var/www/pythonkc_site" + config.vm.define "pykcdotdev" do |pykcdotdev| + pykcdotdev.vm.box = "box-cutter/debian81" + pykcdotdev.vm.hostname = "pythonkc.dev" + pykcdotdev.vm.network "private_network", ip: "192.168.100.101" + pykcdotdev.vm.synced_folder "./", "/vagrant/" + pykcdotdev.vm.synced_folder "./pythonkc_site", "/var/www/pythonkc_site" # TODO: Create a synced folder location for Ansible playbooks - pythonkcdotdev.vm.provider "virtualbox" do |vb| - vb.name = "pythonkcdotdev" + pykcdotdev.vm.provider "virtualbox" do |vb| + vb.name = "pykcdotdev" vb.memory = 512 vb.cpus = 2 vb.customize ["modifyvm", :id, "--cpuexecutioncap", "80"] end - pythonkcdotdev.vm.provision :shell, :path => "provision.sh" + pykcdotdev.vm.provision :shell, :path => "provision.sh" end end From 6027cd7910bd0a23b68995ffdc2638ff87ee429b Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Thu, 11 Jun 2015 15:03:04 -0500 Subject: [PATCH 29/49] Jessie64. --- README.markdown | 2 +- Vagrantfile | 8 ++++---- provision.sh | 7 +++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.markdown b/README.markdown index 407f31e..150361d 100644 --- a/README.markdown +++ b/README.markdown @@ -6,7 +6,7 @@ Files for the PythonKC.com website. ``` vagrant plugin install vagrant-hostmanager -vagrant plugin install vagrant-vbguest +vagrant plugin install vagrant-hostsupdater vagrant up ``` diff --git a/Vagrantfile b/Vagrantfile index 403524b..6e395fa 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -10,13 +10,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| raise 'vagrant-hostmanager is not installed. run: vagrant plugin install vagrant-hostmanager' end - # vagrant-vbguest plugin is required - unless Vagrant.has_plugin?("vagrant-vbguest") - raise 'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' + # vagrant-hostsupdater plugin is required + unless Vagrant.has_plugin?("vagrant-hostsupdater") + raise 'vagrant-hostsupdater is not installed. run: vagrant plugin install vagrant-hostsupdater' end config.vm.define "pykcdotdev" do |pykcdotdev| - pykcdotdev.vm.box = "box-cutter/debian81" + pykcdotdev.vm.box = "debian/jessie64" pykcdotdev.vm.hostname = "pythonkc.dev" pykcdotdev.vm.network "private_network", ip: "192.168.100.101" pykcdotdev.vm.synced_folder "./", "/vagrant/" diff --git a/provision.sh b/provision.sh index d098078..b2398c8 100644 --- a/provision.sh +++ b/provision.sh @@ -3,11 +3,14 @@ export DEBIAN_FRONTEND=noninteractive +aptitude update +aptitude dist-upgrade -y +aptitude install build-essential -y +aptitude install linux-headers-amd64 -y ln -sf /vagrant /home/vagrant/ if [[ -z "$(which ansible)" ]]; then - echo "Installing ansible" - aptitude update + echo "Installing Ansible..." aptitude install -y python3 python3-dev python3-pip ansible fi From 2b2aff55d22232d663f1f9de0159cd07ea8fe86c Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Thu, 11 Jun 2015 22:18:54 -0500 Subject: [PATCH 30/49] Changed to "official" debain/jessie64 box. --- AUTHORS | 1 + Vagrantfile | 35 ++++++++++++++++++++++++++++++++--- provision.sh | 2 ++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index e049345..624364f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,5 +2,6 @@ Steven Cummings Julia Elman Matthew Irish Mark Ransom +Jon Smajda Jeff Triplett Chip Warden diff --git a/Vagrantfile b/Vagrantfile index 6e395fa..3dc1f4b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,6 +3,26 @@ VAGRANTFILE_API_VERSION = "2" +# Allow host platform checks +# http://stackoverflow.com/questions/26811089/vagrant-how-to-have-host-platform-specific-provisioning-steps +module OS + def OS.windows? + (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil + end + + def OS.mac? + (/darwin/ =~ RUBY_PLATFORM) != nil + end + + def OS.unix? + !OS.windows? + end + + def OS.linux? + OS.unix? and not OS.mac? + end +end + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # vagrant-hostmanager plugin is required @@ -15,13 +35,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| raise 'vagrant-hostsupdater is not installed. run: vagrant plugin install vagrant-hostsupdater' end + # vagrant-vbguest plugin is required + unless Vagrant.has_plugin?("vagrant-vbguest") + raise'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' + end + config.vm.define "pykcdotdev" do |pykcdotdev| pykcdotdev.vm.box = "debian/jessie64" pykcdotdev.vm.hostname = "pythonkc.dev" pykcdotdev.vm.network "private_network", ip: "192.168.100.101" - pykcdotdev.vm.synced_folder "./", "/vagrant/" - pykcdotdev.vm.synced_folder "./pythonkc_site", "/var/www/pythonkc_site" - # TODO: Create a synced folder location for Ansible playbooks + if OS.unix? + pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "nfs" + elsif OS.windows? + pykcdotdev.vm.synced_folder "./", "/vagrant/" # , type: "smb" + else + raise 'Unknown host operating system. Cannot continue.' + end pykcdotdev.vm.provider "virtualbox" do |vb| vb.name = "pykcdotdev" diff --git a/provision.sh b/provision.sh index b2398c8..2896ffa 100644 --- a/provision.sh +++ b/provision.sh @@ -8,6 +8,8 @@ aptitude dist-upgrade -y aptitude install build-essential -y aptitude install linux-headers-amd64 -y ln -sf /vagrant /home/vagrant/ +mkdir -p /var/www +ln -sf /vagrant/pythonkc_site /var/www/pythonkc_site if [[ -z "$(which ansible)" ]]; then echo "Installing Ansible..." From 3e608907cbb70cbf003e8381c950e60e54c69fd4 Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Thu, 11 Jun 2015 22:18:54 -0500 Subject: [PATCH 31/49] Switched to "official" debian/jessie64 box. --- AUTHORS | 1 + Vagrantfile | 35 ++++++++++++++++++++++++++++++++--- provision.sh | 2 ++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index e049345..624364f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,5 +2,6 @@ Steven Cummings Julia Elman Matthew Irish Mark Ransom +Jon Smajda Jeff Triplett Chip Warden diff --git a/Vagrantfile b/Vagrantfile index 6e395fa..3dc1f4b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,6 +3,26 @@ VAGRANTFILE_API_VERSION = "2" +# Allow host platform checks +# http://stackoverflow.com/questions/26811089/vagrant-how-to-have-host-platform-specific-provisioning-steps +module OS + def OS.windows? + (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil + end + + def OS.mac? + (/darwin/ =~ RUBY_PLATFORM) != nil + end + + def OS.unix? + !OS.windows? + end + + def OS.linux? + OS.unix? and not OS.mac? + end +end + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # vagrant-hostmanager plugin is required @@ -15,13 +35,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| raise 'vagrant-hostsupdater is not installed. run: vagrant plugin install vagrant-hostsupdater' end + # vagrant-vbguest plugin is required + unless Vagrant.has_plugin?("vagrant-vbguest") + raise'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' + end + config.vm.define "pykcdotdev" do |pykcdotdev| pykcdotdev.vm.box = "debian/jessie64" pykcdotdev.vm.hostname = "pythonkc.dev" pykcdotdev.vm.network "private_network", ip: "192.168.100.101" - pykcdotdev.vm.synced_folder "./", "/vagrant/" - pykcdotdev.vm.synced_folder "./pythonkc_site", "/var/www/pythonkc_site" - # TODO: Create a synced folder location for Ansible playbooks + if OS.unix? + pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "nfs" + elsif OS.windows? + pykcdotdev.vm.synced_folder "./", "/vagrant/" # , type: "smb" + else + raise 'Unknown host operating system. Cannot continue.' + end pykcdotdev.vm.provider "virtualbox" do |vb| vb.name = "pykcdotdev" diff --git a/provision.sh b/provision.sh index b2398c8..2896ffa 100644 --- a/provision.sh +++ b/provision.sh @@ -8,6 +8,8 @@ aptitude dist-upgrade -y aptitude install build-essential -y aptitude install linux-headers-amd64 -y ln -sf /vagrant /home/vagrant/ +mkdir -p /var/www +ln -sf /vagrant/pythonkc_site /var/www/pythonkc_site if [[ -z "$(which ansible)" ]]; then echo "Installing Ansible..." From 659ebc9e91b93b0ab017d6791fc439e8138b32af Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Fri, 12 Jun 2015 13:39:34 -0500 Subject: [PATCH 32/49] Purge chef and puppet. --- provision.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/provision.sh b/provision.sh index 2896ffa..c1e7ffe 100644 --- a/provision.sh +++ b/provision.sh @@ -4,9 +4,8 @@ export DEBIAN_FRONTEND=noninteractive aptitude update +aptitude purge -y chef chef-zero puppet puppet-common aptitude dist-upgrade -y -aptitude install build-essential -y -aptitude install linux-headers-amd64 -y ln -sf /vagrant /home/vagrant/ mkdir -p /var/www ln -sf /vagrant/pythonkc_site /var/www/pythonkc_site From f673806fbad1dc61bc05db1cca1eed891b5b90c6 Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Sat, 13 Jun 2015 15:04:47 +0000 Subject: [PATCH 33/49] Added Gitter badge --- README.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.markdown b/README.markdown index 150361d..cc7953c 100644 --- a/README.markdown +++ b/README.markdown @@ -1,5 +1,7 @@ # PYTHONKC.COM WEBSITE +[![Join the chat at https://gitter.im/pythonkc/pythonkc.com](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pythonkc/pythonkc.com?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + Files for the PythonKC.com website. ## Development Quickstart Option 1 (vagrant) From 1443700bb4bad8b1f31c11bb156a535edfe487af Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sat, 13 Jun 2015 12:54:52 -0500 Subject: [PATCH 34/49] 1.6 --- pythonkc_site/manage.py | 18 +++++++----------- pythonkc_site/requirements/project.txt | 11 +++++------ pythonkc_site/urls.py | 6 +++--- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/pythonkc_site/manage.py b/pythonkc_site/manage.py index 3e4eedc..17ec4b6 100755 --- a/pythonkc_site/manage.py +++ b/pythonkc_site/manage.py @@ -1,14 +1,10 @@ #!/usr/bin/env python -from django.core.management import execute_manager -import imp -try: - imp.find_module('settings') # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__) - sys.exit(1) - -import settings +import os +import sys if __name__ == "__main__": - execute_manager(settings) + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pythonkc_site.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 0ccce0c..37ba709 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,13 +1,12 @@ -Django==1.3.6 -South==0.7.3 -distribute==0.7.3 +Django==1.6.11 +South==1.0.2 django-redis-cache==0.9.2 gondor==1.0.5 mimeparse==0.1.3 pip-tools==0.3.4 -psycopg2==2.4.2 +psycopg2==2.6 python-dateutil==1.5 pythonkc-meetups==0.1.0 -redis==2.8.0 -requests==0.7.5 +redis==2.10.3 +requests==2.7.0 wsgiref==0.1.2 diff --git a/pythonkc_site/urls.py b/pythonkc_site/urls.py index b1d592c..19fc176 100644 --- a/pythonkc_site/urls.py +++ b/pythonkc_site/urls.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -from django.conf.urls.defaults import include -from django.conf.urls.defaults import patterns -from django.conf.urls.defaults import url +from django.conf.urls import include +from django.conf.urls import patterns +from django.conf.urls import url from django.views.decorators.cache import cache_page from pythonkc_site.views import PythonKCHome From 8b23a28a504e343a9af3d32887cec9c3208e2fd7 Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sat, 13 Jun 2015 12:57:11 -0500 Subject: [PATCH 35/49] 1.7 --- pythonkc_site/requirements/project.txt | 3 +-- pythonkc_site/settings.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 37ba709..d1f514e 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,5 +1,4 @@ -Django==1.6.11 -South==1.0.2 +Django==1.7.8 django-redis-cache==0.9.2 gondor==1.0.5 mimeparse==0.1.3 diff --git a/pythonkc_site/settings.py b/pythonkc_site/settings.py index e2dbc38..249cf15 100644 --- a/pythonkc_site/settings.py +++ b/pythonkc_site/settings.py @@ -121,7 +121,6 @@ #'django.contrib.admin', # Uncomment the next line to enable admin documentation: #'django.contrib.admindocs', - 'south', 'pythonkc_site.contact', ) From 4f7c1c238fa58a18dcc588a6bc67c8c05fa6a856 Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sat, 13 Jun 2015 12:58:54 -0500 Subject: [PATCH 36/49] 1.8 --- pythonkc_site/requirements/project.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index d1f514e..4d75704 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,4 +1,4 @@ -Django==1.7.8 +Django==1.8.2 django-redis-cache==0.9.2 gondor==1.0.5 mimeparse==0.1.3 From ab8d34e3c53e2a88c2782e79e509d7d54077ec6a Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sun, 2 Aug 2015 14:48:40 -0500 Subject: [PATCH 37/49] Update Django, psycopg2 --- pythonkc_site/requirements/project.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 4d75704..8d28382 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,9 +1,8 @@ -Django==1.8.2 +Django==1.8.3 django-redis-cache==0.9.2 gondor==1.0.5 mimeparse==0.1.3 -pip-tools==0.3.4 -psycopg2==2.6 +psycopg2==2.6.1 python-dateutil==1.5 pythonkc-meetups==0.1.0 redis==2.10.3 From 4eaf1104bebedbae8e38bb348efea490dad2867d Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sun, 2 Aug 2015 16:11:54 -0500 Subject: [PATCH 38/49] Initial ansible playbook. Uses Python 2 for now. Python 3 supported via an Ansible variable. (See README for details) --- README.markdown | 30 ++++++++++++ ansible/group_vars/all.yml | 2 +- ansible/group_vars/production.yml | 2 + ansible/group_vars/vagrant.yml | 2 + ansible/roles/pythonkc/defaults/main.yml | 2 + ansible/roles/pythonkc/tasks/django.yml | 47 +++++++++++++++++++ ansible/roles/pythonkc/tasks/main.yml | 9 ++++ ansible/roles/pythonkc/tasks/python2.yml | 17 +++++++ .../main.yml => pythonkc/tasks/python3.yml} | 9 ++-- ansible/roles/pythonkc/tasks/tools.yml | 16 +++++++ ansible/vagrant.yml | 11 +---- provision.sh | 7 +-- pythonkc_site/.env.example | 3 ++ pythonkc_site/manage.py | 1 + pythonkc_site/requirements/gondor.txt | 2 + pythonkc_site/requirements/project.txt | 3 +- pythonkc_site/settings.py | 5 ++ 17 files changed, 147 insertions(+), 21 deletions(-) create mode 100644 ansible/roles/pythonkc/defaults/main.yml create mode 100644 ansible/roles/pythonkc/tasks/django.yml create mode 100644 ansible/roles/pythonkc/tasks/main.yml create mode 100644 ansible/roles/pythonkc/tasks/python2.yml rename ansible/roles/{base/tasks/main.yml => pythonkc/tasks/python3.yml} (74%) create mode 100644 ansible/roles/pythonkc/tasks/tools.yml create mode 100644 pythonkc_site/.env.example create mode 100644 pythonkc_site/requirements/gondor.txt diff --git a/README.markdown b/README.markdown index 150361d..12ebdaf 100644 --- a/README.markdown +++ b/README.markdown @@ -4,6 +4,12 @@ Files for the PythonKC.com website. ## Development Quickstart Option 1 (vagrant) +First, copy `pythonkc_site/.env.example` to `pythonkc_site/.env` and add +your own [meetup api key][] and a unique [django secret key][] (`.env` will +be ignored by git) + +Then you have to install some vagrant plugins and build your vagrant box: + ``` vagrant plugin install vagrant-hostmanager vagrant plugin install vagrant-hostsupdater @@ -23,6 +29,25 @@ cd ~/vagrant/ansible ansible-playbook vagrant.yml ``` +To run the Django development server: + +``` +vagrant ssh +django-admin runserver 192.168.100.101:8000 +``` + +Now go to `http://192.168.100.101:8000` in your browser. You can edit the files +on your local machine and the server should reload automatically. + +For now, this is a Python 2 project. If you want to start using Python 3 +and help us fix our problems, set Ansible's `python_version` variable to 3 +and it will build the virtualenv using Python 3: + +``` +ansible-playbook vagrant.yml -e python_version=3 +``` + + ## Development Quickstart Option 2 (virtualenv) ``` @@ -38,3 +63,8 @@ Profit! $$$ ## More Detailed Instructions See: docs/local_development + + + +[meetup api key]: https://secure.meetup.com/meetup_api/key/ +[django secret key]: http://www.miniwebtool.com/django-secret-key-generator/ diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 66ba6ee..a7c25ae 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1,2 +1,2 @@ --- -example: true # TODO, put any common variables in here +virtualenv: ~/virtualenvs/pythonkc diff --git a/ansible/group_vars/production.yml b/ansible/group_vars/production.yml index e5a7d4e..dd9c76e 100644 --- a/ansible/group_vars/production.yml +++ b/ansible/group_vars/production.yml @@ -1,2 +1,4 @@ --- user: pythonkc +pythonpath: /TODO +project_root: /TODO/pythonkc_site diff --git a/ansible/group_vars/vagrant.yml b/ansible/group_vars/vagrant.yml index f0da763..61df658 100644 --- a/ansible/group_vars/vagrant.yml +++ b/ansible/group_vars/vagrant.yml @@ -1,2 +1,4 @@ --- user: vagrant +pythonpath: /home/vagrant/vagrant +project_root: /home/vagrant/vagrant/pythonkc_site diff --git a/ansible/roles/pythonkc/defaults/main.yml b/ansible/roles/pythonkc/defaults/main.yml new file mode 100644 index 0000000..cef7389 --- /dev/null +++ b/ansible/roles/pythonkc/defaults/main.yml @@ -0,0 +1,2 @@ +--- +python_version: 2 diff --git a/ansible/roles/pythonkc/tasks/django.yml b/ansible/roles/pythonkc/tasks/django.yml new file mode 100644 index 0000000..168c1ff --- /dev/null +++ b/ansible/roles/pythonkc/tasks/django.yml @@ -0,0 +1,47 @@ +--- +- name: Create virtualenvs directory + file: dest=~/virtualenvs state=directory owner={{ user }} group={{ user }} + + +- name: Install requirements into Python 2.7 virtualenv + pip: + requirements: "{{ project_root }}/requirements/project.txt" + virtualenv: "{{ virtualenv }}" + virtualenv_command: /usr/bin/virtualenv -p python2.7 + when: python_version == 2 + + +- name: Install requirements into Python 3 virtualenv + pip: + requirements: "{{ project_root }}/requirements/project.txt" + virtualenv: "{{ virtualenv }}" + virtualenv_command: python3 /usr/lib/python3/dist-packages/virtualenv.py -p python3 + when: python_version == 3 + + +- name: Set some env vars when activating virtualenv + lineinfile: + dest: "{{ virtualenv }}/bin/activate" + regexp: "^export {{ item.name }}=" + line: "export {{ item.name }}={{ item.value }}" + state: present + insertafter: EOF + with_items: + - {name: DJANGO_SETTINGS_MODULE, value: pythonkc_site.settings} + - {name: PYTHONPATH, value: "{{ pythonpath }}"} + + +- name: Automatically activate the virtualenv in bashrc + lineinfile: + dest: ~/.bashrc + line: "source {{ virtualenv }}/bin/activate" + state: present + insertafter: EOF + + +- name: Run migrations + django_manage: + command: migrate + app_path: "{{ project_root }}" + pythonpath: "{{ pythonpath }}" + virtualenv: "{{ virtualenv }}" diff --git a/ansible/roles/pythonkc/tasks/main.yml b/ansible/roles/pythonkc/tasks/main.yml new file mode 100644 index 0000000..580670f --- /dev/null +++ b/ansible/roles/pythonkc/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- {include: python2.yml, tags: python, when: python_version == 2} +- {include: python3.yml, tags: python, when: python_version == 3} +- include: tools.yml tags=tools +- include: django.yml tags=django + +# TODO +# vim + vim configuration for python? +# postgres? (for now just using sqlite for development) diff --git a/ansible/roles/pythonkc/tasks/python2.yml b/ansible/roles/pythonkc/tasks/python2.yml new file mode 100644 index 0000000..3acaf12 --- /dev/null +++ b/ansible/roles/pythonkc/tasks/python2.yml @@ -0,0 +1,17 @@ +--- +- name: Update apt + apt: update_cache=yes cache_valid_time=3600 + become: yes + tags: apt + +- name: Install some base packages + apt: pkg="{{item}}" state=latest + become: yes + tags: apt + with_items: + - build-essential + - libpq-dev + - python-dev + - python-pip + - python-software-properties + - python-virtualenv diff --git a/ansible/roles/base/tasks/main.yml b/ansible/roles/pythonkc/tasks/python3.yml similarity index 74% rename from ansible/roles/base/tasks/main.yml rename to ansible/roles/pythonkc/tasks/python3.yml index 8f17219..536f083 100644 --- a/ansible/roles/base/tasks/main.yml +++ b/ansible/roles/pythonkc/tasks/python3.yml @@ -1,19 +1,18 @@ --- - name: Update apt apt: update_cache=yes cache_valid_time=3600 + become: yes tags: apt - name: Install some base packages apt: pkg="{{item}}" state=latest + become: yes tags: apt with_items: - build-essential + - libpq-dev - python3 - python3-dev - python3-pip - python3-software-properties - - vim-nox - - htop - -# What else should go in here? -# vim + vim configuration for python? + - python3-virtualenv diff --git a/ansible/roles/pythonkc/tasks/tools.yml b/ansible/roles/pythonkc/tasks/tools.yml new file mode 100644 index 0000000..e975012 --- /dev/null +++ b/ansible/roles/pythonkc/tasks/tools.yml @@ -0,0 +1,16 @@ +--- +- name: Update apt + apt: update_cache=yes cache_valid_time=3600 + become: yes + tags: apt + + +- name: Install some dev tools packages + apt: pkg="{{item}}" state=latest + become: yes + tags: apt + with_items: + - vim-nox + - htop + +# TODO basic vimrc with python plugins? diff --git a/ansible/vagrant.yml b/ansible/vagrant.yml index fa741db..b03563c 100644 --- a/ansible/vagrant.yml +++ b/ansible/vagrant.yml @@ -1,14 +1,5 @@ --- - hosts: vagrant - sudo: yes - - # you can have tasks right here - tasks: - - name: Say hello - shell: echo `date` > /home/vagrant/hello.txt - - # and you can have 'roles' roles: - - role: base - tags: base_role + - pythonkc diff --git a/provision.sh b/provision.sh index c1e7ffe..62d57d4 100644 --- a/provision.sh +++ b/provision.sh @@ -11,9 +11,10 @@ mkdir -p /var/www ln -sf /vagrant/pythonkc_site /var/www/pythonkc_site if [[ -z "$(which ansible)" ]]; then - echo "Installing Ansible..." - aptitude install -y python3 python3-dev python3-pip ansible + echo "Installing pip and Ansible..." + aptitude install -y python-dev python-pip + pip2 install ansible fi cd /home/vagrant/vagrant/ansible -ansible-playbook vagrant.yml +sudo -H -u vagrant ansible-playbook vagrant.yml diff --git a/pythonkc_site/.env.example b/pythonkc_site/.env.example new file mode 100644 index 0000000..e56fb5e --- /dev/null +++ b/pythonkc_site/.env.example @@ -0,0 +1,3 @@ +#!/bin/bash +export MEETUP_API_KEY='your-meetup-api-key-here' +export DJANGO_SECRET_KEY='django-secret-key-here' diff --git a/pythonkc_site/manage.py b/pythonkc_site/manage.py index 17ec4b6..085cc5a 100755 --- a/pythonkc_site/manage.py +++ b/pythonkc_site/manage.py @@ -2,6 +2,7 @@ import os import sys + if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pythonkc_site.settings") diff --git a/pythonkc_site/requirements/gondor.txt b/pythonkc_site/requirements/gondor.txt new file mode 100644 index 0000000..5124d33 --- /dev/null +++ b/pythonkc_site/requirements/gondor.txt @@ -0,0 +1,2 @@ +gondor==1.0.5 +wsgiref==0.1.2 diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 8d28382..17bb9e6 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,10 +1,9 @@ Django==1.8.3 +django-dotenv==1.3.0 django-redis-cache==0.9.2 -gondor==1.0.5 mimeparse==0.1.3 psycopg2==2.6.1 python-dateutil==1.5 pythonkc-meetups==0.1.0 redis==2.10.3 requests==2.7.0 -wsgiref==0.1.2 diff --git a/pythonkc_site/settings.py b/pythonkc_site/settings.py index 249cf15..2b12fef 100644 --- a/pythonkc_site/settings.py +++ b/pythonkc_site/settings.py @@ -1,6 +1,11 @@ # Django settings for pythonkc_site project. import os +from os.path import abspath, dirname, join + +import dotenv +dotenv.read_dotenv(abspath(join(dirname(__file__), '.env'))) + PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) From 9c3503a9a1ccd310f465a36c25d9149d28560817 Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sat, 8 Aug 2015 11:35:05 -0500 Subject: [PATCH 39/49] .env does not need to be a shell script --- pythonkc_site/.env.example | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pythonkc_site/.env.example b/pythonkc_site/.env.example index e56fb5e..6c2df8c 100644 --- a/pythonkc_site/.env.example +++ b/pythonkc_site/.env.example @@ -1,3 +1,2 @@ -#!/bin/bash -export MEETUP_API_KEY='your-meetup-api-key-here' -export DJANGO_SECRET_KEY='django-secret-key-here' +MEETUP_API_KEY='your-meetup-api-key-here' +DJANGO_SECRET_KEY='django-secret-key-here' From e60a62bc7bf71de06691c6c1685897e20d4809f2 Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sat, 8 Aug 2015 11:35:41 -0500 Subject: [PATCH 40/49] Improve vagrant instructions in vagrant --- README.markdown | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index dc7d4e5..a539343 100644 --- a/README.markdown +++ b/README.markdown @@ -6,7 +6,15 @@ Files for the PythonKC.com website. ## Development Quickstart Option 1 (vagrant) -First, copy `pythonkc_site/.env.example` to `pythonkc_site/.env` and add +We're going to use Vagrant and Virtualbox to run pythonkc.com inside a Debian +VM. We're using the [shell provisioner][] to install Ansible inside our VM and +then using Ansible to manage the environment from there. (Note: we're *not* +using the [ansible provisioner][].) + +First you need to install [Vagrant][] and [VirtualBox][] and clone [our +repository][] from github. + +Now copy `pythonkc_site/.env.example` to `pythonkc_site/.env` and add your own [meetup api key][] and a unique [django secret key][] (`.env` will be ignored by git) @@ -68,5 +76,11 @@ See: docs/local_development +[Vagrant]: https://www.vagrantup.com/downloads.html +[VirtualBox]: https://www.virtualbox.org +[shell provisioner]: http://docs.vagrantup.com/v2/provisioning/shell.html +[ansible provisioner]: http://docs.vagrantup.com/v2/provisioning/ansible.html +[our repository]: https://github.com/pythonkc/pythonkc.com [meetup api key]: https://secure.meetup.com/meetup_api/key/ [django secret key]: http://www.miniwebtool.com/django-secret-key-generator/ + From 29859c34a30b0b621d203642866aae93d241941c Mon Sep 17 00:00:00 2001 From: Jon Smajda Date: Sat, 8 Aug 2015 11:56:00 -0500 Subject: [PATCH 41/49] Also may need to install vbguest plugin --- README.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/README.markdown b/README.markdown index a539343..d11fd8b 100644 --- a/README.markdown +++ b/README.markdown @@ -21,6 +21,7 @@ be ignored by git) Then you have to install some vagrant plugins and build your vagrant box: ``` +vagrant plugin install vagrant-vbguest vagrant plugin install vagrant-hostmanager vagrant plugin install vagrant-hostsupdater vagrant up From 3a09f3bb4b9fa91b6f1b0731545217280508da3c Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Tue, 29 Mar 2016 14:55:29 -0500 Subject: [PATCH 42/49] Cleanup Vagrantfile and README.markdown. --- README.markdown | 28 +++++++++++++--------------- Vagrantfile | 8 ++++---- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/README.markdown b/README.markdown index d11fd8b..984f21f 100644 --- a/README.markdown +++ b/README.markdown @@ -1,21 +1,21 @@ -# PYTHONKC.COM WEBSITE +# `pythonkc.com` website [![Join the chat at https://gitter.im/pythonkc/pythonkc.com](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pythonkc/pythonkc.com?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -Files for the PythonKC.com website. +Files for the `pythonkc.com` website. ## Development Quickstart Option 1 (vagrant) We're going to use Vagrant and Virtualbox to run pythonkc.com inside a Debian -VM. We're using the [shell provisioner][] to install Ansible inside our VM and +VM. We're using the [shell provisioner][shell] to install Ansible inside our VM and then using Ansible to manage the environment from there. (Note: we're *not* -using the [ansible provisioner][].) +using the [ansible provisioner][ansible].) -First you need to install [Vagrant][] and [VirtualBox][] and clone [our +First you need to install [Vagrant][vagrant] and [VirtualBox][virtualbox] and clone [our repository][] from github. Now copy `pythonkc_site/.env.example` to `pythonkc_site/.env` and add -your own [meetup api key][] and a unique [django secret key][] (`.env` will +your own [meetup api key][meetup] and a unique [django secret key][django] (`.env` will be ignored by git) Then you have to install some vagrant plugins and build your vagrant box: @@ -63,7 +63,7 @@ ansible-playbook vagrant.yml -e python_version=3 ``` mkvirtualenv pythonkc -git clone git@github.com:pythonkc/pythonkc.com.git +git clone git@github.com:pythonkc/pythonkc-com.git cd pythonkc.com/pythonkc_site pip install -r requirements/project.txt python manage.py runserver @@ -77,11 +77,9 @@ See: docs/local_development -[Vagrant]: https://www.vagrantup.com/downloads.html -[VirtualBox]: https://www.virtualbox.org -[shell provisioner]: http://docs.vagrantup.com/v2/provisioning/shell.html -[ansible provisioner]: http://docs.vagrantup.com/v2/provisioning/ansible.html -[our repository]: https://github.com/pythonkc/pythonkc.com -[meetup api key]: https://secure.meetup.com/meetup_api/key/ -[django secret key]: http://www.miniwebtool.com/django-secret-key-generator/ - +[ansible]: http://docs.vagrantup.com/v2/provisioning/ansible.html +[django]: http://www.miniwebtool.com/django-secret-key-generator/ +[meetup]: https://secure.meetup.com/meetup_api/key/ +[shell]: http://docs.vagrantup.com/v2/provisioning/shell.html +[vagrant]: https://www.vagrantup.com/downloads.html +[virtualbox]: https://www.virtualbox.org diff --git a/Vagrantfile b/Vagrantfile index 3dc1f4b..62dbbdb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -37,17 +37,17 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # vagrant-vbguest plugin is required unless Vagrant.has_plugin?("vagrant-vbguest") - raise'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' + raise 'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' end config.vm.define "pykcdotdev" do |pykcdotdev| pykcdotdev.vm.box = "debian/jessie64" pykcdotdev.vm.hostname = "pythonkc.dev" - pykcdotdev.vm.network "private_network", ip: "192.168.100.101" + pykcdotdev.vm.network "private_network", type: "dhcp" if OS.unix? - pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "nfs" + pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "nfs" elsif OS.windows? - pykcdotdev.vm.synced_folder "./", "/vagrant/" # , type: "smb" + pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "smb" else raise 'Unknown host operating system. Cannot continue.' end From e1051419a69238a8324a48ff38a7b3115000b537 Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Tue, 29 Mar 2016 14:57:48 -0500 Subject: [PATCH 43/49] Re-add deleted link. --- README.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 984f21f..89ba317 100644 --- a/README.markdown +++ b/README.markdown @@ -12,7 +12,7 @@ then using Ansible to manage the environment from there. (Note: we're *not* using the [ansible provisioner][ansible].) First you need to install [Vagrant][vagrant] and [VirtualBox][virtualbox] and clone [our -repository][] from github. +repository][repo] from github. Now copy `pythonkc_site/.env.example` to `pythonkc_site/.env` and add your own [meetup api key][meetup] and a unique [django secret key][django] (`.env` will @@ -80,6 +80,7 @@ See: docs/local_development [ansible]: http://docs.vagrantup.com/v2/provisioning/ansible.html [django]: http://www.miniwebtool.com/django-secret-key-generator/ [meetup]: https://secure.meetup.com/meetup_api/key/ +[repo]: https://github.com/pythonkc/pythonkc-com [shell]: http://docs.vagrantup.com/v2/provisioning/shell.html [vagrant]: https://www.vagrantup.com/downloads.html [virtualbox]: https://www.virtualbox.org From 14d9551bb6affc02c9a0551fabed6ae08d7ec28c Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Tue, 29 Mar 2016 15:23:31 -0500 Subject: [PATCH 44/49] Improve .gitignore and Vagrantfile. --- Vagrantfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 62dbbdb..faf70a9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -40,24 +40,24 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| raise 'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' end - config.vm.define "pykcdotdev" do |pykcdotdev| - pykcdotdev.vm.box = "debian/jessie64" - pykcdotdev.vm.hostname = "pythonkc.dev" - pykcdotdev.vm.network "private_network", type: "dhcp" + config.vm.define "pykcdevel" do |pykcdevel| + pykcdevel.vm.box = "debian/jessie64" + pykcdevel.vm.hostname = "pythonkc.devel" + pykcdevel.vm.network "private_network", type: "dhcp" if OS.unix? - pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "nfs" + pykcdevel.vm.synced_folder "./", "/vagrant/", type: "nfs" elsif OS.windows? - pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "smb" + pykcdevel.vm.synced_folder "./", "/vagrant/", type: "smb" else raise 'Unknown host operating system. Cannot continue.' end - pykcdotdev.vm.provider "virtualbox" do |vb| - vb.name = "pykcdotdev" + pykcdevel.vm.provider "virtualbox" do |vb| + vb.name = "pykcdevel" vb.memory = 512 vb.cpus = 2 vb.customize ["modifyvm", :id, "--cpuexecutioncap", "80"] end - pykcdotdev.vm.provision :shell, :path => "provision.sh" + pykcdevel.vm.provision :shell, :path => "provision.sh" end end From 9cc0de2c8544d77454497b1bd7c6ec06be79bb9e Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Tue, 29 Mar 2016 15:23:59 -0500 Subject: [PATCH 45/49] Improve .gitignore and Vagrantfile. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f6f1cb1..0c83afa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .gondor .vagrant *.pyc +ansible/vagrant.retry pythonkc_site/pythonkc.sqlite pythonkc_site/local_settings.py pythonkc_site/private_settings.py From 57a832f4cbc3cd741d1f91e7a6637349244498f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 5 Oct 2025 02:23:43 +0000 Subject: [PATCH 46/49] Bump django from 1.8.3 to 4.2.25 in /pythonkc_site/requirements Bumps [django](https://github.com/django/django) from 1.8.3 to 4.2.25. - [Commits](https://github.com/django/django/compare/1.8.3...4.2.25) --- updated-dependencies: - dependency-name: django dependency-version: 4.2.25 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pythonkc_site/requirements/project.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 17bb9e6..037c874 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,4 +1,4 @@ -Django==1.8.3 +Django==4.2.25 django-dotenv==1.3.0 django-redis-cache==0.9.2 mimeparse==0.1.3 From d338bcade2ce4c4e0669f206ec827c91758a3be5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 06:14:48 +0000 Subject: [PATCH 47/49] Bump django from 4.2.25 to 4.2.28 in /pythonkc_site/requirements Bumps [django](https://github.com/django/django) from 4.2.25 to 4.2.28. - [Commits](https://github.com/django/django/compare/4.2.25...4.2.28) --- updated-dependencies: - dependency-name: django dependency-version: 4.2.28 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pythonkc_site/requirements/project.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 037c874..d026084 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,4 +1,4 @@ -Django==4.2.25 +Django==4.2.28 django-dotenv==1.3.0 django-redis-cache==0.9.2 mimeparse==0.1.3 From 2f0c1f530e8129fdde598a9ac26318fc3e4da161 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 06:21:00 +0000 Subject: [PATCH 48/49] Bump requests from 2.7.0 to 2.32.4 in /pythonkc_site/requirements Bumps [requests](https://github.com/psf/requests) from 2.7.0 to 2.32.4. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.7.0...v2.32.4) --- updated-dependencies: - dependency-name: requests dependency-version: 2.32.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pythonkc_site/requirements/project.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index d026084..653ec09 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -6,4 +6,4 @@ psycopg2==2.6.1 python-dateutil==1.5 pythonkc-meetups==0.1.0 redis==2.10.3 -requests==2.7.0 +requests==2.32.4 From 04686fc5c246ec1010134df4252255f94d580c49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 04:34:48 +0000 Subject: [PATCH 49/49] Bump django from 4.2.28 to 4.2.30 in /pythonkc_site/requirements Bumps [django](https://github.com/django/django) from 4.2.28 to 4.2.30. - [Commits](https://github.com/django/django/compare/4.2.28...4.2.30) --- updated-dependencies: - dependency-name: django dependency-version: 4.2.30 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pythonkc_site/requirements/project.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonkc_site/requirements/project.txt b/pythonkc_site/requirements/project.txt index 653ec09..f109233 100644 --- a/pythonkc_site/requirements/project.txt +++ b/pythonkc_site/requirements/project.txt @@ -1,4 +1,4 @@ -Django==4.2.28 +Django==4.2.30 django-dotenv==1.3.0 django-redis-cache==0.9.2 mimeparse==0.1.3