Last active
January 27, 2016 22:13
Revisions
-
trey revised this gist
Jan 20, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ # 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) -
trey revised this gist
Jan 20, 2013 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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) -
trey revised this gist
Oct 14, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 -
trey revised this gist
Oct 14, 2012 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,13 +4,14 @@ First, warm up your system. ``` bash $ 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 -
trey revised this gist
Jul 22, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 your `settings.py` file: ``` python import dj_database_url -
trey revised this gist
Jul 22, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 [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/[whatever]')} ``` Now go make something awesome. -
trey revised this gist
Jul 22, 2012 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,9 +50,17 @@ 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. ## Database settings for local development and Heroku 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')} ``` Now go make something awesome. ## Deploy to Heroku -
trey revised this gist
Jul 22, 2012 . 1 changed file with 14 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 dj-database-url ``` Now load the exact version into a `requirements.txt` file. @@ -49,14 +50,19 @@ INSTALLED_APPS = ( ... ``` 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 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 $ git push heroku master $ heroku run ./manage.py syncdb $ heroku open @@ -115,7 +121,6 @@ $ ./manage.py runserver ### Sources - [Part 1: The Basics — 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) -
trey revised this gist
May 7, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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.) 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 ./manage.py syncdb $ heroku open ``` -
trey revised this gist
May 4, 2012 . 1 changed file with 0 additions and 93 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,87 +32,6 @@ Install some things into your virtualenv. $ 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 — 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/ -
trey revised this gist
May 4, 2012 . 1 changed file with 2 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,24 +32,12 @@ 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`. -
trey revised this gist
May 4, 2012 . 1 changed file with 121 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 — 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) -
trey revised this gist
May 4, 2012 . 1 changed file with 15 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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.) 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 ``` 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 — 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/ -
trey revised this gist
May 4, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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. -
trey revised this gist
May 4, 2012 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 -
trey revised this gist
May 4, 2012 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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. -
trey revised this gist
May 4, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ## (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 1. Make changes to your models 2. `$ ./manage.py schemamigration [appname] --auto` -
trey revised this gist
May 4, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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: -
trey revised this gist
May 4, 2012 . 1 changed file with 2 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 $ 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 2. `$ ./manage.py schemamigration [appname] --auto` -
trey revised this gist
May 4, 2012 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 -
trey revised this gist
May 4, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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. --- -
trey revised this gist
May 4, 2012 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 ``` 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.) 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 ``` 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]` 4. [commit & push changes to heroku] 5. `$ heroku run ./manage.py migrate [appname]` ### Sources -
trey revised this gist
May 4, 2012 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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. --- -
trey revised this gist
May 4, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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.) -
trey revised this gist
May 4, 2012 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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. --- ### 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 — South v0.7 documentation](http://south.aeracode.org/docs/tutorial/part1.html) -
trey revised this gist
May 4, 2012 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 — 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/ -
trey created this gist
May 4, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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 — 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)