Git Product home page Git Product logo

django-profiles's Introduction

Build a Backend REST API with Python & Django

Git

Use the below Git commands in the Windows Command Prompt or macOS Terminal.

Configure default email and name

Note: This only needs to be done the first time you use Git on your machine

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

Initialise a new Git repository

git init

Commit changes to Git

git add .
git commit -am "Commit message"

Set Git remote

Note: This only needs to be done once, the details are provided by GitHub after creating a new project

git remote add origin <URL TO PROJECT>
git push -u origin master

Push changes to GitHub

git push origin

SSH Key Management

The below commands are used to manage SSH keys on your local development machine.

Checking for existing SSH key

ls ~/.ssh/

Print contents of public key

cat ~/.ssh/id_rsa.pub

Generate new SSH key on your local machine

ssh-keygen -t rsa -b 4096 -C "EMAIL ADDRESS"

Virtual Environments

The below commands are used for managing Virtual Environments using Python3-env. Use these commands when connected to your Vagrant server.

Create new environment

python -m venv ~/env

Activate virtual environment

source ~/env/bin/activate

De-activate virtual environment

deactivate

Install requirements from requirements.txt

Note: Virtual environment must be activated

pip install -r requirements.txt

Django Management Commands

Create new Django project

django-admin.py startproject profiles_project  .

Create new Django app

python manage.py startapp profiles_api

Start Django development server

python manage.py runserver 0.0.0.0:8000

Create database migrations file

python manage.py makemigrations

Run migrations

python manage.py migrate

Create new superuser

python manage.py createsuperuser

Vagrant

These commands are used for managing Vagrant using the GitBash or Terminal windows.

Initialise Vagrant on project

vagrant init ubuntu/bionic64

Start Vagrant box

vagrant up

Connect to Vagrant box

vagrant ssh

Disconnect from Vagrant box

Note: This command is a standard linux command for ending an SSH session

exit

Stop Vagrant box

vagrant halt

Remove Vagrant box

vagrant destroy

Update Vagrant box image

Note: you must rebuild the image after updating

vagrant box update

Terminal / GitBash Commands

Change directory

cd /directory_name

Change to parent directory

cd ..

django-profiles's People

Contributors

saqibmobin 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.