Useful Django commands that you should know.

0
0

// VIRTUAL ENVIRONEMT

Install Virtual Environment for your project only:

pip install virtualenv

Now make virtal environment:

virtualenv myvenv (virtual Environment must be create at project root folder).

 

For activate Virtual Enviroment:

source myvenv/Scripts/activate (Use Git for this command)

after activate virtual environment you can do what ever you want to do in python.

if you want to exit from virtual env. write:
deactivate

 

Want to know what django do for you ? write :
django-admin help

want to start new project then write :

django-admin startproject wordcount <-(Project Name)

 

if you wish to start your project and see on a Browser then write :

python manage.py runserver

 

Now Create as much App as you want for your Project:

python manage.py startapp blog

 

Migration Commands:

python manage.py makemigrations
python manage.py migrate

 

pip install Pillow (This is for Image Handling in Python)

Create superuser for Admin Staff:

python manage.py createsuperuser
username: jaqsamacode
password: ***********

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.