{"id":31738218,"url":"https://github.com/wharton/python-vagrant-centos7","last_synced_at":"2025-10-09T09:59:53.960Z","repository":{"id":48194481,"uuid":"80366570","full_name":"wharton/python-vagrant-centos7","owner":"wharton","description":"A Vagrant box for development on Python 3.6, with many extras for Django 2.x development.","archived":false,"fork":false,"pushed_at":"2021-11-18T14:30:22.000Z","size":1641,"stargazers_count":30,"open_issues_count":1,"forks_count":17,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-03-26T08:12:15.029Z","etag":null,"topics":["ansible","django","mssql","python","vagrant","virtualbox","virtualenv","zappa"],"latest_commit_sha":null,"homepage":"https://github.com/wharton/python-vagrant-centos7","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wharton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-29T19:22:08.000Z","updated_at":"2023-03-28T06:04:45.000Z","dependencies_parsed_at":"2022-09-16T09:40:16.354Z","dependency_job_id":null,"html_url":"https://github.com/wharton/python-vagrant-centos7","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wharton/python-vagrant-centos7","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wharton%2Fpython-vagrant-centos7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wharton%2Fpython-vagrant-centos7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wharton%2Fpython-vagrant-centos7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wharton%2Fpython-vagrant-centos7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wharton","download_url":"https://codeload.github.com/wharton/python-vagrant-centos7/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wharton%2Fpython-vagrant-centos7/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001075,"owners_count":26083022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","django","mssql","python","vagrant","virtualbox","virtualenv","zappa"],"created_at":"2025-10-09T09:59:50.948Z","updated_at":"2025-10-09T09:59:53.955Z","avatar_url":"https://github.com/wharton.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A CentOS 7.6 Vagrant Box with Python 3.6 via Ansible\n\n## Aging Repository Notice\n\nThis repository has not been updated in quite some time. Most developers on our team have moved on to different forms of development: local, WSL-2 Ubuntu, on-server, and Docker. Python 3.6 will shortly be end-of-life. We keep this repository here for reference, but recommend looking for other development solutions.\n\n## What's in the Box\n\n* Apache 2.4, with mod_wsgi for running Django\n* Microsoft ODBC \u0026 FreeTDS drivers for MS SQL Server\n* PostgreSQL Drivers \u0026 Server\n\nThis repository contains a CentOS 7.6 box for Vagrant. Python 3.6 is installed alongside the system Python (2.7.5). The Vagrant config uses Ansible roles to configure the box for the development environment, that should also be (mostly) suitable for setting up a production server. `Cookiecutter` and `Pygments` are installed with the system Python, and bash aliases exist to `venv` for `mkvirtualenv`, `workon` and `cdsitepackages` (for those used to `virtualenvwrapper` shortcuts).\n\nPostgreSQL 10 server is installed locally for full-stack local development. MS SQL is also supported as a Django database backend with either the Microsoft provided ODBC driver or the FreeTDS ODBC Driver to an external SQL Server. `wkhtmltopdf` is installed for compatibility with Python's PDF kit.\n\nDjango 1.11 or greater is recommended at the time of this writing for new projects. Django 1.11 is an LTS (Long Term Support) release, meaning it will be actively supported with bug fixes and security patches until at least April, 2020 (and probably longer): https://www.djangoproject.com/download/#supported-versions\n\n## Compatibility \u0026 Prerequisites to Install\n\n### Windows\n\n* Tested with VirtualBox 6.0.18: https://download.virtualbox.org/virtualbox/6.0.18/VirtualBox-6.0.18-136238-Win.exe\n* Tested with Vagrant 2.2.7: https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.msi\n* Git Bash is highly recommended (instead of the Windows Command Prompt, cmd.exe), which comes with Git for Windows: https://gitforwindows.org/\n* For best performance, ensure that you have virtualization enabled in BIOS (Google it for your machine's model).\n\n### Mac\n\n* Tested with VirtualBox 6.0.8: https://download.virtualbox.org/virtualbox/6.0.8/VirtualBox-6.0.8-130520-OSX.dmg\n* Tested with Vagrant 2.2.5: https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.dmg\n* Git is required: http://git-scm.com/downloads\n\n### Linux\n\n* VirtualBox 6.0.8 can be downloaded here: https://www.virtualbox.org/wiki/Linux_Downloads\n    * Builds are provided for Debian, Ubuntu, openSUSE, Fedora, Oracle Linux, CentOS/RHEL, and vanilla Linux.\n* Vagrant 2.2.5 can be downloaded here: https://www.vagrantup.com/downloads.html\n    * Builds are provided for Debian/Ubuntu, CentOS/RHEL, Arch, and vanilla Linux.\n* On newer machines, ensure that you have virtualization enabled in BIOS (duckduckgo it for your machine's model).\n\n**Fedora 25, CentOS 7**\n\nThese are available via the package manager.\n\n```\n$ sudo dnf install vagrant\n$ sudo dnf install VirtualBox\n```\n\n## Additional Roles Not Installed by Default\n\nThe Ansible playbook for the installation is located at `provisioning/vagrant_playbook.yml`. Several additional roles are commented out that can be added, including `elastic_search`, `redis`, `httpd` (with `httpd_mod_wsgi`), `nodejs`, and a `yum_update` role. These are not included by default, but can be uncommented if you wish you use them.\n\n## Get Started\n\n* Create and add a public SSH key to your git server (GitHub, GitLab, etc).\n* Clone the repository and bring up the virtual development environment. The first time you install the box, \"vagrant up\" will take a little while. Grab a cup of coffee or something!\n* You may want to use a host name for your domain; for example, if you're a member of The Wharton School, you may want to use the command `VAGRANT_HOSTNAME=\"vagrant.wharton.upenn.edu\" vagrant up` below instead of `vagrant up`. If you don't provide a hostname, you will be prompted for one. If you don't have one, feel free to use `vagrant.example.com`.\n* The Vagrant plugin `vagrant-vbguest` will cause problems with the shared folder in most cases. Please uninstall the plugin first if you have it installed with `vagrant plugin uninstall vagrant-vbguest`.\n\n```bash\ngit clone https://github.com/wharton/python-vagrant-centos7.git\ncd python-vagrant-centos7\nvagrant up\nvagrant ssh\n```\n\n**Fedora 25, CentOS 7**\n\nCheck Vagrantfile and make sure the port forwarding settings will work for\nyour use case. You may wish to forward the guest VM port 80 to something\nother than port 80 on the host, e.g. 8888.\n\n``` \nconfig.vm.network \"forwarded_port\", guest: 80, host: 8888, auto_correct: false\n```\n\nReplace the the `vagrant up` line from above with the following.\n\n```\n$ vagrant up --provider=virtualbox \n```\n\nSit back, and let the installation complete.\n\n\n* You can also add the host name to your computer's `hosts` file. Your `hosts` file should be located at:\n\n    * Mac / Linux: /etc/hosts\n    * Windows: %SystemRoot%\\system32\\drivers\\etc\\hosts\n\nAdd this line (with the appropriate host name, if you changed it):\n\n```\n192.168.99.100  vagrant.my.domain.com\n```\n\n### Default installation creates\n\n    default: SSH address: 127.0.0.1:2222\n    default: SSH username: vagrant\n    default: SSH auth method: private key\n\n```\n$ vagrant ssh\n```\n\nAnother, less desirable, option for SSH'ing into the vagrant box..\n(this requires the use of the default password, vagrant)\n\n```\n$ ssh vagrant@vagrant.my.domain.com -p 2222\n```\n\nAt this point, you should change the default password for the vagrant user.\nYou may also want to add/remove users soon.\n\n## Using PostgreSQL \u0026 Creating a New Database for a Django Project\n\nThe Vagrant box comes with PostgreSQL 9.6. The `vagrant` user is set up as a PostgreSQL superuser (in addition to the `postgres` user).\n\n```\n$ psql\npsql (10.7)\nType \"help\" for help.\n\nvagrant=# \\?\n...\nvagrant=# CREATE USER my_django_user WITH PASSWORD 'my_django_password';\nCREATE ROLE\nvagrant=# CREATE DATABASE my_django_db WITH OWNER my_django_user;\nCREATE DATABASE\nvagrant=# \\q\n```\n\n## Setting Up Django \u0026 virtualenv\n\nFirst, change to the directory set aside to hold user projects.\n\n```\n$ cd projects\n```\n\nNext, create a new virtual environment for your Django project:\n\n```\n$ mkvirtualenv django-project\n```\n\nNext, within this virtualenv, install `django`, `django-extensions`, and `pygraphviz`:\n\n```\n(django-project) [vagrant@vagrant django-project]$ pip install django django-extensions pygraphviz\n```\n\nNow, create a new Django project and enter its directory:\n\n```\n(django-project) [vagrant@vagrant django-project]$ django-admin startproject myproject\n(django-project) [vagrant@vagrant django-project]$ cd myproject\n```\n\n## Creating ERDs of Django Models\n\nThe `django-extensions` app can build handy Entity Relationship Diagrams for Django apps, even your entire project. The pre-requisites for the Python packages are included with this Vagrant box.\n\n![An example ERD with three Django apps.](assets/users-faculty-courses.png)\n\nFirst, within your Django project's virtualenv, install `django-extensions` and `pygraphviz`:\n\n```\n (django-project) [vagrant@vagrant django-project]$ pip install django-extensions pygraphviz\n```\n\nNext, add `django_extensions` to your `INSTALLED_APPS`. Then you can create the diagrams; to create a PNG of all models in your Django project.\n\n```\n$ ./manage.py graph_models -a -g -o project-erd.png\n```\n\nOr, to just do a few Django apps:\n\n```\n$ ./manage.py graph_models users faculty courses -g -o users-faculty-courses.png\n```\n\n## Windows 10: Forwarding Port 80 for Testing Apache\n\nIn Windows 10, the \"World Wide Web Publishing Service\" automatically starts on port 80. You can disable it so Vagrant can forward port 80.\n\n* Click Start, type \"Services\" and open Services.\n* Scroll down to World Wide Web Publishing Service. Right click and go into Properties.\n* Change \"Startup type\" to be Manual.\n* Click the \"Stop\" button.\n* Click \"OK\".\n\nMaintainer:\n\n* Tim Allen (https://github.com/FlipperPA)\n\nContributors:\n\n* Jane Eisenstein (https://github.com/janeeisenstein)\n* Gavin Burris (https://github.com/00gavin)\n* Dave Roller (https://github.com/rollerwhrtn)\n* Shawn Zamechek (https://github.com/shawnzam/)\n* Todd Seidelmann (https://github.com/seidelma/)\n* Brian Jopling\n* Clay Wells\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwharton%2Fpython-vagrant-centos7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwharton%2Fpython-vagrant-centos7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwharton%2Fpython-vagrant-centos7/lists"}