GithubHelp home page GithubHelp logo

telemakhos / django-salted Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wunki/django-salted

0.0 1.0 0.0 140 KB

Full stack SaltStack configuration for Django with the help of Vagrant.

License: BSD 3-Clause "New" or "Revised" License

django-salted's Introduction

Django Salted

One-command Django and PostgreSQL development environment on Vagrant.

Shake it, shake it, shake it like a salt shaker...

This is a complete SaltStack configuration for a Django centric stack. It enables you setup a solid Django development environment with a single command. Some of the great things which are included:

  • Local development, but the code is run within Ubuntu with the help of a share.
  • Server running on uWSGI and Nginx. uWSGI reloads your python code automagically.
  • PostgreSQL is installed and setup for you. No more explaining to your designer how to get the project running.
  • Some helpfull Fabric functions, e.g., running syncdb on Vagrant.

Table of Contents

The repository is accomponied with a blog post we put on Gibbon. Go read Salting your Django Stack if you want to know how this came to be.

Requirements

Django salted requires the following software to be installed on your machine:

You also need Fabric and Fabtools if you want to run the Fabric commands. You can find these requirements in the requirements.txt file in the root directory.

All of the above are open-source and free to use.

Getting started (quick)

If you want to quickly try out what this is all about. Your installation will adhere to the default configuration and use the example Django project. If you have the requirements installed, it's just a single command:

vagrant up

After running this command, you should see the Django example website on: http://127.0.0.1:8080/. However, your database tables still need to be created. There is a fabric command to help you with that:

fab vagrant syncdb

You will also need to collect the static files to use the demo project. This can be done with fabric also:

fab vagrant collectstatic

The demo_project is a very simple project with the Djagno Admin http://127.0.0.1:8080/admin

The vagrant machine uses a virtual venvironment located at /home/vagrant/env

After getting familiar with it, using Django Salted on your own project is simple done with changing a few settings.

  • You will run and develop on the Django (1.5.1) demo_project inside the VM.
  • Ubuntu 12.04 will be used as OS.
  • Domain is: vagrant.django-salted.org

Modify for your own project

TODO: Write how to modify this repository for your own project.

FAQ

How do I get the get the latest state/version?

The fastest way is to run vagrant provision. The downfall is that you don't see what's happening in colors. Or SSH to the box (my favourite) by doing the following:

vagrant ssh
# On the box...
sudo salt-call state.highstate

Which Operating Systems are supported?

Currently I have only tested it on Ubuntu 12.04 box. In the future there will be support for Debian and FreeBSD.

I'm getting "502 Bad Gateway" from Nginx

Ajj! This means uWSGI is down. It takes 15 seconds for uWSGI to spin up from a cold boot (because we have to wait on the Vagrant share). However, if after 15 seconds it's still not working, check out what went wrong by looking at the logs:

vagrant ssh
sudo cat /var/log/uwsgi/example.log
# or check the boss (emperor)
sudo cat /var/log/uwsgi/emperor.log

Let me know in an issue if this is something I need to fix.

OMG, you also put the private key on Github?

Yes, this private key is used for the Vagrant example project. It's supposed to be there so you can spin up a box with a single command. Don't put your own private keys there.

Want to help?

That would be great! Check out the TODO.org or the Issues on things to do.

License

Django-salted was created by Petar Radosevic. You can reach out to me on twitter at @wunki.

It's BSD Licensed. Use it however you want, just don't try to sell it back to me.

django-salted's People

Contributors

wunki avatar pxg avatar

Watchers

James Cloos 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.