목록Personal DB/Unclassified record (50)
Silver Library (Archived)
const express = require('express') const app = express() const PORT = 4000; function handleListening(){ console.log(`Listening on: http://localhost:${PORT}`); } function handleHome(req, res){ console.log('req'); res.send("Hello from home!") } function handleProfile(req, res){ res.send("You are on my profile") } app.get("/", handleHome) app.get("/profile", handleProfile); app.listen(PORT, handleL..
node index.js 로 번거롭게 입력해서 서버 구동 하는 것보다도 단순한 방법이 있다. npm start 명령어인데, 이를 위해서는 index.js 파일에다가 이를 반영 입력해 줄 필요가 있다. 예를 들어, const express = require("express"); const app = express(); 가 있으면, const PORT = 4000; function handleListening() { console.log(`Listening on: http://localhost:4000`); } app.listen(4000, handleListening); 로 입력 후, 다시 서버를 구동해보면 터미널에서 메세지가 바뀐것을 볼 수 있다. npm start 명령어 만으로도 node index.j..
[*this post will be updated as the time passes] Problem. Explanation. 'This means 'room_types' is None. So I can't call 'random.choice' on something that is None.' How I solved? 1. Keep calm and log in to the admin panel http://127.0.0.1:8000/admin/ 2. Then add a room types with any name. 3. the command should work as I desired.
I try my best to create as many airbnb website's backend + frontend features as I can. Currently, I am literally copying down the existing webpage, Airbnb. And I admittedly follow the guidance to understand how Python can interact to Django and how I should start linking frontend features as well as backend features simultaneously. And thanks to this process, I believe I could finally have ideas..