How to install Django? along with all the Django related commands.
Once you have installed python, check the folder scripts where easy_install.exe is there. This easy_install.exe will help you to install Django framework.
Here are few important commands which you have to run in command prompt.
1. To install Django:-
easy_install django
2. To check django version installed on your system:
django-admin --version
3. To create a project by django
django-admin startproject <website-name>
Once you run this command folder will be created by the name which you have passed the website-name. Where all the setting and urls with be there default. Now there you have to do you changes further.
4. To run the server
move to the folder where your manage.py file is then type in command prompt
python manage.py runserver
5. To create an app
python manange.py startapp <app-name>
6. It sync your data with database.
python manage.py migrate
7. python manage.py makemigrations <app-name>
If you are creating model and adding apps in the manage.py then run the migration command
once you have makemigrations run again:-
python manage.py migrate
No comments:
Post a Comment