Skip to main content

Posts

Showing posts from April, 2023

Deploying/Host Django Project on PythonAnywhere

  Note  –   Before getting started  Sign up to PythonAnywhere  and Create Your Account .   We will be using Beginners’ plan which is a free plan. Disallowed Host Error If you get Disallowed Host at Django let just add  ‘*’  in  ALLOWED_HOSTS  in  settings.py  file and Reload the Web App. ALLOWED_HOSTS =['*'] Here’s an overview of the steps involved. Upload your code to Hosting Cloud Server Set up a virtualenv and install Django and any other requirements Set up your web app using the  manual config  option Add any other setup (static and media files, env variables)   Uploading Django Code to Hosting Server As our code is ready on  GitHub , we will clone it using  Bash Console.  Create a Bash Console by clicking on the Console Tab. You will see the terminal interface where you need to type git clone command. # for example git clone https://github.com/studygyaan/Django-CRM-Project.git Create ...

MySQL Cheatsheet

  MySQL Cheatsheet Database It is defined as a collection of interrelated data stored together to serve multiple applications.   MySQL Elements MySQL has certain elements that play an important role in querying a database. Literals Literals refer to a fixed data value 17 #It is a numeric literal "Harry" #It is a text literal 12.5 #It is a real literal Copy Data Types Data types are means to identify the type of data. #Numeric INT -- Integer data type TINYINT SMALLINT MEDIUMINT BIGINT FLOAT(M,D) -- Floating point data type DOUBLE(M,D) -- Double data type also stores decimal values DECIMAL(M,D) -- Decimal data type Copy #Data and Time DATE -- Date data type (YYYY-MM-DD) DATETIME -- It's a date and time combination (YYYY-MM-DD HH:MM:SS) TIME -- It stores time (HH:MM:SS) Copy #String/Text CHAR(M) -- Character data type VARCHAR(M) -- Variable character data type BLOB or TEXT Copy NULL Values If a column has no value, then it is said to be NULL Comments A comment is a tex...