- Create your models
- This is how you define the data stored in the database and how that data is saved
- Create your forms (using ModelForm: https://docs.djangoproject.com/en/4.2/topics/forms/modelforms)
- Created view
- This makes the data (aka: context) available to the html template
- Create the template that interpolates the data from the view
- This renders the form
- Create a URL that serves the view to users
- EXAMPLE:
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
document.querySelctor('form').addEventListener('submit', (e) => { | |
e.preventDefault(); // this prevents the form from reloading on submit | |
console.log("submitted") | |
// 1. grab the value from the form | |
const name = document.querySelector("#name").value; | |
// 2. create a new object with it | |
const newObj = { | |
name, | |
complete: 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
* { | |
box-sizing: border-box; | |
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | |
-webkit-tap-highlight-color: transparent; | |
} | |
html, | |
body { | |
margin: 0; | |
padding: 0; |
Create a React App
- Use NextJS PREFERRED METHOD
- Use CRA
Once the app is created, run:
npx storybook@latest init
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
import React, { useState } from 'react'; | |
import PropTypes from 'prop-types'; | |
export default function Counter({ title }) { | |
const [value, setValue] = useState(0); | |
const handleClick = () => { | |
setValue((prevState) => prevState + 1); | |
}; |
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
{ | |
"formatVersion": 3, | |
"category": "Programming", | |
"type": "single", | |
"joke": "", | |
"flags": { | |
"nsfw": false, | |
"religious": false, | |
"political": false, | |
"racist": 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
<a target="_blank" class="courseButton" href="https://githubtools.reppedintech.com/u/codetracker-learning/{PLACE REPO NAME HERE}" target="_blank">Copy Repo</a> |
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> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<link | |
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" | |
rel="stylesheet" | |
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" |
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
// This is an example of making YOUR uid the admin so that you can have access to routes while others who try to login don't have access to provate routes, but you get their info in your database. | |
const [admin, setAdmin] = useState(null); | |
const [loggedInUser, setLoggedInUser] = useState(null); | |
const history = useHistory(); | |
useEffect(() => { | |
firebase.auth().onAuthStateChanged((authed) => { | |
if (authed && (authed.uid === process.env.REACT_APP_ADMIN_UID)) { | |
setAdmin(true); |
NewerOlder