GithubHelp home page GithubHelp logo

crm's Introduction

Guideline for Building a CRM with Django Framework

Installation

  1. Setup the Virtual Environment python -3 venv [name]
  2. Activate the virtual environment [name]\scripts\activate
  3. Install python -m pip install Django python -m pip install --upgrade pip python -m pip install Wheel python -m pip install mysql-connector python -m pip install mysql-connector-python

Start Project with Django

  1. Run on terminal django-admin startproject Your_Project_Name
  2. Navigate to the ProjectName directory python manage.py startapp Your_App_Name

Navigate Back to ProjectName directory

  1. Under settings.py file, go to INSTALLED_APPS, add Your_App_Name

Database

  • Under settings.py file, navigate to DATABASES iff, you need to change the database to MySQL or POSTgre.

For MySQL, insert the following and delete what's there.

    `DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME':'Your_db_Name',
            'USER':'root',
            'PASSWORD':'password123',
            'HOST':'localhost',
            'PORT':'3306',
        }
    }`

Create a Database

Navigate to the Your_Project_Name folder directory.

  • Ensure to list items of the directory.
  • Type dir /b on terminal, for windows. Ensure that on the listed items, manage.py is there.
  • Type type nul > Your_Database_Name.py on the terminal to create a new python file for databases

Inside the Your_Database_Name.py, type the following code;

    import mysql.connector

    # Connect to MySQL server
    dataBase = mysql.connector.connect(
        host='localhost',
        user='root',
        passwd='password123',
        auth_plugin='mysql_native_password')

    # Prepare a cursor
    cursorObject = dataBase.cursor()

    # Create a database 
    cursorObject.execute("CREATE DATABASE Your_db_Name")

    print("All Done!")
  • On the Terminal, type python Your_Database_Name.py. You should see All Done! printed out.
  • Incase of an error with auth, check if auth_plugin='mysql_native_password is set to native as I have.

Navigate to the Your_Project_Name folder directory.

  • Ensure to list items of the directory.
  • Type dir /b on terminal, for windows. Ensure that on the listed items, manage.py is there.
  • Then type python manage.py migrate on the terminal

All Done! We have created our database.

Building the Application with Django

crm's People

Contributors

walterowando avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.