{"id":29248577,"url":"https://github.com/rstudio-tech/python-crud-practice","last_synced_at":"2025-07-04T00:08:13.151Z","repository":{"id":302494989,"uuid":"896524400","full_name":"rstudio-tech/python-crud-practice","owner":"rstudio-tech","description":"Python-Django-CRUD-Practice","archived":false,"fork":false,"pushed_at":"2024-11-30T15:41:51.000Z","size":322,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T17:55:28.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rstudio-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-30T15:40:44.000Z","updated_at":"2024-11-30T15:41:56.000Z","dependencies_parsed_at":"2025-07-02T17:55:31.470Z","dependency_job_id":"a393f899-b39c-407b-8f3c-89b3fb88a1ac","html_url":"https://github.com/rstudio-tech/python-crud-practice","commit_stats":null,"previous_names":["rstudio-tech/python-crud-practice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rstudio-tech/python-crud-practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2Fpython-crud-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2Fpython-crud-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2Fpython-crud-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2Fpython-crud-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rstudio-tech","download_url":"https://codeload.github.com/rstudio-tech/python-crud-practice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2Fpython-crud-practice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263421932,"owners_count":23464051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-04T00:08:12.433Z","updated_at":"2025-07-04T00:08:13.138Z","avatar_url":"https://github.com/rstudio-tech.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Quick Start Guide\n\nThis guide will walk you through deploying a Python Django CRUD application on Deis.\n\n## Prerequisites\n\n* A [User Account](http://docs.deis.io/en/latest/client/register/) on a [Deis Controller](http://docs.deis.io/en/latest/terms/controller/).\n* A [Deis Formation](http://docs.deis.io/en/latest/gettingstarted/concepts/#formations) that is ready to host applications\n\nIf you do not yet have a controller or a Deis formation, please review the [Deis installation](http://docs.deis.io/en/latest/installation/) instructions.\n\n## Setup your workstation\n\n* Install [RubyGems](http://rubygems.org/pages/download) to get the `gem` command on your workstation\n* Install [Foreman](http://ddollar.github.com/foreman/) with `gem install foreman`\n* Install [Python](http://www.python.org/getit/) (we still recommend 2.7.x for library compatibility)\n* Install [Django](https://www.djangoproject.com/)\n\n## Clone your Application\n\nIf you want to use an existing application, no problem.  You can also use the Deis sample application located at \u003chttps://github.com/bengrunfeld/example-python-django-crud-app\u003e.  Clone the example application to your local workstation:\n\n    $ git clone git@github.com:bengrunfeld/example-python-django-crud-app.git.git\n    $ cd example-python-django-crud-app\n\n## Prepare your Application\n\nTo use a Python application with Deis, you will need to conform to 3 basic requirements:\n\n 1. Use [Pip](http://pypi.python.org/pypi/pip) to manage dependencies\n 2. Use [Foreman](http://ddollar.github.com/foreman/) to manage processes\n 3. Use [Environment Variables](https://help.ubuntu.com/community/EnvironmentVariables) to manage configuration inside your application\n\nIf you're deploying the example application, it already conforms to these requirements.\n\n#### 1. Use Pip to manage dependencies\n\nPip requires that you explicitly declare your dependencies using a [requirements.txt](http://www.pip-installer.org/en/latest/cookbook.html) file. Here is a very basic example:\n\n\tDjango==1.6\n\tdj-database-url==0.2.2\n\tdj-static==0.0.5\n\tgunicorn==18.0\n\tpsycopg2==2.5.1\n\tstatic==0.4\n\nWe highly recommend isolating your dependencies inside a Python [virtualenv](https://python-guide.readthedocs.org/en/latest/dev/virtualenvs/):\n\n    $ virtualenv venv                        # create the virtualenv\n    New python executable in venv/bin/python\n    Installing setuptools............done.\n    Installing pip...............done.\n    $ source venv/bin/activate               # activate the virtualenv\n    \nYou can then install dependencies on your local workstation with `pip install -r requirements.txt`:\n\n\t(venv)$ pip install -r requirements.txt \n\tDownloading/unpacking dj-static==0.0.5 (from -r requirements.txt (line 3))\n\tDownloading dj-static-0.0.5.tar.gz\n\tRunning setup.py egg_info for package dj-static\n\n#### 2. Use Foreman to manage processes\n\nDeis relies on a [Foreman](http://ddollar.github.com/foreman/) `Procfile` that lives in the root of your repository.  This is where you define the command(s) used to run your application.  Here is an example `Procfile`:\n\n    web: gunicorn django_crud_app.wsgi\n\nThis tells Deis to run `web` workers using the command `gunicorn django_crud_app.wsgi`. You can test this locally by running `foreman start`.\n\n\t(venv)$ foreman start\n\t\n\nYou should now be able to access your application locally at \u003chttp://localhost:5000\u003e.\n\n#### 3. Use Environment Variables to manage configuration\n\nDeis uses environment variables to manage your application's configuration, especially database configuration. For example, the following are used to connect your **Django app** to an **Amazon RDS Instance**.\n\n\tDJ_ENGINE: postgresql_psycopg2\n\tDJ_PASS: somepass\n\tDJ_USER: someuser\n\tDJ_HOST: id.somehost.us-west-2.rds.amazonaws.com\n\tDJ_NAME: somedb\n\tDJ_PORT: 5432\n\n## Create a new Application\n\nPer the prerequisites, we assume you have access to an existing Deis formation. If not, please review the Deis [installation instuctions](http://docs.deis.io/en/latest/gettingstarted/installation/).\n\nUse the following command to create an application on an existing Deis formation.\n\n    $ deis create --formation=\u003cformationName\u003e --id=\u003cappName\u003e\n\tCreating application... done, created \u003cappName\u003e\n\tGit remote deis added\n    \nIf an ID is not provided, one will be auto-generated for you.\n\n## Deploy your Application\n\nUse `git push deis master` to deploy your application.\n\n\t$ git push deis master\n\tCounting objects: 65, done.\n\tDelta compression using up to 4 threads.\n\tCompressing objects: 100% (40/40), done.\n\tWriting objects: 100% (65/65), 15.95 KiB, done.\n\tTotal 65 (delta 19), reused 61 (delta 18)\n\t       Python app detected\n\t-----\u003e No runtime.txt provided; assuming python-2.7.4.\n\t-----\u003e Preparing Python runtime (python-2.7.4)\n\nOnce your **Django** application has been deployed, you will need to sync the database before you can open it. To do this, run `deis run 'python manage.py syncdb'`.\n\nYou can then use `deis open` to view it in a browser. To find out more info about your application, use `deis info`.\n\n## Scale your Application\n\nTo scale your application's [Docker](http://docker.io) containers, use `deis scale` and specify the number of containers for each process type defined in your application's `Procfile`. For example, `deis scale web=8`.\n\n\t$ deis scale web=8\n\tScaling containers... but first, coffee!\n\tdone in 16s\n\t\n\t=== \u003cappName\u003e Containers\n\t\n\t--- web: `gunicorn django_crud_app.wsgi`\n\tweb.1 up 2013-12-12T23:04:56.242Z (dev2-runtime-1)\n\tweb.2 up 2013-12-13T18:23:26.635Z (dev2-runtime-1)\n\tweb.3 up 2013-12-13T18:23:26.653Z (dev2-runtime-1)\n\tweb.4 up 2013-12-13T18:23:26.668Z (dev2-runtime-1)\n\tweb.5 up 2013-12-13T18:23:26.684Z (dev2-runtime-1)\n\tweb.6 up 2013-12-13T18:23:26.699Z (dev2-runtime-1)\n\tweb.7 up 2013-12-13T18:23:26.714Z (dev2-runtime-1)\n\tweb.8 up 2013-12-13T18:23:26.731Z (dev2-runtime-1)\n\n\n## Configure your Application\n\nDeis applications are configured using environment variables. To connect to a 3rd-party database like **Amazon RDS**, you'll need to set your login credentials using environment variables.\n\n\t$ deis config:set DJ_NAME=notesdb\n\t=== \u003cappName\u003e\n\tDJ_USER: opuser\n\tDJ_PASS: thispassword\n\tDJ_NAME: notesdb\n\tDJ_HOST: dbid.somehost.us-west-2.rds.amazonaws.com\n\tDJ_PORT: 5432\n\tDJ_ENGINE: postgresql_psycopg2\n\n`deis config:set` is also how you connect your application to other backing services like queues and caches. You can use `deis run` to execute one-off commands against your application for things like database administration, initial application setup and inspecting your container environment. `deis run env` will return all of your environment variables that have been set in Deis.\n\n\t$ deis run ls -la\n\ttotal 60\n\tdrwxr-xr-x  6 root root 4096 Dec 12 23:04 .\n\tdrwxr-xr-x 69 root root 4096 Dec 13 18:30 ..\n\t-rw-rw-r--  1 root root   26 Dec 12 22:11 .gitignore\n\tdrwxr-xr-x  3 root root 4096 Dec 12 23:03 .heroku\n\tdrwxr-xr-x  2 root root 4096 Dec 13 18:26 .profile.d\n\t-rw-r--r--  1 root root   57 Dec 12 23:04 .release\n\t-rw-r--r--  1 root root   35 Dec 12 23:04 Procfile\n\t-rw-r--r--  1 root root  826 Dec 12 23:04 README.md\n\tdrwxr-xr-x  2 root root 4096 Dec 13 18:26 django_crud_app\n\t-rw-r--r--  1 root root  258 Dec 12 23:04 manage.py\n\tdrwxr-xr-x  4 root root 4096 Dec 12 23:04 notes\n\t-rw-r--r--  1 root root   94 Dec 12 23:04 requirements.txt\n\t-rw-r--r--  1 root root   13 Dec 12 23:04 runtime.txt\n\n## Troubleshoot your Application\n\nTo view your application's log output, including any errors or stack traces, use `deis logs`.\n\n    $ deis logs\n\tDec 13 18:27:28 ip-172-31-28-70 djangoapp[web.7]: 2013-12-13 18:27:28 [13] [INFO] Using worker: sync\n\tDec 13 18:27:28 ip-172-31-28-70 djangoapp[web.7]: 2013-12-13 18:27:28 [18] [INFO] Booting worker with pid: 18\n\tDec 13 18:27:39 ip-172-31-28-70 djangoapp[web.8]: 2013-12-13 18:27:39 [14] [INFO] Starting gunicorn 18.0\n\tDec 13 18:27:39 ip-172-31-28-70 djangoapp[web.8]: 2013-12-13 18:27:39 [14] [INFO] Listening at: http://0.0.0.0:10008 (14)\n\n## Additional Resources\n\n* [Get Deis](http://deis.io/get-deis/)\n* [GitHub Project](https://github.com/opdemand/deis)\n* [Documentation](http://docs.deis.io/)\n* [Blog](http://deis.io/blog/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio-tech%2Fpython-crud-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frstudio-tech%2Fpython-crud-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio-tech%2Fpython-crud-practice/lists"}