GithubHelp home page GithubHelp logo

my-agenda's Introduction

Introduction

Building an REST API with Django using Vagrant and Puppet or standalone on Ubuntu 14.04.

Without vagrant

  1. Install mysql server
  2. Install python and pip
  3. Install virtualenv and virtualenvwrapper
  4. Create a virtualenv
  5. Activate the virtualenv with the following command
  • source (virtualenv)/bin/activate
  1. Run the command: pip install -r puppet/provision/modules/language/files/local.txt
  2. Verify all the packages with yolk: yolk -l
  3. Modify manage.py like 'Run the application' section

Using Vagrant

Prerequisites

Modules for puppet:

  • puppetlabs-apache v1.5.0
  • puppetlabs-apt v2.1.1
  • puppetlabs-mysql v3.4.0
  • puppetlabs-reboot v1.1.0

To install puppet modules, execute the following command:

  • puppet module install puppetlabs-apache
  • puppet module install puppetlabs-apt
  • puppet module install puppetlabs-mysql
  • puppet module install puppetlabs-reboot

To install vagrant plugins, execute the following command:

  • vagrant plugin install vagrant-bindfs
  • vagrant plugin install vagrant-puppet-install
  • vagrant plugin install vagrant-vbguest

Getting Started

This is a fairly simple project to get up and running. The procedure for starting up is as follows:

  1. Clone the project. (There’s only master branch.)
  2. Modify parameters in config.yaml such as:
  • USER
  • PASSWORD
  • PROJECT
  • DOMAIN_NAME
  • HOSTNAME
  • public_ip according your network connection.
  1. Run the command vagrant up from the directory

For standalone configuration: 4. Open your browser to http://localhost:8000 For vagrant configuration: 4. Open your browser to http://localhost:9834

Run the application

  1. Modify the following line at manage.py:
  • os.environ.setdefault("DJANGO_SETTINGS_MODULE", "agenda.settings") For local development:
  • os.environ.setdefault("DJANGO_SETTINGS_MODULE", "agenda.settings.local") For production:
  • os.environ.setdefault("DJANGO_SETTINGS_MODULE", "agenda.settings.production")

For changing this manual change, we need to use virtualenvwrapper.

  1. For running the application the first time: python manage.py migrate

  2. For running django server python manage.py runserver 0.0.0.0:8000

Heroku Deployment Supported

Added the require files to deploy on Heroku:

  • requirements.txt
  • Procfile

On Heroku:

  • heroku config:set DJANGO_SETTINGS_MODULE=agenda.settings.production

Config mysql database:

  • heroku addons:create cleardb:ignite
  • heroku config | grep CLEARDB_DATABASE_URL

Copy the message result:

  • heroku config:set DATABASE_URL='mysql://xxxxxxxx:yyyyyy@zzzzzzzz/heroku_db?reconnect=true'

Create super user:

  • heroku run python manage.py createsuperuser

my-agenda's People

Contributors

infojasyrc 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.