GabberBaby / django-project-template

Django project layout to quickly start build fantastic websites! (included compass, frontend setup and base Django apps)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django project template

This project template creates a Django 1.5 project with a base set of applications

Features

Installed apps:

Configured URLs:

  • /robots.txt
  • /sitemap.xml
  • /admin/

Templates:

  • base.html
  • 404.html
  • 500.html

Features:

  • Settings package
  • WSGI deployment scripts
  • CSS and JavaScript paths configured
  • HTML5shiv + jQuery Installed
  • Meyer-based CSS reset
  • Working Compass + SASS + LiveReload setup (can be discarded)

Usage

Create a Django project:

mkdir my-website.com
cd my-website.com
django-admin.py startproject mywebsite . -e py,rst,example,gitignore --template=https://github.com/edoburu/django-project-template/archive/master.zip

Alternatively, you can place the files in a src folder too:

mkdir -p my-website.com/src
cd my-website.com
django-admin.py startproject mywebsite src -e py,rst,example,gitignore --template=https://github.com/edoburu/django-project-template/archive/master.zip

This allows you to create folders like docs, web, logs, etc at the toplevel. This setup is recommended.

The remaining instructions - to start the development server - can be found in the generated README.rst file.

Django-fluent template

In a second branch, you'll find a project template for the django-fluent CMS:

mkdir my-website.com
cd my-website.com
django-admin.py startproject mywebsite . -e py,rst,example,gitignore --template=https://github.com/edoburu/django-project-template/archive/django-fluent.zip

Working with SCSS files

As extra treat, the CSS files are easier to edit using SASS and Compass.

It gives these advantages to regular CSS:

  • Variables.
  • Nesting CSS selectors.
  • Default mixins for CSS3 properties and vendor-prefixes.
  • Typography features such as ellipses,
  • Generating sprites, including background-position offsets.

Note

This feature is optional. If you don't like to use it, the project already has a screen.css file which can be used and edited. Feel free to remove those files in your own projects or fork (config.rb, Guardfile, and frontend/sass). However, we highly recommended to take a look at it.

Using compass

Install Compass using:

gem install compass bootstrap-sass oily_png

Leave Compass running in the terminal:

compass watch

It automatically compiles the *.css files for you.

Using guard+livereload

To make it even better, use guard-livereload. Now the browser can automatically refresh all styles inline.

Install guard-livereload using:

gem install guard-livereload guard-compass

Leave it running in the terminal during development:

guard

Install a browser plugin, see:

And toggle the "LiveReload" button in the browser at the desired page.

Each time a change is made in *.scss files, the files are compiled and the browser reloads the CSS file, even without reloading the entire page!


{{ project_name|title }} Project

About

Describe your project here.

Prerequisites

  • Python >= 2.6
  • pip
  • virtualenv (virtualenvwrapper is recommended)

Installation

To setup a local development environment:

mkvirtualenv {{ project_name }}
pip install -r requirements.txt
edit {{ project_name }}/settings/project.py    # Enter your DB credentials
cp {{ project_name }}/settings/local.py.example {{ project_name }}/settings/local.py  # To enable debugging

./manage.py syncdb --migrate
./manage.py runserver

Compiling CSS files

To compile SASS files:

gem install compass bootstrap-sass oily_png guard-livereload guard-compass

guard

To enable LiveReload of *.css files during development, install a browser plugin:

And toggle the "LiveReload" button in the browser at the desired page.

License

Describe project license here.

About

Django project layout to quickly start build fantastic websites! (included compass, frontend setup and base Django apps)