Django REST #1 - Why && Installation

in #utopian-io7 years ago (edited)

header

<p dir="auto"><a href="http://www.django-rest-framework.org/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Django Rest Dokumentation <h1>1 - Why && Installation <h4>1.1. Why?? <p dir="auto">Django is a Python framework to build Web-Applications. You can use it for small to large projects.<br /> <a href="https://www.shuup.com/blog/25-of-the-most-popular-python-and-django-websites/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Here you can find some companies which are using django. <p dir="auto">Reasons to use django: <ul> <li>Community: It has 25K readers on Reddit and 1.8K contributors on github. <li>Because of the community there are endless custom modules <li>large variety of Authentication policies <li>ORM´s for SQLLite, Postgresql, MySQL, MariaSQL, MongoDB, ... <li>Uses Serializers <li>on of the best documentations I ever read <li>has Internationalization <li>... <h4>1.2. Requirements <ul> <li>an IDE like <a href="https://www.jetbrains.com/pycharm/download/#section=windows" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Pycharm or a Texteditor like VIM <li>Python 3.5+ <a href="https://www.python.org/downloads/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">download here <li>basic knowledge of Python3 <h4>1.3. Installation <h5>1.3.1 Projectfolder <p dir="auto">Create somewhere a folder, in my case "tut-django".<br /> Open your shell. Go inside this folder, init git and create a requirements.txt <pre><code>mkdir tut-django cd tut-django git init touch requirements.txt <p dir="auto">Install via pip "virtualenv", create a virtualenv and activated it. <a href="https://pythontips.com/2013/07/30/what-is-virtualenv/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Why you should use virtualenv? <pre><code>pip install virtualenv virtualenv ENV source ENV/bin/activate <p dir="auto">Add the following requirements to the <em>requirements.txt. <pre><code>django djangorestframework markdown <p dir="auto">And install it and start your first django project <pre><code>pip install -r requirements.txt django-admin startproject tutorial <p dir="auto">My project is called "tutorial". Inside you can find a lot of files. Don´t panic. In the next part I will explain what the files and folders means. <p dir="auto">Inside the folder <em>tutorial/tutorial you can find a file <em>settings.py. Add the following: <pre><code>.... INSTALLED_APPS = [ .... 'rest_framework', ] ..... <p dir="auto">At the end we will try to run the service to check if everything is fine. <pre><code>cd tutorial python manage.py runserver <p dir="auto">If you can see a line like this everything is fine. <pre><code>.... Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. <p dir="auto"><span>Try to enter <a href="http://127.0.0.1:8000/" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">http://127.0.0.1:8000/ . You will find a nice landingpage. <p dir="auto">Congratulation! You made it through the first part. <h2>Part 2 soon <p dir="auto"><br /><hr /><em>Posted on <a href="https://utopian.io/utopian-io/@cytex124/django-rest-1-why-and-and-installation" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Utopian.io - Rewarding Open Source Contributors<hr /><p>
Sort:  

Your contribution cannot be approved because it is not as informative as other contributions. See the Utopian Rules. Contributions need to be informative and descriptive in order to help readers and developers understand them.

Hi, alongside being too short, your contribution was also rejected because

  • Contributions must be unique. Users must first check if the same or very similar contribution has been submitted before. Comparing your tutorial to this tutorial, I think you should be able to see why your tutorial can't be accepted.

I also had to change the linked repository to the correct one (if you create a GitHub repository with additional material (like code samples), make sure to choose the repository of the project your tutorial is about and not your own repository), so I recommend you read the rules before contributing again in the future.

You can contact us on Discord.
[utopian-moderator]

Congratulations @cytex124! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @cytex124! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!