Coder Social home page Coder Social logo

vagrant-geodjango-base's Introduction

vagrant-geodjango-base

Forked from the @torchbox vagrant-django-base project, modified to work with GeoDjango.

A Vagrant box based on Ubuntu precise32, configured for GeoDjango development. This box makes it simple to get up and running with the GeoDjango tutorial.

  • postgresql 9.1 (with locale fixed to create databases as UTF-8)
  • PostGIS 2 and tools
  • virtualenv and virtualenvwrapper
  • dependencies for PIL, the Python Imaging Library

This will build GEOS and PostGIS from source, so your first vagrant up might take a while. Port 8000 forwards to 4567 by default.

Getting Started

This section will take you from cloning the repository to being able to start working on the official GeoDjango tutorial.

Vagrant up

If you don't have it installed already, install Vagrant and VirtualBox.

After cloning the repository, cd to the repo directory, and type vagrant up. Wait a while.

After the build has completed, vagrant ssh to get into your machine

Setup database

To create the database for the tutorial:

sudo su - postgres
createdb geodjango

Now, we add the spatial extensions to the "world" database via:

psql geodjango
CREATE EXTENSION postgis;
\q
exit

Setup Django Project

Now, we have a fairly typical Django project to setup:

mkvirtualenv geodjango
workon geodjango
pip install django
pip install psycopg2

You are now ready to pick up the GeoDjango tutorial here. You will use 'postgres' as the DB user in the settings, with an empty password, like so:

DATABASES = {
    'default': {
         'ENGINE': 'django.contrib.gis.db.backends.postgis',
         'NAME': 'geodjango',
         'USER': 'postgres',
     }
}

Be sure to start the server like so:

python manage.py runserver 0.0.0.0:8000

The default server will bind to the loopback interface, adding the argument will allow it to bind to all interfaces.

Enjoy!

Build instructions

To generate the .box file:

./build.sh

To install locally:

vagrant box add django-base-v2 django-base-v2.box

vagrant-geodjango-base's People

Contributors

david-wilson avatar gasman avatar

Watchers

 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.