High tech workers earn more!
Up to 50% more money in a few weeks
Start your way in high-tech with an unfair advantage, exclusive knowledge, and the best connections!
Contact us!
May 18, 2022
In order to get started with Django, all you need to do is install Django package using pip:
pip install django
After the installation is complete, you can move forward and create your Django application.
EduLabs
ספק רשמי של הטכניון
בנושאי תוכנה ובינה מלאכותית.
Creating a new Django web application consists of two stages: First, you need to create a new Django project:
django-admin startproject my_project
Note: my_project is a custom name for your project
Second, you need to create a new Django application that will sit inside the newly created project. In order to do this, you need to change directory to my_project (the one where manage.py file resides):
cd my_project python manage.py startapp my_app
Note: my_app is a custom name for your application After running this command your project tree will look similar to this:
Start your way in high-tech with an unfair advantage, exclusive knowledge, and the best connections!
(this should be run after you make changes to your models.py):
python manage.py makemigrations
This command will result in creating a new migration file in your migrations folder:
(Review SQL queries that will actually run on your DB server during migrate)
python manage.py sqlmigrate my_app 0001
Note: my_app and 0001 are your app name and migration name respectively
(this should be run when you want to apply changes in your migration files on your DB)
python manage.py migrate
Use this command in order to create superuser that will allow you to login into Django Admin App
python manage.py createsuperuser
Use this command to start Django Shell with your application and models loaded (very useful when you want to play with Django models a bit)
python manage.py shell
Django has loaded your Django application for you, so now you can play with your Django models in Python shell!
Originally published on Medium