Git Product home page Git Product logo

django-python3-vagrant-a's Introduction

DEPRECATED! Please read!

This Vagrant box is very out of date. However, I've developed a Vagrant box with some colleagues at work. It is CentOS instead of Ubuntu (since we use RedHat at work), but includes current versions of Python (3.5 and 3.6), PostgreSQL, FreeTDS, and is Ansiblized.

You can see the much improved Vagrant box here:

https://github.com/wharton/python-vagrant-centos7/

django-python3-vagrant with FreeTDS for SQL Server 1.1

Ships with Python 3.4, 2.7, and virtualenvwrapper

This is a Vagrant Ubuntu Linux environment created for Python / Django developers. It should be ready to go for Django development use with a core suite of tools, like virtualenv and virtualenvwrapper, defaulted to Python v3.4. Python 2.7 is only included in case you need it.

Also included is an optional install for FreeTDS and unixODBC, which will allow you to connect to Microsoft SQL Server.

Prerequisites

Installation and Login

Fairly easy to get it running: first, checkout the repository to your machine.

git clone https://github.com/FlipperPA/django-python3-vagrant.git
cd django-python3-vagrant && vagrant up

Then, SSH into your new virtual machine:

vagrant ssh

Installing FreeTDS for SQL Server (Optional)

Run the follow commands to install all pre-requesites and put your configuration files in the proper place.

cd /vagrant/examples
./install-mssql.sh

Next, you need to enter your server information, by editing the following two files:

/etc/freetds/freetds.conf
/etc/odbc.ini

Start Your Django Project

Then following instructions will be included each time you SSH into your guest VM. Starting a Django project (/vagrant on the guest VM with be mounted to the directory with the Vagrantfile where you ran "vagrant up" on your local machine: you will be able to edit files on the local machine in this directory, which will automatically appear in /vagrant on the guest VM):

cd /vagrant/projects
mkvirtualenv django_project
pip install django==1.9
django-admin.py startproject django_project
cd django_project
python manage.py runserver 0.0.0.0:8000

You should now be able to see your initial Django site in a browser:

http://localhost:8000/

Hooking Up Django to SQL Server (Optional)

In your virtualenv, install the required Python packages:

pip install pyodbc==3.0.10
pip install django-pyodbc-azure==1.9.0.1

Then, set up your DATABASES setting in your Django settings file:

DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc',
        'HOST': 'dbserver.domain.com',
        'PORT': '1433',
        'NAME': 'dbname',
        'USER': 'dbuser',
        'PASSWORD': 'dbpassword',
        'AUTOCOMMIT': True,
        'OPTIONS': {
            'driver': 'FreeTDS',
            'unicode_results': True,
            'host_is_server': True,
            'extra_params': 'tds_version=7.2',
        },
    },
}

Setting Up Your Hosts File (optional)

If you'd like to view the site in your browser at an address like http://vagrant:8001/, then on your host machine, add the following to the hosts file:

192.168.99.100  vagrant
  • Mac hosts file location: /private/etc/hosts
  • Windows hosts file location: %SystemRoot%\system32\drivers\etc\hosts

New to Django? Here are some excellent resources, check them out, as one size does not fit all for learning:

v1.1

  • Install Pygments and support for colorize cat command, ccat.
  • Install Ubuntu package pre-requesities for Pillow and Wagtail installation.
  • Latest version of pip installed for Python 3.

v1.0

  • Initial release.

Feel free to reach out to me with any questions. - Tim Allen ([email protected])

django-python3-vagrant-a's People

Contributors

flipperpa avatar adrian-zumbler avatar vladimir-tikhonov avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.