Giter Site home page Giter Site logo

django-project-template's Introduction

{% if False %} Installation ------------

To start a new project with this template:

django-admin.py startproject --template=https://github.com/caktus/django-project-template/zipball/master --extension=py,rst <project_name>

{% endif %}

{{ project_name|title }}

Below you will find basic setup and deployment instructions for the {{ project_name }} project. To begin you should have the following applications installed on your local development system:

- Python >= 2.6 (2.7 recommended)
- `pip >= 1.1 <http://www.pip-installer.org/>`_
- `virtualenv >= 1.7 <http://www.virtualenv.org/>`_
- `virtualenvwrapper >= 3.0 <http://pypi.python.org/pypi/virtualenvwrapper>`_
- Postgres >= 8.4 (9.1 recommended)
- git >= 1.7

The deployment uses SSH with agent forwarding so you'll need to enable agent forwarding if it is not already by adding ForwardAgent yes to your SSH config.

Getting Started

To setup your local environment you should create a virtualenv and install the necessary requirements:

mkvirtualenv --distribute {{ project_name }}
$VIRTUAL_ENV/bin/pip install -r $PWD/requirements/dev.txt

Then create a local settings file and set your DJANGO_SETTINGS_MODULE to use it:

cp {{ project_name }}/settings/local.example.py {{ project_name }}/settings/local.py
echo "export DJANGO_SETTINGS_MODULE={{ project_name }}.settings.local" >> $VIRTUAL_ENV/bin/postactivate
echo "unset DJANGO_SETTINGS_MODULE" >> $VIRTUAL_ENV/bin/postdeactivate

Exit the virtualenv and reactivate it to activate the settings just changed:

deactivate
workon {{ project_name }}

Create the Postgres database and run the initial syncdb/migrate:

createdb -E UTF-8 {{ project_name }}
python manage.py syncdb
python manage.py migrate

You should now be able to run the development server:

python manage.py runserver

Deployment

You can deploy changes to a particular environment with the deploy command. This takes an optional branch name to deploy. If the branch is not given, it will use the default branch defined for this environment in env.branch:

fab staging deploy
fab staging deploy:new-feature

New requirements or South migrations are detected by parsing the VCS changes and will be installed/run automatically.

django-project-template's People

Contributors

copelco avatar daaray avatar dpoirier avatar mlavin 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.