This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copilot Overview | |
Copilot is an AI-powered coding assistant that provides suggestions based on the context it sees. It takes into account the files you've opened and interacted with, installed packages and libraries, the code you're writing, and comments you add. | |
## Installing the Extension (Github Copilot) | |
To use Copilot, you first need to install the Copilot extension in your code editor. You can install Github Copilot (In VsCode). | |
## Dealing with Repetitive Code | |
Copilot is especially helpful when it comes to handling repetitive code. By describing your needs in comments, Copilot can provide suggestions based on the provided description. These suggestions can be customized to ensure they work as expected. | |
### Examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validateMobile(phone) { | |
const pattern = /^([0]|\+91)?[6789]\d{9}$/; //Regex Valid for all Indian mobile numbers | |
if (!isNaN(phone) && phone.match(pattern) ) return true; | |
return false; | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import User | |
from django.db.models.signals import post_save | |
from django.dispatch import receiver | |
class Profile(models.Model): | |
""" | |
User Profile | |
""" | |
user = models.OneToOneField(User, on_delete=models.CASCADE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install pipenv | |
Install git ( check git --version) | |
Create an Heroku account | |
Install Heroku CLI | |
Login heroku | |
Copy the project in a seperate folder | |
Create a virtual enviroment | |
Run manage.py runserver not gonna run due to unmigrated files | |
check pip freeze if nothing installed | |
Check which version django,requests or other libraries you have or need to install it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.urls import path | |
from account.views import ( | |
home, | |
login_view, | |
logout_view, | |
account_view | |
registration_view, | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html '%} | |
{% block content %} | |
<div class="col-md-6 m-auto p-4 text-white" style="justify-content: center; align-items: center"> | |
<p>Account</p> | |
<form method="post"> | |
{% csrf_token %} | |
{%for field in account_form %} | |
<p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{%block title %}Register{% endblock %} | |
{% block content %} | |
<div class="container jumbotron"> | |
{% if registered %} | |
<strong>Thank You for Registering with Us.</strong> | |
<a href="{% url 'index' %}" class="btn-link btn">Return to the HomePage</a><br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% load static %} | |
{%block title %}Login{% endblock %} | |
{% block content %} | |
<div class="container jumbotron text-justify"> | |
<h1 class="display-4">Login Here </h1> | |
<form id="login_form" class="form" method="post" action="{% url 'login' %}"> | |
{% csrf_token %} <!-- for security reasons --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% load static %} | |
{%block title %}Login{% endblock %} | |
{% block content %} | |
<div class="container jumbotron text-justify"> | |
<h1 class="display-4">Login Here </h1> | |
<form id="login_form" class="form" method="post" action="{% url 'login' %}"> | |
<!--important for security reasons --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- Bootstrap CSS --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> |
NewerOlder