├── .gitignore ├── .travis.yml ├── README.md ├── fabfile ├── __init__.py ├── build.py ├── deploy.py ├── dev.py └── other.py ├── lib ├── README.md ├── __init__.py ├── gzip_assets.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ ├── csv_to_model.py │ │ ├── geo.py │ │ ├── load_raw_model.template │ │ └── rserver.py ├── models.py ├── serializer.py └── utils.py ├── manage.py ├── project_name ├── __init__.py ├── apps │ └── __init__.py ├── gzip │ └── temp ├── settings │ ├── __init__.py │ ├── common.py │ ├── local_settings.template │ └── production.py ├── urls.py └── wsgi.py ├── requirements ├── base.txt └── python2.txt └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | django.log 3 | django.log* 4 | bower_components 5 | node_modules 6 | .DS_Store 7 | .coverage 8 | data/ 9 | # local settings 10 | */settings/local_settings.py 11 | 12 | build/ 13 | gzip/ 14 | static/ 15 | 16 | # ignore the css file 17 | */assets/styles/*.css 18 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - '2.7' 4 | - '3.4' 5 | install: 6 | - pip install django 7 | - django-admin.py startproject --extension=py,.gitignore --template=https://github.com/cirlabs/django-project-template/archive/master.zip aproject 8 | - cd aproject 9 | - if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install -r requirements/python2.txt; fi 10 | - pip install -r requirements/base.txt 11 | script: 12 | - pep8 lib 13 | - pep8 --ignore=E121,E123,E126,E226,E24,E704,E402 fabfile 14 | - pyflakes lib 15 | - coverage run setup.py test 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This project has been deprecated and was archived July 2022. 2 | 3 | --- 4 | 5 | 6 | # Django Project Template [![Build Status](https://secure.travis-ci.org/cirlabs/django-project-template.png?branch=master)](http://travis-ci.org/cirlabs/django-project-template) [![GitHub version](https://badge.fury.io/gh/cirlabs%2Fdjango-project-template.svg)](http://badge.fury.io/gh/cirlabs%2Fdjango-project-template) 7 | 8 | Django Project Template is a collection of development tasks and optimizations aimed at anyone doing news application development on tight deadlines in Django. Highlights include: 9 | 10 | - Works with our custom built [Yeoman generator](https://github.com/cirlabs/generator-newsapp) for even faster front-end scaffolding, development and optimization with [Grunt](http://gruntjs.com/) and [Bower](http://bower.io/) (__recommended__) 11 | - [PostGIS](http://postgis.net/) setup for geospatial database work 12 | - [Fabric](http://www.fabfile.org/) tasks for development, building and deployment 13 | - Preconfigured with [Django Compressor](http://django-compressor.readthedocs.org/en/latest/) for CSS and JS preprocessing, concatenation and minification 14 | - Preconfigured deploy chain for baking projects flat with [Django Bakery](http://django-bakery.readthedocs.org/en/latest/) 15 | - [Boto](http://docs.pythonboto.org/en/latest/) configuration for easy deployment to [Amazon S3](https://aws.amazon.com/s3/) 16 | - `lib` directory with some of our favorite code snippets and custom Django mangement commands 17 | 18 | ## Minimum Requirements 19 | This project supports Ubuntu Linux 14.04 and Mac OS X Yosemite. It is not tested or supported for the Windows OS. 20 | 21 | - [Django 1.7+](https://www.djangoproject.com/) 22 | - [PostgreSQL 9.3+](http://www.postgresql.org/) 23 | - [PostGIS 2.1+](http://postgis.net/) 24 | - [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/en/latest/) 25 | - (optional) [Node.js 0.12.x](http://nodejs.org/) or [io.js 1.2.x](https://iojs.org/en/index.html) 26 | 27 | ## Quickstart 28 | ```bash 29 | $ mkvirtualenv project_name 30 | $ pip install django fabric 31 | $ django-admin.py startproject --extension=py,.gitignore --template=https://github.com/cirlabs/django-project-template/archive/master.zip project_name 32 | $ cd project_name 33 | $ fab bootstrap # bootstrap project 34 | ``` 35 | 36 | ### Using Yeoman, Grunt and Bower (__recommended__) 37 | While this template works fine out the box, it's recommended you use use our yeoman generator to manage your static assets (HTML, CSS, JS). We built [generator-newsapp](https://github.com/cirlabs/generator-newsapp) to work in concert with this project template. For this to work you'll need [Node.js 0.12.x](http://nodejs.org/) or [io.js 1.2.x](https://iojs.org/). 38 | 39 | After running the quick start above run `fab scaffold` to install the required node.js libraries and generate the templates needed for frontend development. 40 | 41 | **Note**: If you already have the npm modules installed, you can skip installing them by running `fab scaffold:skip-install`. 42 | 43 | ## Deployment 44 | This project assumes you have an Amazon S3 bucket where you host your apps. They are static apps with no database calls. 45 | 46 | Update `settings/production.py` with the various s3 buckets you'll use. We have buckets for staging (testing the application), buckets for media assets and a final bucket publishing. You can use these conventions or change them. You'll also need to add the [Django Bakery views](http://django-bakery.readthedocs.org/en/latest/gettingstarted.html#configuration) you want generated. 47 | 48 | You'll also need to create a `settings/local_settings.py` file with your AWS secret key and ID. By default this file __will not__ be checked into version control. Keep it that way just in case your open source your project. This ensures you keys won't leak out to the world. 49 | 50 | With those files configured, run `fab deploy` to publish your application to the world. 51 | 52 | #### On database- and server-powered applications 53 | You can certainly use this template for dynamic applications that use a live server and a database, but currently there is no deployment chain pre-configured at this time. 54 | 55 | ### PostGIS 56 | By default, this project assumes you'll be using PostGIS as your database. If you'd prefer not to, you can set the `USE_POSTGIS` variable in `settings/common.py` to `False` and the project will default to PostgreSQL. :warning: Be sure to do this BEFORE running the quickstart. 57 | 58 | ### Tasks 59 | Here are the various fabric tasks included in the project. See [fabfile.org](http://fabfile.org) to learn more about Fabric and Python task execution. 60 | 61 | ``` 62 | bootstrap DEFAULT: Run commands to setup a new project 63 | bower usage: fab bower:, ,