{"id":18975,"date":"2022-09-20T18:00:00","date_gmt":"2022-09-21T01:00:00","guid":{"rendered":"https:\/\/coderpad.io\/?post_type=programming-language&#038;p=18975"},"modified":"2023-04-17T03:56:14","modified_gmt":"2023-04-17T10:56:14","slug":"django","status":"publish","type":"programming-language","link":"https:\/\/coderpad.io\/languages\/python-3\/django\/","title":{"rendered":"Django"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Running Django + PostgreSQL on CoderPad<\/strong><\/h2>\n\n\n\n<p>The Django pad has a built-in connection to a <a href=\"https:\/\/www.postgresql.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">PostgreSQL<\/a> database. <\/p>\n\n\n\n<p>Changes are automatically applied as you type them, and you can add as many files to the project as you need.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Django admin<\/strong><\/h2>\n\n\n\n<p>The Django admin is served on the default path <code>\/admin<\/code> and a super user is created by default with username <code>admin<\/code> and password <code>coderpad<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Installing dependencies<\/strong><\/h2>\n\n\n\n<p>The easiest way to install a python dependency is to run <code><a href=\"https:\/\/pypi.org\/project\/pip\/\" target=\"_blank\" rel=\"noreferrer noopener\">pip3 install [package_name]<\/a><\/code> from the shell and then <code>pip3 freeze &gt; requirements.txt<\/code> to ensure it is reinstalled the next time you use this pad.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>IntelliSense<\/strong><\/h2>\n\n\n\n<p>IntelliSense is running across your entire project, allowing you to see when there are syntax errors or to get quick hints for how to resolve errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Shell<\/strong><\/h2>\n\n\n\n<p>A shell is provided to you so you can inspect your container in more detail. &nbsp;The shell can be used to install packages using <code>pip3 install &lt;package&gt;<\/code>. &nbsp;In addition to installing packages, the shell can be used for executing a test suite if you have one defined.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>\u26a0\ufe0f While it&#8217;s possible to edit files directly from the shell, we recommend using the editor to make your changes. &nbsp;That way, other people in the pad can see your changes as they&#8217;re being made.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Container Limits<\/strong><\/h2>\n\n\n\n<p>The container running your application has a few limitations. &nbsp;Currently, we don&#8217;t limit your CPU usage, though this may change in future. &nbsp;In addition to CPU, we monitor the network bandwidth that is consumed, and limit you to 75 MB for the duration of the container. &nbsp;Finally, we limit the amount of memory accessible to each container to 0.5 GB.<\/p>\n","protected":false},"parent":1372,"menu_order":0,"template":"","class_list":["post-18975","programming-language","type-programming-language","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/programming-language\/18975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/programming-language"}],"about":[{"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/types\/programming-language"}],"up":[{"embeddable":true,"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/programming-language\/1372"}],"wp:attachment":[{"href":"https:\/\/coderpad.io\/wp-json\/wp\/v2\/media?parent=18975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}