Paint App in Django

      Previously done paint app's frame work is changed from Flask to Django. Django feels like an alien for those who dealt with flask only. Its entirely different. Django follows MVC (Model View Control) architecture. Mine is a single app. Unlike in Flask we can create more than one app in a Django project. For a beginner the django book would be a blessing. It helped me a lot.

click here for Django tutorial


      The main difference between Flask and Django is defining databases. In Django we got a choice. We can either write database as raw as we did in Flask or we can use the models. According to django book writing raw codes is a bad example. I will agree with that because using models makes everything much easier. I am not sure about my level of knowledge in Django, but i can assure that its not that hard.

       We specify urls in urls.py in main project folder. Its like doing everthing independently. Views in views.py, defining template and static folders and database etc in settings.py etc. The files will be created automatically when we run the startproject command. All we have to do is fill it. People sometimes prefer Flask where flexibility is needed. Because sometimes Django's structure will give you some problems when defining your own functionality. Flexibility is less than Flask. If flexibility is not a factor for your app then Django is your thing. I am planning to do a Django app on some stock exchange data. When i finish that i will write a post on that one too.

Click here to see my Paint app code in Django

No comments:

Post a Comment