Skip to content

Instantly share code, notes, and snippets.

@dacodekid
Created March 13, 2017 03:21
Show Gist options
  • Save dacodekid/8f7931fb835f6e43a82936cffb862efc to your computer and use it in GitHub Desktop.
Save dacodekid/8f7931fb835f6e43a82936cffb862efc to your computer and use it in GitHub Desktop.

Revisions

  1. auricapps revised this gist Nov 21, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dokku+django.md
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@
    dokku postgres:create <myproj>
    ```

    3. Create web application & link the databse container
    3. Create web application & link the database container

    ```
    dokku apps:create <myproj>
  2. auricapps revised this gist Nov 21, 2016. 1 changed file with 48 additions and 48 deletions.
    96 changes: 48 additions & 48 deletions dokku+django.md
    Original file line number Diff line number Diff line change
    @@ -2,66 +2,66 @@

    1. Verify needed files & settings

    ```
    #PROJ_ROOT/Procfile
    web: gunicorn <myproj>.wsgi
    #PROJ_ROOT/requirements.txt
    dj-database-url==0.4.1
    Django==1.10.3
    gunicorn==19.6.0
    psycopg2==2.6.2
    whitenoise==3.2.2
    #PROJ_ROOT/runtime.txt
    python-3.5.2
    #PROJ_ROOT/<myproj>/settings.py
    INSTALLED_APPS = [
    ...
    'gunicorn',
    ...
    ]
    MIDDLWARE = [
    ...
    'whitenoise.middleware.WhiteNoiseMiddlware',
    ...
    ]
    DATABASES = {'default': dj_database_url.config(), }
    ```
    ```
    #PROJ_ROOT/Procfile
    web: gunicorn <myproj>.wsgi
    #PROJ_ROOT/requirements.txt
    dj-database-url==0.4.1
    Django==1.10.3
    gunicorn==19.6.0
    psycopg2==2.6.2
    whitenoise==3.2.2
    #PROJ_ROOT/runtime.txt
    python-3.5.2
    #PROJ_ROOT/<myproj>/settings.py
    INSTALLED_APPS = [
    ...
    'gunicorn',
    ...
    ]
    MIDDLWARE = [
    ...
    'whitenoise.middleware.WhiteNoiseMiddlware',
    ...
    ]
    DATABASES = {'default': dj_database_url.config(), }
    ```

    2. Install PostgreSQL plugin, create database container

    ```
    sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
    dokku postgres:create <myproj>
    ```
    ```
    sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
    dokku postgres:create <myproj>
    ```

    3. Create web application & link the databse container

    ```
    dokku apps:create <myproj>
    dokku postgres:link <myproj> <myproj>
    ```
    ```
    dokku apps:create <myproj>
    dokku postgres:link <myproj> <myproj>
    ```

    4. Push our application

    ```
    git remote:add dokku dokku@<mydomain.com>:<myproj>
    git push dokku master
    ```
    ```
    git remote:add dokku dokku@<mydomain.com>:<myproj>
    git push dokku master
    ```

    5. HTTPS via Let's Encrypt

    ```
    sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
    dokku letsencrypt <myproj>
    ```
    ```
    sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
    dokku letsencrypt <myproj>
    ```

    6. Enjoy!

    ```
    https://<myproj>.<mydomain.com>
    ```
    ```
    https://<myproj>.<mydomain.com>
    ```
  3. auricapps revised this gist Nov 21, 2016. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion dokku+django.md
    Original file line number Diff line number Diff line change
    @@ -46,9 +46,22 @@ dokku apps:create <myproj>
    dokku postgres:link <myproj> <myproj>
    ```

    4. Push our application and enjoy
    4. Push our application

    ```
    git remote:add dokku dokku@<mydomain.com>:<myproj>
    git push dokku master
    ```

    5. HTTPS via Let's Encrypt

    ```
    sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
    dokku letsencrypt <myproj>
    ```

    6. Enjoy!

    ```
    https://<myproj>.<mydomain.com>
    ```
  4. auricapps revised this gist Nov 21, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dokku+django.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    1. Verify needed files & settings

    ..```
    ```
    #PROJ_ROOT/Procfile
    web: gunicorn <myproj>.wsgi
  5. auricapps renamed this gist Nov 21, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gist.md → dokku+django.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    1. Verify needed files & settings

    ```
    ..```
    #PROJ_ROOT/Procfile
    web: gunicorn <myproj>.wsgi

  6. auricapps created this gist Nov 21, 2016.
    54 changes: 54 additions & 0 deletions gist.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    # Steps to set up a Django+PostgreSQL app using Dokku on Python 3.5.2

    1. Verify needed files & settings

    ```
    #PROJ_ROOT/Procfile
    web: gunicorn <myproj>.wsgi
    #PROJ_ROOT/requirements.txt
    dj-database-url==0.4.1
    Django==1.10.3
    gunicorn==19.6.0
    psycopg2==2.6.2
    whitenoise==3.2.2
    #PROJ_ROOT/runtime.txt
    python-3.5.2
    #PROJ_ROOT/<myproj>/settings.py
    INSTALLED_APPS = [
    ...
    'gunicorn',
    ...
    ]
    MIDDLWARE = [
    ...
    'whitenoise.middleware.WhiteNoiseMiddlware',
    ...
    ]
    DATABASES = {'default': dj_database_url.config(), }
    ```

    2. Install PostgreSQL plugin, create database container

    ```
    sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
    dokku postgres:create <myproj>
    ```

    3. Create web application & link the databse container

    ```
    dokku apps:create <myproj>
    dokku postgres:link <myproj> <myproj>
    ```

    4. Push our application and enjoy

    ```
    git remote:add dokku dokku@<mydomain.com>:<myproj>
    git push dokku master
    ```