Git Product home page Git Product logo

django-starter-template's Introduction

django-starter-template

An easy to use project template for Django 1.8 that follows best practices.

Features

Quickstart

First create and activate your virtualenv, you can use virtualenvwrapper. Then install Django 1.8 in your virtualenv:

pip install django==1.8.6

To create a new Django project (make sure to change project_name)

django-admin.py startproject --template=https://github.com/fasouto/django-starter-template/archive/master.zip --extension=py,md,html,txt,less project_name

cd to your project and install the dependences

pip install -r requirements/development.txt

If you need a database, edit the settings and create one with

python manage.py syncdb
python manage.py migrate

Once everything it's setup you can run the development server: http://localhost:8000/

python manage.py runserver

How to use it

Settings

Settings are divided by environments: production.py, development.py and testing.py. By default it uses development.py, if you want to change the environment set a environment variable:

export DJANGO_SETTINGS_MODULE="my_project.settings.production"

or you can use the settings param with runserver:

python manage.py runserver --settings=my_project.settings.production

If you need to add some settings that are specific for your machine, rename the file local_example.py to local_settings.py. This file it's in .gitignore so the changes won't be tracked.

Bootstrap

Bootstrap 3 LESS files are included and compiled with django_compressor. There's an file less/app.less where you should put your CSS to avoid overriding the bootstrap LESS files, so you can update bootstrap easily.

Make sure you have lessc installed on your production server, for development it uses less.js.

Dependencies

There are some requirements files separated by environments (development and production), the requirements.txt in the root folder is needed for Heroku and only installs the production dependencies. In development you should install requirements/development.txt

pip install -r requirements/development.txt

Remember to add the packages you install in your virtual environment to the appropiate requirements file.

If you have trouble/can't install a package place it in the /libs directory.

django-starter-template's People

Contributors

fasouto avatar

Watchers

James Cloos avatar Tarun K. Singhal 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.