Thursday, November 6, 2025
Getting started with Django
So in Python web development, 2 major frameworks stand out: Flask and Django. Flask is very straight forward. Django is a little more involved and "batteries-included". This means it comes with lots of features including an admin page and ORM (with sqlite) built right in. However it is a bit hassle to set it up. The Django Tutorial is a good place to start.
It involves virtual environment. You need to generate a project and then generate an app within..
You run that manage.py to let it generate some files and hand change some stuff (in many places) to get a standard MVC app going.
It knows what you want... a view.py to tweak for your controller objects to give data to your template htmls to show, a urls.py to set up your routing from url to controllers. It even has a models.py that you put your DB objects in.
You have to run some migrations to generate that database behind the scene initially to create your database.
It even has a shell so you can tweak data in there if you like. It even has an admin page where you can see your data! But you have to create a super user first.
https://github.com/josephmaklc/crud_project
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment