Giter VIP home page Giter VIP logo

django-base-project's Introduction

README

This project was heavily influenced by the django-twoscoops-project that can be found at https://github.com/twoscoops/django-twoscoops-project

Getting Started

You'll need to setup your virtual environment first, and I recommend using virtualenvwrapper. So, go ahead ahead and create your virtual environment

    # First create your project directory:
    mkdir foobar && cd foobar

    # And then make your virtual environment
    mkvirtualenv foobar
    
    # The virtual environment will already be activated, but in the 
    # future to switch to this environment you'll need to do
    workon foobar
    
    # Install django into your virtual environment
    pip install django==1.5.1
    

When starting a new Django project, use the --template and --extension args to django-admin.py. For example, to create a new project called foobar you can do something like this:

    django-admin.py startproject \
      --template=https://github.com/abemusic/django-base-project/archive/master.zip \
      --extension=py,rst,html foobar .

This basically tells django to create a new project called foobar in the current directory and use a project template from the zip file on github. The extension argument instructs django to treat any files with the .py, .rst, and .html extension as templates and render them with a particular context. For example, the HTML files might reference a variable called {{ project_name }}, and django would render that as foobar in this case. For more information on starting a new project or app using templates, see the documentation at https://docs.djangoproject.com/en/dev/ref/django-admin/#startproject-projectname-destination

Now that you have a virtualenv and a foobar Django project, you can get started on your next awesome app. Some things that might be of interest in this template:

  • My requirements files to work with my common setup, so YMMV. It should even work on heroku as well. To install packages from a requirements file in your virtualenv, use pip with the -r argument and point it to the file:

    # For development, use the local requirements file
    pip install -r requirements/local.txt
  • I've updated django settings to pull 'secret' stuff from environment variables, so you'll need to include these in your environment. I suggest not adding them to your .bash_profile or .bashrc, but instead take advantage of virtualenv-wrappers postactivate script that's located in your virtualenv's bin directory. You can quickly get to that locacation by typing cdvirtualenv. There's a template of a common script I use in etc/postactivate

  • Database configuration is using the dj-database-url utility to create the database dictionary from a URI string that's pulled from the DATABASE_URL environment variable.

django-base-project's People

Contributors

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