Coder Social home page Coder Social logo

suqi / django-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lionheart/django-template

0.0 1.0 0.0 586 KB

A flexible Django 1.4-1.9 project template with configurations for EC2, Heroku, App Engine, and Docker.

Python 52.81% Shell 34.51% Ruby 0.75% JavaScript 0.99% HTML 10.93%

django-template's Introduction

For information on how to use this project template, check out the wiki.

Installation

You've cloned the repo or started a new project with the startproject command. Here's how you actually get started developing. These steps assume you have pip installed.

  1. Install virtualenv.

     pip install virtualenv
    
  2. Then, start a virtualenv in the project directory.

     $ virtualenv venv
     $ . venv/bin/activate
    
  3. Install the project requirements.

     ({{ project_name }}) $ pip install -r requirements.txt
     # wait for a couple of minutes, hopefully nothing goes wrong!
    
  4. Link the local project settings to local_settings.py.

     ({{ project_name }}) $ ln -s conf/settings/local.py local_settings.py
    
  5. Create your local database. Make sure you run the steps below if you haven't already installed PostgreSQL.

     $ psql
     postgres# CREATE ROLE {{ project_name }}_local WITH LOGIN ENCRYPTED PASSWORD '{{ project_name }}_local';
     postgres# CREATE DATABASE {{ project_name }}_local WITH OWNER {{ project_name }}_local;
    

    Note: If you get a psql: FATAL: role "YOUR_USERNAME" does not exist error, just do the following to save yourself from having to write --user postgres every time you want to run psql. If, say, your username is dan on your development machine, you'd run the following:

     $ createuser -s dan # Create a superuser named `dan`
     $ createdb -O dan dan # Create a database for this user to log into.
    

    After doing this, re-run the psql commands in step 5.

  6. Make manage.py executable and run migrations.

     ({{ project_name }}) $ chmod +x manage.py
     ({{ project_name }}) $ ./manage.py migrate
    
  7. Set up the Git hooks.

     $ git_config/configure.sh
    
  8. Start the local development server.

     ({{ project_name }}) $ ./manage.py runserver
     Performing system checks...
    
     September 17, 2014
     Django version 1.9.6, using settings 'settings'
     Starting development server at http://127.0.0.1:8000/
     Quit the server with CONTROL-C.
    

Map "local.{{ project_name }}.com" to 127.0.0.0 using DNS. If you haven't yet registered a domain, add the following line to your /etc/hosts file.

127.0.0.1 local.{{ project_name }}.com

After you've done that, open your browser and navigate to "[local.{{ project_name }}.com](http://local.{{ project_name }}.com)". Your project is now running!

PostgreSQL Installation

If you're on a Mac and have Homebrew installed, we'll keep it simple.

brew install postgresql

If you're in the mood for a longer read or have run into issues, here's a good article on how to install PostgreSQL on your system (covers Mac OS X, Windows, and Ubuntu).

django-template's People

Contributors

dlo avatar eolszewski avatar

Watchers

Matt Su 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.