From 2b2aff55d22232d663f1f9de0159cd07ea8fe86c Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Thu, 11 Jun 2015 22:18:54 -0500 Subject: [PATCH 01/18] 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 f673806fbad1dc61bc05db1cca1eed891b5b90c6 Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Sat, 13 Jun 2015 15:04:47 +0000 Subject: [PATCH 02/18] 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 03/18] 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 04/18] 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 05/18] 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 06/18] 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 07/18] 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 08/18] .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 09/18] 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 10/18] 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 11/18] 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 12/18] 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 13/18] 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 14/18] 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 15/18] 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 16/18] 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 17/18] 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 18/18] 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