pip3 install pipenv
pipenv shell
from flask_mail import Mail, Message | |
from flask import Flask | |
app = Flask(__name__) | |
app.config.update( | |
DEBUG=True, | |
#EMAIL SETTINGS | |
MAIL_SERVER='smtp.gmail.com', | |
MAIL_PORT=465, | |
MAIL_USE_SSL=True, | |
MAIL_USERNAME = 'your email', |
import json | |
from rest_framework.test import APIClient | |
class TestClass(): | |
def setUp(): | |
self.client = APIClient() | |
self.register_url=reverse('authentication:register') | |
def test_create_user(self): | |
"""Tests if a user can create an account""" | |
valid_register_data = { | |
'user': { |
Step 1 #Provide a title in the route configuration,Usually in the app.module.ts | |
{ path: '', component: HomeComponent, data: { title: 'welcome' } }, | |
Step 2 #import {ActivatedRoute } from '@angular/router'; | |
Step 3 #Inject the ActivatedRoute interface in the constructor of your component: | |
constructor(private router:ActivatedRoute) { } | |
Step 4,#Subscribe to the data observable and pull out your data variables,use them for what you want. | |
ngOnInit() { |
[ | |
{ | |
"name":"Afghanistan", | |
"code":"AF", | |
"continent":"Asia", | |
"filename":"afghanistan" | |
}, | |
{ | |
"name":"Åland Islands", | |
"continent":"Europe", |
{ | |
"AED": "United Arab Emirates Dirham", | |
"AFN": "Afghan Afghani", | |
"ALL": "Albanian Lek", | |
"AMD": "Armenian Dram", | |
"ANG": "Netherlands Antillean Guilder", | |
"AOA": "Angolan Kwanza", | |
"ARS": "Argentine Peso", | |
"AUD": "Australian Dollar", | |
"AWG": "Aruban Florin", |
export default [ | |
{ | |
text: "Afghanistan (+93)", | |
value: "+93", | |
flag: "af", | |
key: "af", | |
}, | |
{ | |
text: "Aland Islands", | |
value: "", |
import React, { useState } from "react"; | |
import "./App.css"; | |
function App() { | |
const [form, setForm] = useState([]); | |
const [submitted, setFormSubmitted] = useState(false); | |
const someEmpty = form.some( | |
(item) => item.Platform === "" || item.Username === "" | |
); |
from rest_framework.views import exception_handler | |
from rest_framework import status | |
from django.http import Http404 | |
def custom_exception_handler(exc, context): | |
""" | |
This function will handle errors that are returned by | |
the different views. | |
The `handlers` dictionary will map |