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
- How to Create an App in Django ?
- Django Models | Set - 1
- Django Templates | Set - 1
- Django Templates | Set - 2
- Django Models | Set - 2
- EmailField - Django Models
- BinaryField - Django Models
- Weather app using Django | Python
- DurationField - Django Models
- FloatField - Django Models
- Django URL patterns | Python
- FileField - Django Models
- BooleanField - Django Models
- BigAutoField - Django Models
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.