Prerequisite : Django – Creating project
Django is a great framework which provides you a lot of pre-defined services and workflow so that one can work flawlessly. Django apps are designed to make your code clean and reusable. Django works on the concept of DRY which means Don’t Repeat Yourself.
After creating project , your directory should look like this:
Doesn’t it look a little confusing? Two folders with the same name? So, here is good news. You can change the name of the outer folder because it is just a folder containing your project but please don’t change the name of the inner folder. Let’s rename the outer folder as geeksforgeeks.
Now, it should look like:
After completing Set 2, you have got Django server worked –
but did you notice the warning in red color?
You have 15 unapplied migrations…
We will discuss about such warnings later. For the sake of simplicity, let’s remove the warnings for now. Stop your server using CTRL+C. Run the following command in your terminal:
python manage.py migrate
Now on your command prompt, you will see something like this:
Now run command
python manage.py runserver
Congratulations, you have silenced all warnings
Moving towards Django apps –
We can get rid of
views.py because Django apps are supposed to handle with views. Also, remove these two lines from related files.
from geeks_site.views import hello_geeks path('geek/', hello_geek),
- Dealing with Rows and Columns in Pandas DataFrame
- Django Models | Set - 1
- Django Models | Set - 2
- Views In Django | Python
- Django - Creating apps | Set - 2
- Django - Creating Apps | Set - 1
- Python | Django News App
- Django URL patterns | Python
- Django Migrations | Python
- Django Introduction and Installation
- Intermediate fields in Django | Python
- Python | Sessions framework using django
- Python | Form validation using django
- Python | Django Admin Interface
- Handling Ajax request in Django
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.