Skip to content

Instantly share code, notes, and snippets.

@trey
Last active January 27, 2016 22:13

Revisions

  1. trey revised this gist Jan 20, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion django_2012.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    <div style="font-size:20px;color:red;">This is a little out of date. Be sure to check [the Heroku docs](https://devcenter.heroku.com/articles/django) for the latest and greatest.</div>
    # This is a little out of date. Be sure to check [the Heroku docs](https://devcenter.heroku.com/articles/django) for the latest and greatest.

    ---

    # How to start a Django project in 2012
    ## (and deploy to Heroku)
  2. trey revised this gist Jan 20, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    <div style="font-size:20px;color:red;">This is a little out of date. Be sure to check [the Heroku docs](https://devcenter.heroku.com/articles/django) for the latest and greatest.</div>

    # How to start a Django project in 2012
    ## (and deploy to Heroku)

  3. trey revised this gist Oct 14, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -74,6 +74,8 @@ import dj_database_url
    DATABASES = {'default': dj_database_url.config(default='postgres://localhost/[whatever]')}
    ```

    If you want to sync your local database with Heroku, see [this post](https://gist.github.com/3889821).

    Now go make something awesome.

    ## Deploy to Heroku
  4. trey revised this gist Oct 14, 2012. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -4,13 +4,14 @@
    First, warm up your system.

    ``` bash
    $ easy_install pip
    $ pip install virtualenv
    $ pip install django
    $ gem install heroku
    $ easy_install pip (may need sudo)
    $ pip install virtualenv (may need sudo)
    $ pip install django (may need sudo)
    $ brew install postgresql
    ```

    Then be sure to follow the instructions for finishing the postres setup.

    Start a project.

    ``` bash
  5. trey revised this gist Jul 22, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion django_2012.md
    Original file line number Diff line number Diff line change
    @@ -66,7 +66,7 @@ Create a database for local use.
    createdb [whatever]
    ```

    Add the following to the end of you `settings.py` file:
    Add the following to the end of your `settings.py` file:

    ``` python
    import dj_database_url
  6. trey revised this gist Jul 22, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -63,14 +63,14 @@ Don't forget to add `ve` to your `.gitignore` file.
    Create a database for local use.

    ``` bash
    createdb [appname]
    createdb [whatever]
    ```

    Add the following to the end of you `settings.py` file:

    ``` python
    import dj_database_url
    DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
    DATABASES = {'default': dj_database_url.config(default='postgres://localhost/[whatever]')}
    ```

    Now go make something awesome.
  7. trey revised this gist Jul 22, 2012. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -50,9 +50,17 @@ INSTALLED_APPS = (
    ...
    ```

    Database settings for local development and Heroku
    Make `.manage.py` executable (so you don't have to type `python manage.py ...` all the time).

    ``` bash
    $ chmod +x manage.py
    ```

    Don't forget to add `ve` to your `.gitignore` file.

    ## Database settings for local development and Heroku

    Create a database for local use:
    Create a database for local use.

    ``` bash
    createdb [appname]
    @@ -65,14 +73,6 @@ import dj_database_url
    DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
    ```

    Make `.manage.py` executable (so you don't have to type `python manage.py ...` all the time).

    ``` bash
    $ chmod +x manage.py
    ```

    Don't forget to add `ve` to your `.gitignore` file.

    Now go make something awesome.

    ## Deploy to Heroku
  8. trey revised this gist Jul 22, 2012. 1 changed file with 14 additions and 9 deletions.
    23 changes: 14 additions & 9 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,7 @@ $ easy_install pip
    $ pip install virtualenv
    $ pip install django
    $ gem install heroku
    $ brew install postgresql
    ```

    Start a project.
    @@ -29,7 +30,7 @@ $ source ve/bin/activate
    Install some things into your virtualenv.

    ``` bash
    $ pip install Django psycopg2 south
    $ pip install Django psycopg2 south dj-database-url
    ```

    Now load the exact version into a `requirements.txt` file.
    @@ -49,14 +50,19 @@ INSTALLED_APPS = (
    ...
    ```

    Setup SQLite for local development. Also in `settings.py`:
    Database settings for local development and Heroku

    Create a database for local use:

    ``` bash
    createdb [appname]
    ```

    Add the following to the end of you `settings.py` file:

    ``` python
    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': 'development.sqlite',
    ...
    import dj_database_url
    DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
    ```

    Make `.manage.py` executable (so you don't have to type `python manage.py ...` all the time).
    @@ -72,7 +78,7 @@ Now go make something awesome.
    ## Deploy to Heroku

    ``` bash
    $ heroku create --stack cedar
    $ heroku create
    $ git push heroku master
    $ heroku run ./manage.py syncdb
    $ heroku open
    @@ -115,7 +121,6 @@ $ ./manage.py runserver

    ### Sources

    - [Deploying Django applications on Heroku](http://offbytwo.com/2012/01/18/deploying-django-to-heroku.html)
    - [Part 1: The Basics &mdash; South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html)
    - [Getting Started with Django on Heroku/Cedar | Heroku Dev Center](https://devcenter.heroku.com/articles/django)

  9. trey revised this gist May 7, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ $ virtualenv --no-site-packages ve
    $ source ve/bin/activate
    ```

    (`ve` for virtualenv isn't that nice and terse? You can call it whatever you want.)
    (`ve` for virtualenv. Isn't that nice and terse? You can call it whatever you want.)

    Install some things into your virtualenv.

    @@ -74,7 +74,7 @@ Now go make something awesome.
    ``` bash
    $ heroku create --stack cedar
    $ git push heroku master
    $ heroku run python manage.py syncdb
    $ heroku run ./manage.py syncdb
    $ heroku open
    ```

  10. trey revised this gist May 4, 2012. 1 changed file with 0 additions and 93 deletions.
    93 changes: 0 additions & 93 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -32,87 +32,6 @@ Install some things into your virtualenv.
    $ pip install Django psycopg2 south
    ```

    ([psycopg2](http://initd.org/psycopg/) is a PostgreSQL adapter for Python.)

    Now load the exact version into a `requirements.txt` file.

    ``` bash
    $ pip freeze > requirements.txt
    ```

    Put `south` in your `INSTALLED_APPS` in `settings.py`.

    ``` python
    INSTALLED_APPS = (
    'south',
    ...
    ```

    Setup SQLite for local development. Also in `settings.py`:

    ``` python
    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': 'development.sqlite',
    ...
    ```

    Make `.manage.py` executable (so you don't have to type `python manage.py ...` all the time).

    ``` bash
    $ chmod +x manage.py
    ```

    Don't forget to add `ve` to your `.gitignore` file.

    Now go make something awesome.

    ## Deploy to Heroku

    ``` bash
    $ heroku create --stack cedar
    $ git push heroku master
    $ heroku run python manage.py syncdb
    $ heroku open
    ```

    ## Update your database with [South][south] and push the changes to Heroku

    1. Make changes to your models# How to start a Django project in 2012
    ## (and deploy to Heroku)

    First, warm up your system.

    ``` bash
    $ easy_install pip
    $ pip install virtualenv
    $ pip install django
    $ gem install heroku
    ```

    Start a project.

    ``` bash
    $ django-admin.py startproject [myproject]
    $ cd !$
    ```

    Setup virtualenv and start it up.

    ``` bash
    $ virtualenv --no-site-packages ve
    $ source ve/bin/activate
    ```

    (`ve` for virtualenv isn't that nice and terse? You can call it whatever you want.)

    Install some things into your virtualenv.

    ``` bash
    $ pip install Django psycopg2 south
    ```

    Now load the exact version into a `requirements.txt` file.

    ``` bash
    @@ -200,16 +119,4 @@ $ ./manage.py runserver
    - [Part 1: The Basics &mdash; South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html)
    - [Getting Started with Django on Heroku/Cedar | Heroku Dev Center](https://devcenter.heroku.com/articles/django)

    [south]: http://south.aeracode.org/
    2. `$ ./manage.py schemamigration [appname] --auto`
    3. `$ ./manage.py migrate [appname]`
    4. [commit & push changes to heroku]
    5. `$ heroku run ./manage.py migrate [appname]`

    ### Sources

    - [Deploying Django applications on Heroku](http://offbytwo.com/2012/01/18/deploying-django-to-heroku.html)
    - [Part 1: The Basics &mdash; South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html)
    - [Getting Started with Django on Heroku/Cedar | Heroku Dev Center](https://devcenter.heroku.com/articles/django)

    [south]: http://south.aeracode.org/
  11. trey revised this gist May 4, 2012. 1 changed file with 2 additions and 14 deletions.
    16 changes: 2 additions & 14 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -32,24 +32,12 @@ Install some things into your virtualenv.
    $ pip install Django psycopg2 south
    ```

    Now load the exact version into a `requirements.txt` file.

    ``` bash
    $ pip freeze > requirements.txt
    ```

    Now when someone else sets up this project or you load it on another computer, you'd one command away from an updated setup:

    ``` bash
    $ pip install -r requirements.txt
    ```

    ([psycopg2](http://initd.org/psycopg/) is a PostgreSQL adapter for Python.)

    While you're still inside of your virtualenv, load your requirements.
    Now load the exact version into a `requirements.txt` file.

    ``` bash
    $ pip install -r requirements.txt
    $ pip freeze > requirements.txt
    ```

    Put `south` in your `INSTALLED_APPS` in `settings.py`.
  12. trey revised this gist May 4, 2012. 1 changed file with 121 additions and 0 deletions.
    121 changes: 121 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -52,6 +52,88 @@ While you're still inside of your virtualenv, load your requirements.
    $ pip install -r requirements.txt
    ```

    Put `south` in your `INSTALLED_APPS` in `settings.py`.

    ``` python
    INSTALLED_APPS = (
    'south',
    ...
    ```

    Setup SQLite for local development. Also in `settings.py`:

    ``` python
    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': 'development.sqlite',
    ...
    ```

    Make `.manage.py` executable (so you don't have to type `python manage.py ...` all the time).

    ``` bash
    $ chmod +x manage.py
    ```

    Don't forget to add `ve` to your `.gitignore` file.

    Now go make something awesome.

    ## Deploy to Heroku

    ``` bash
    $ heroku create --stack cedar
    $ git push heroku master
    $ heroku run python manage.py syncdb
    $ heroku open
    ```

    ## Update your database with [South][south] and push the changes to Heroku

    1. Make changes to your models# How to start a Django project in 2012
    ## (and deploy to Heroku)

    First, warm up your system.

    ``` bash
    $ easy_install pip
    $ pip install virtualenv
    $ pip install django
    $ gem install heroku
    ```

    Start a project.

    ``` bash
    $ django-admin.py startproject [myproject]
    $ cd !$
    ```

    Setup virtualenv and start it up.

    ``` bash
    $ virtualenv --no-site-packages ve
    $ source ve/bin/activate
    ```

    (`ve` for virtualenv isn't that nice and terse? You can call it whatever you want.)

    Install some things into your virtualenv.

    ``` bash
    $ pip install Django psycopg2 south
    ```

    Now load the exact version into a `requirements.txt` file.

    ``` bash
    $ pip freeze > requirements.txt
    ```

    ([psycopg2](http://initd.org/psycopg/) is a PostgreSQL adapter for Python.)


    Put `south` in your `INSTALLED_APPS` in `settings.py`.

    ``` python
    @@ -97,6 +179,45 @@ $ heroku open
    4. [commit & push changes to heroku]
    5. `$ heroku run ./manage.py migrate [appname]`

    ## Working on your project later

    Whenever you work on your project, you'll want to activate your virtualenv:

    ``` bash
    $ source ve/bin/activate
    ```

    Then load any new requirements:

    ``` bash
    $ pip install -r requirements.txt
    ```

    Sync and/or migrate your database:

    ``` bash
    $ ./manage.py syncdb
    $ ./manage.py migrate [appname]
    ```

    Finally, fire up your server:

    ``` bash
    $ ./manage.py runserver
    ```

    ### Sources

    - [Deploying Django applications on Heroku](http://offbytwo.com/2012/01/18/deploying-django-to-heroku.html)
    - [Part 1: The Basics &mdash; South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html)
    - [Getting Started with Django on Heroku/Cedar | Heroku Dev Center](https://devcenter.heroku.com/articles/django)

    [south]: http://south.aeracode.org/
    2. `$ ./manage.py schemamigration [appname] --auto`
    3. `$ ./manage.py migrate [appname]`
    4. [commit & push changes to heroku]
    5. `$ heroku run ./manage.py migrate [appname]`

    ### Sources

    - [Deploying Django applications on Heroku](http://offbytwo.com/2012/01/18/deploying-django-to-heroku.html)
  13. trey revised this gist May 4, 2012. 1 changed file with 15 additions and 5 deletions.
    20 changes: 15 additions & 5 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -26,12 +26,22 @@ $ source ve/bin/activate

    (`ve` for virtualenv isn't that nice and terse? You can call it whatever you want.)

    Create a `requirements.txt` file and put this stuff in it.
    Install some things into your virtualenv.

    ``` bash
    $ pip install Django psycopg2 south
    ```

    Now load the exact version into a `requirements.txt` file.

    ``` bash
    $ pip freeze > requirements.txt
    ```
    Django
    psycopg2
    south

    Now when someone else sets up this project or you load it on another computer, you'd one command away from an updated setup:

    ``` bash
    $ pip install -r requirements.txt
    ```

    ([psycopg2](http://initd.org/psycopg/) is a PostgreSQL adapter for Python.)
    @@ -93,4 +103,4 @@ $ heroku open
    - [Part 1: The Basics &mdash; South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html)
    - [Getting Started with Django on Heroku/Cedar | Heroku Dev Center](https://devcenter.heroku.com/articles/django)

    [south]: http://south.aeracode.org/
    [south]: http://south.aeracode.org/
  14. trey revised this gist May 4, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # How to start a Django project in 2012
    ## (and deploy to Heroku)

    First, warm up your system.
  15. trey revised this gist May 4, 2012. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -49,6 +49,16 @@ INSTALLED_APPS = (
    ...
    ```

    Setup SQLite for local development. Also in `settings.py`:

    ``` python
    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': 'development.sqlite',
    ...
    ```

    Make `.manage.py` executable (so you don't have to type `python manage.py ...` all the time).

    ``` bash
  16. trey revised this gist May 4, 2012. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -49,6 +49,12 @@ INSTALLED_APPS = (
    ...
    ```

    Make `.manage.py` executable (so you don't have to type `python manage.py ...` all the time).

    ``` bash
    $ chmod +x manage.py
    ```

    Don't forget to add `ve` to your `.gitignore` file.

    Now go make something awesome.
  17. trey revised this gist May 4, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## (with Heroku deployment)
    ## (and deploy to Heroku)

    First, warm up your system.

    @@ -62,7 +62,7 @@ $ heroku run python manage.py syncdb
    $ heroku open
    ```

    ## Update your database with [South][south] and push the changes to Heroku:
    ## Update your database with [South][south] and push the changes to Heroku

    1. Make changes to your models
    2. `$ ./manage.py schemamigration [appname] --auto`
  18. trey revised this gist May 4, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -55,10 +55,12 @@ Now go make something awesome.

    ## Deploy to Heroku

    ``` bash
    $ heroku create --stack cedar
    $ git push heroku master
    $ heroku run python manage.py syncdb
    $ heroku open
    ```

    ## Update your database with [South][south] and push the changes to Heroku:

  19. trey revised this gist May 4, 2012. 1 changed file with 2 additions and 6 deletions.
    8 changes: 2 additions & 6 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -53,18 +53,14 @@ Don't forget to add `ve` to your `.gitignore` file.

    Now go make something awesome.

    ---

    ### Deploy to Heroku
    ## Deploy to Heroku

    $ heroku create --stack cedar
    $ git push heroku master
    $ heroku run python manage.py syncdb
    $ heroku open

    ---

    ### Aside: how to update your database with [South][south] and push the changes to Heroku:
    ## Update your database with [South][south] and push the changes to Heroku:

    1. Make changes to your models
    2. `$ ./manage.py schemamigration [appname] --auto`
  20. trey revised this gist May 4, 2012. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -55,6 +55,15 @@ Now go make something awesome.

    ---

    ### Deploy to Heroku

    $ heroku create --stack cedar
    $ git push heroku master
    $ heroku run python manage.py syncdb
    $ heroku open

    ---

    ### Aside: how to update your database with [South][south] and push the changes to Heroku:

    1. Make changes to your models
  21. trey revised this gist May 4, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -49,6 +49,8 @@ INSTALLED_APPS = (
    ...
    ```

    Don't forget to add `ve` to your `.gitignore` file.

    Now go make something awesome.

    ---
  22. trey revised this gist May 4, 2012. 1 changed file with 13 additions and 13 deletions.
    26 changes: 13 additions & 13 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -3,29 +3,29 @@
    First, warm up your system.

    ``` bash
    easy_install pip
    pip install virtualenv
    pip install django
    gem install heroku
    $ easy_install pip
    $ pip install virtualenv
    $ pip install django
    $ gem install heroku
    ```

    Start a project.

    ``` bash
    django-admin.py startproject [myproject]
    cd !$
    $ django-admin.py startproject [myproject]
    $ cd !$
    ```

    Setup virtualenv and start it up.

    ``` bash
    virtualenv --no-site-packages ve
    source ve/bin/activate
    $ virtualenv --no-site-packages ve
    $ source ve/bin/activate
    ```

    (`ve` for virtualenv isn't that nice and terse? You can call it whatever you want.)

    Create a `requirements.txt` file.
    Create a `requirements.txt` file and put this stuff in it.

    ```
    Django
    @@ -38,7 +38,7 @@ south
    While you're still inside of your virtualenv, load your requirements.

    ``` bash
    pip install -r requirements.txt
    $ pip install -r requirements.txt
    ```

    Put `south` in your `INSTALLED_APPS` in `settings.py`.
    @@ -56,10 +56,10 @@ Now go make something awesome.
    ### Aside: how to update your database with [South][south] and push the changes to Heroku:

    1. Make changes to your models
    2. `./manage.py schemamigration [appname] --auto`
    3. `./manage.py migrate [appname]`
    2. `$ ./manage.py schemamigration [appname] --auto`
    3. `$ ./manage.py migrate [appname]`
    4. [commit & push changes to heroku]
    5. `heroku run ./manage.py migrate [appname]`
    5. `$ heroku run ./manage.py migrate [appname]`

    ### Sources

  23. trey revised this gist May 4, 2012. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -43,6 +43,12 @@ pip install -r requirements.txt

    Put `south` in your `INSTALLED_APPS` in `settings.py`.

    ``` python
    INSTALLED_APPS = (
    'south',
    ...
    ```

    Now go make something awesome.

    ---
  24. trey revised this gist May 4, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,7 @@ Setup virtualenv and start it up.

    ``` bash
    virtualenv --no-site-packages ve
    source ve/bin/activate
    ```

    (`ve` for virtualenv isn't that nice and terse? You can call it whatever you want.)
  25. trey revised this gist May 4, 2012. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,6 @@ Setup virtualenv and start it up.

    ``` bash
    virtualenv --no-site-packages ve

    ```

    (`ve` for virtualenv isn't that nice and terse? You can call it whatever you want.)
    @@ -43,17 +42,19 @@ pip install -r requirements.txt

    Put `south` in your `INSTALLED_APPS` in `settings.py`.

    **Now go make something awesome.**
    Now go make something awesome.

    ---

    ## Aside: how to update your database with [South][south] and push the changes to Heroku:
    ### Aside: how to update your database with [South][south] and push the changes to Heroku:

    1. Make changes to your models
    2. `./manage.py schemamigration [appname] --auto`
    3. `./manage.py migrate [appname]`
    4. [commit & push changes to heroku]
    5. `heroku run ./manage.py migrate [appname]`

    ## Sources
    ### Sources

    - [Deploying Django applications on Heroku](http://offbytwo.com/2012/01/18/deploying-django-to-heroku.html)
    - [Part 1: The Basics &mdash; South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html)
  26. trey revised this gist May 4, 2012. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -41,8 +41,22 @@ While you're still inside of your virtualenv, load your requirements.
    pip install -r requirements.txt
    ```

    Put `south` in your `INSTALLED_APPS` in `settings.py`.

    **Now go make something awesome.**

    ## Aside: how to update your database with [South][south] and push the changes to Heroku:

    1. Make changes to your models
    2. `./manage.py schemamigration [appname] --auto`
    3. `./manage.py migrate [appname]`
    4. [commit & push changes to heroku]
    5. `heroku run ./manage.py migrate [appname]`

    ## Sources

    - [Deploying Django applications on Heroku](http://offbytwo.com/2012/01/18/deploying-django-to-heroku.html)
    - [Part 1: The Basics &mdash; South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html)
    - [Getting Started with Django on Heroku/Cedar | Heroku Dev Center](https://devcenter.heroku.com/articles/django)

    [south]: http://south.aeracode.org/
  27. trey created this gist May 4, 2012.
    48 changes: 48 additions & 0 deletions django_2012.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    ## (with Heroku deployment)

    First, warm up your system.

    ``` bash
    easy_install pip
    pip install virtualenv
    pip install django
    gem install heroku
    ```

    Start a project.

    ``` bash
    django-admin.py startproject [myproject]
    cd !$
    ```

    Setup virtualenv and start it up.

    ``` bash
    virtualenv --no-site-packages ve

    ```

    (`ve` for virtualenv isn't that nice and terse? You can call it whatever you want.)

    Create a `requirements.txt` file.

    ```
    Django
    psycopg2
    south
    ```

    ([psycopg2](http://initd.org/psycopg/) is a PostgreSQL adapter for Python.)

    While you're still inside of your virtualenv, load your requirements.

    ``` bash
    pip install -r requirements.txt
    ```

    ## Sources

    - [Deploying Django applications on Heroku](http://offbytwo.com/2012/01/18/deploying-django-to-heroku.html)
    - [Part 1: The Basics &mdash; South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html)
    - [Getting Started with Django on Heroku/Cedar | Heroku Dev Center](https://devcenter.heroku.com/articles/django)