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
const express = require("express"); | |
const bodyParser = require("body-parser"); | |
const ejs = require("ejs"); | |
const mongoose = require("mongoose"); | |
const app = express(); | |
app.set("view engine", "ejs"); | |
app.use(bodyParser.urlencoded({extended: true})); | |
app.use(express.static("public")); |
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
Paste this at the bottom of settings.py file | |
STATIC_URL = '/static/' | |
STATICFILES_DIRS = [ | |
os.path.join(BASE_DIR, "static_my_proj"), | |
] | |
STATIC_ROOT = os.path.join(os.path.dirname( |
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
<form action="" method='post'> | |
{% csrf_token %} | |
<p><label for="id_phone">Phone:</label> <input type="number" name="phone" required id="id_phone"></p> | |
<span id='msg'></span> | |
<br> | |
<p><label for="id_otp">Otp:</label> <input type="number" name="otp" required id="id_otp"></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
import string | |
from django.utils.text import slugify | |
def random_string_generator(size=10, chars=string.ascii_lowercase + string.digits): | |
return ''.join(random.choice(chars) for _ in range(size)) | |
def unique_slug_generator(instance, new_slug=None): |