ተግባራዊ የድር ላይ የተመሠረተ ጥልቅ ትምህርት እና ደህንነት በ

Daisyየመገለጫ ፎቶ

በ Daisy

ተግባራዊ የድር ላይ የተመሠረተ ጥልቅ ትምህርት እና ደህንነት በ ሦስተኛው እትም ቻርሎት ሃር per ር ጁላይ 3, 2024 የዘመነ / የተሻሻለው ሰኔ 3, 2025 መቅድም: - የደህንነት ማገጃዎች በድር ጣቢያ ውስጥ ሶፍትዌሮችን በመገንባት ረገድ የማንኛውም ድር የገንቢ ዕቅድ እና ግድያ አስፈላጊ ነው, ምህንድስና በሚያንቀሳቅሱበት ጊዜ ምህንድስና እና ለተግባራዊ ዓላማዎች ጠቃሚ ነው. በ HTML, ጃቫስክሪፕት እና በ CSS, CACKEND ሶፍትዌር እና የሚተገበር ድፍረቱ ነው DOM (የሰነድ ነገር ማርሻል)ከቧንቧዎች ድርጣቢያ ይገንቡ, በሌላ ሰው ጋዜጣዎች ላይ የተገደበ ነገርን ለመገንባት, ጥገኛዎች, በተለይም ፈጠራዎች ጥቅም ላይ እንዲውሉ የሚፈልገውን ገንዘብ ለመገንባት, በተለይም ፈጠራዎች ጥቅም ላይ እንዲውሉ ለማድረግ በሚረዱበት ጊዜ የተገደበ ነገርን ይገነባሉ. እርስዎበዚህ መጽሐፍ ውስጥ ለማንበብ እና ስለ ግቦችዎ ውስጥ እርስዎን ለማግኘት እና የራስዎን ሶፍትዌር ለማግኘት የፈለግኩትን እና የአድማጮችዎን ፍላጎቶች በግል የሚማሩትን ድር ጣቢያ ለመማር እና ለማነጋገር ጥቂት ደቂቃዎችን ለመገኘት የተወሰነ ጊዜ እንዲወስዱ ለማድረግ የተወሰነ ጊዜ እንዲወስዱ ለማድረግ የተወሰነ ጊዜ መድፈር. ስለ እኔ: - እኔ ነኝ ሀቀላል, ወይም ምናልባትም መሆን አለበት. መተግበሪያዎችን እራስዎ ለመማር እና ለመገንባት በሚያስደንቁበት ጊዜም ቢሆን መሞከርዎን እና መሞከርዎን እና መሞከርዎን በተቻለዎት መጠን እንደገና መሥራት ያስፈልግዎታል. ይህ በሕግ በተፈጥሮው ውስጥ ነው. ኮድ የፕሮግራም የስህተት መልዕክቶችን ለመስጠት በተቀናጀ ኮምፕዩተር ነው, እና እነዚህም ኮድዎን በቀላሉ ወደ የፍለጋ ሞተሩ ለመገልበጥ እና ሌሎች የሰዎችን ምሳሌ በማንበብ እንኳን ኮድ እንዴት እንደሚማሩ ያስተምራሉ. እና እኔ ማለት አለብኝ, በጣም አስፈላጊ መሆን አያስፈልግዎትምከሚያስፈልጉት የበለጠ ጥረት, ሥራ ወይም ገንዘብ ከሌለው በላይ ሶፍትዌሮችዎን ያቅርቡ. ይህ መጽሐፍ "ተግባራዊ ድር ጥልቀት ያለው ጥልቅ ትምህርት እና ደህንነት በመባል የሚታወቅ, በጽሁፉ ውስጥ የተዘረዘሩትን ተግባራዊ ዓላማዎች የሚያገለግሉ የስራ ኮድ ምሳሌዎች, በተለይም ለድር ላይ ትኩረት የሚሰጥ ነው, በተለይም ለድር ነው. የዚህ ጽሑፍ የመማሪያ አካል እንዲሁ ማሽን ትምህርትን ያሻሽላል, ኮዱ እንዴት እንደምታሳይዎት አደርጋለሁእንደ ትክክለኛ, በኮምፒተር የተላለፈ ምስል, ወይም የጨረር ፎቶ ወይም የታተመ ፎቶግራፍ የሚወስን የኮምፒተር እይታን, የፊት ማጎልበቻን እና የቪዲዮ ማጎልበቻን, የመፍትሔ ማጎልበትን, የምስሉን ማግለጫ, የምስሉ መግለጫ ማግለጫ, የምስሉ መግለጫ ማግለጫ, የምስሉ መግለጫ ማግለጫ, የምስሉ መግለጫ ማግለጫ, የምስሉ መግለጫ, የምስሉ መግለጫ ማግለጫ, የምስሉ መግለጫ, የምስሉ መግለጫ እና ሌሎች ተግባራት. ወደ የድር ደህንነት እና የሶፍትዌር ደህንነት ሲመጣ የማሽን ትምህርት በጣም አስፈላጊ ነው, ምክንያቱም ካልሆነ በስተቀር ተግባሮችን ያስከትላልየማይገመት. ኮምፒተርዎ ከ PassCode ጋር ሊገባዎት ይችላል, ግን ከፊትዎ ጋር ከገባዎት ለመጠቀም ደህንነቱ የተጠበቀ ሊሆን ይችላል. የአገልጋይ ኮምፒተርን እና የይለፍ ኮድ እንዲሰጥዎ የሚጠይቅ, ኮምፒዩተር በመደበኛነት የሚጠይቅዎት ኮምፒውተር, ምናልባትም ለእያንዳንዱ አዲስ የመግቢያ ወይም አዲስ የአይፒ አድራሻ የሚገጥም, ለመሠረታዊነት, ለመሠረታዊ ደህንነቱ የተጠበቀ እና ኃይለኛ ሶፍትዌር ከሆነ, ይህ በቂ ሊሆን ይችላል. ሶፍትዌሮችዎን ለሌላ ሰው ሶፍትዌሮች በጣም ቅርብ የሆነl የአገልግሎት ወይም የጽሑፍ መልእክት አገልግሎት, ሶፍትዌሮችዎን ደህንነቱ የተጠበቀ ወይም ለማንም (የሚጠቀሙበት ማንኛውም ጣቢያ) ለማንም በቂ አይደለም. የማያቋርጥ ሶፍትዌር የሚገነባ ማንኛውም ሰው ይህ የሚያመለክተው አንድ የተወሰነ ስሜት አለው. ሶፍትዌሩ ለመድረስ የምንጠቀምባቸው መሳሪያዎች እና መለያዎች ሁል ጊዜ አይደለንም ምክንያቱም እኛ ለሶፍትዌሩ የታመሙ የማንኛውም ሰው እጅ ውስጥ ሊሆኑ ይችላሉ ስለሆነም ለሶፍትዌሩ ራሱ አደጋ ሊያስከትሉ ይችላሉ. ይህ የዚህ መጽሐፍ ትኩረት የሆነ ነገር ነው. አንድ አውታረመረብMutnerer ረዣዥም ቁልፍ ማስመሰያ, ተብሎ በሚጠራው እና ደህንነቱ በተጠበቀ የ Shell ል ማስመሰያ, እና በድር አገልጋይ አማካኝነት በጥሩ ሁኔታ የተረጋገጠ ድርጣቢያው ክፍት መዳረሻ እንዲሁም በአገልጋዩ ላይ የሚሮጡ የኪነጥበብ ደህንነት መሳሪያዎች ግዛት ነው. የድር አገልጋዩ የተጠቃሚው ድር አሳሽ የሚገኝበት የተጠቃሚው መሣሪያ በጣም ኃይለኛ ክፍል ነው, ምክንያቱም ተጠቃሚው የተከራዩበት ቦታ ነው. ይህ የመሳሪያ ስብስብ ጽሑፍን ሊቀለበስ ይችላል, የሚያዩዋቸው ድረ ገጾች እናእንዲሁም ምስሎችን, ኦዲዮ እና ቪዲዮ (እንደ ፊት ወይም እንደ የስቴት መታወቂያ (እንደ አንድ የሬዲዮ መታወቂያ), ለማነበብ እና ለመፃፍ, ርካሽ ቁልፍ ካርዶች, ቀለበቶች, ተለጣፊዎች, ቀለበቶች, ቀለበቶች, ቀለበቶች እና ሊተባበሩ ይችላሉ, እና ከድር ጣቢያው ጋር በተያያዘ በተነባቢው አገልጋዩ ሊነበብ እና ሊነበብ የሚችል እና ሊተባበሩ ይችላሉ. ደህንነቱ የተጠበቀ ሁሉንም መሳሪያዎች በመጠቀም, በዚህ መጽሐፍ ውስጥ ደህንነቱ የተጠበቀ ለመገንባት በእውቀቱ እራስዎን ያዘጋጃሉEBBAIS, እና በአጠቃላይ ለእርስዎ የሚሰራ ደህንነቱ የተጠበቀ አውታረመረብ ስርዓት, ጨረታዎ እና መልክ እና ጥሩ ስሜት ይሰማዎታል. የት እንደሚጀመር: ከዚህ መጽሐፍ ጋር, ወይም በማንኛውም ክፍል, በተለይም ከላይ በተጠቀሱት መሳሪያዎች ወይም ከእነሱ ጋር በተያያዘ በዚህ መጽሐፍ ውስጥ ከደረሱበት ጊዜ እና በመጽሐፉ ውስጥ በዝርዝር በመግለጽ እና ተግባራዊ ምሳሌዎችን በመመዝገብ እገባለሁ. በጽሑፍ ኮድ ውስጥ ተሞክሮ ከሌለዎት, እኔይህንን መጽሐፍ ሁሉ እንዲያነቡ ሁሉ, ይህ መጽሐፍ ለእርስዎ ትክክል መሆኑን ለማረጋገጥ በተለይ የቀደሙ ክፍሎችን እንዲያነቡ እንዲረዱዎት. ይህ መጽሐፍ ለእናንተ ትክክል ካልሆነ እራሳቸውን ስለ ድር ልማት ለመማር ፍላጎት ላለው ጓደኛ ወይም ዘመድ, አልፎ ተርፎም እንዳሳለፍኩባቸው የትራንስፖርት ክፍተቶችን ለመሙላት ያስቡበት ወይም ሌሎች አስተማሪዎች ከፊቴ እንዲሞሉ ያስቡ. እርስዎ በሚፈልጉበት ቦታ ይጀምሩ, የዚህ መጽሐፍ እያንዳንዱ ክፍል ጠቃሚ ይሆናልጠቃሚ መተግበሪያን ለመገንባት አስቡ, እና ምርጥ መተግበሪያዎች በመጨረሻው ተጠቃሚ ውስጥ የተገነቡ እንደሆኑ ያስቡ, ደንበኛዎን ይወቁ. አሁን ያውቁኛል, ይህንን መጽሐፍ ታውቃላችሁ, ለመጀመር ዝግጁ ናችሁ. ለመጀመር, ኮምፒተርን ይያዙ (ከቦክስ ሱቅ, ከአማዞን, ከአማዞን, ወይም ከአሮጌው የዴስክቶፕ ሥራዎች ውስጥ በጣም ርካሽ ላፕቶፕ እንኳን ሳይቀር, እና ለእርስዎ በሚሰራ መንገድ ያዋቅሩት. ይህንን መጽሐፍ እንዴት እንዳነበቡ ጽሑፉ በአስተማማኝ ሁኔታ የተጎበኘ, ጽሑፉ በትእዛዝ ጥያቄ ውስጥ ያለው, የሚሮጡበትን ኮድ ይጽፋሉ. የትእዛዝ ጥያቄው በጣም ከባድ ነውቦርድ ትኩረት ያደረገ እና የስራ ፍሰትዎን በፍጥነት ለማፋጠን እና ነገሮችን ለማዳን ብዙም ፋይዳ የለውም. እንደ መጀመር፥ እንሂድ. በአካባቢያዊ ማሽን ላይ የግንባታ ኮድ እንጀምራለን እናም ከበይነመረቡ ጋር የተገናኘ ድር ጣቢያውን ሳይገነቡ እንጀምራለን. ይህ ከመጀመር የበለጠ ደህና ነው, ምንም አያስከፍልም, እና ለእርስዎ ቀላል ነው. በአሠራርዎ ስርዓት ላይ በመመርኮዝ ወደ ባሽ ሲስተውሉ ውስጥ በመገጣጠም በጣም ትንሽ የተለየ ይሆናል. ለማክ ኦፕሬሽን, እንደሚያገኙበት በዚህ ነጥብ ላይ ምናባዊ ማሽን እንዲጭኑ እመክራለሁከእን ምናባዊ ማሽን ጋር የተጠራጣሪ ተኳሃኝነት. እንደ ምናባዊ ፓስክ ሳጥኖች እና ፓይሌዎች ያሉ የተለያዩ አገልግሎት ሰጭዎች እርስዎ ፈጣን, ዥረት የተዘበራረቀ ልምድን ለመፍጠር የሚመከርበት የአገሬው አካባቢን ለመጠቀም ቢመርጡ. እኔ የምመክረው ሊኑክስ ወይም መስኮቶችን የሚጠቀሙ ከሆነ ፕሮጀክት ለመፍጠር በጣም ቀላል መሆን አለበት. ተርሚናልዎን ይክፈቱ, ተስማሚ እንደሆኑ ሲያዩ መጠን መቀነስዎን ያስተካክሉ እና ደረጃ 2 ን መከተል ይጀምሩ. እርስዎመስኮቶችን እየተጠቀሙ ነው, እባክዎ ደረጃ 1 ይከተሉ. ደረጃ 1 - ዊንዶውስ ተጠቃሚዎች ብቻ በዊንዶውስ ውስጥ, ክፍት ትዕዛዝ ፈጣን እንደ አስተዳዳሪ እና ዓይነት WSL -installall ደረጃ 2 - እዚህ ቀጥ ይበሉ, ወይም ዊንዶውስ ካልጠቀሙበት ወደዚህ ይዝጉ ወይም ይለፉ በክፍት ተርሚናል ውስጥ (በ <OS ላይ በመመርኮዝ በ <OS ላይ በመመርኮዝ, በማክ ወይም በሊቡል ወይም ተመሳሳይ ስም ላይ በመመርኮዝ, ፕሮጀክት በመፍጠር ይጀምሩ. ይህንን የምናደርገው በማውጫ የሚፈጥር ከ MKDir ትዕዛዝ ጋር እናደርጋለን. ፕሮጀክትዎን ለማከማቸት ማውጫ መፍጠር ከፈለጉ,ይመከራል, ወደ ማውጫው ለመቀየር የ CD ትዕዛዙን ይጠቀሙ እና እና ሲዲ / ዱካ / ማውጫ / ማውጫ - ዱካው ከመድረሻ ማውጫዎ የሚመዝኑ አቃፊዎች (ፋይሎች) ነባሪ ዱካዎ (የተጠቃሚ ስምዎ የእርስዎ የተጠቃሚ ስም ነው). ወደ ነባሪ ማውጫ ለመቀየር ሲዲ ወይም ሲዲን ይተይቡ mkdir ምሳሌ - በምርጫው ስም "ምሳሌ" ምሳሌ "ይተኩ አሁን ለፕሮጄክትዎ የሥራ ማውጫ አለዎት. የሚያስፈልግዎ ከሆነ ይህ ማውጫ እንዲኖርዎት በጣም አስፈላጊ ነውወደተለየ ማሽን ይለውጡ ወይም የሚጽፉትን ኮድ ይቀይሩ ለድር ዝግጁ ነው, በሚቀጥሉት ጥቂት ደረጃዎች ማውጫዎን ለማዳን ቃል እንገነባለን. ነገር ግን ስክሪፕት መገንባት ትንሽ ኮድ ይወስዳል, እና ኮድ በተቻለ መጠን ጠቃሚ ሆኖ እንዲቆይ ይፈልጋል. ስለዚህ በመጀመሪያ እስክሪፕቶችን የመገንባት ስክሪፕትን እንገንባ. እስክሪፕቱን በመፍጠር እና በሥራ ላይ ማዋል እንጀምር. እኛ ሱዶን, ቾዶዎን እንጠቀማለን እና ለዚህ እንጠቀማለን, እና ስክሪፕቱን "ፅጂክስ" ይደውሉ. `` `bash sudo ንክኪ / ዩኤስኤስ / ቢን / ጥሬት sudo chmod a + xቢን / ፅሁፍ sudo nano / USR / BIN / BINE / BESTICT `` ` አሁን ስክሪፕቱን ፈጥረናል, ተሳስቷል, እና ለማርትዕ ዝግጁ ነን. ናኖ ጽሑፍን ጠቅ ሲያደርጉ የሚያርትዑት, ይህም ግራፊክ ተጠቃሚ በይነገጽ ከመጠቀም የበለጠ ቀላል ነው. ከናኖ ጋር ፋይልን ለማርትዕ, ናኖን እና ከዚያ ወደ ፋይል መንገዱን ይጠቀሙ. አንድ ስክሪፕት የሚያደርገው ስክሪፕት ለማድረግ ስክሪፕቱን በመጀመሪያ ደረጃ መስጠቱ ተገቢ ነው. የ "ስክሪፕቱን" የሚለውን ስም በመተካት ከላይ የተጠቀሰው ተመሳሳይ ኮድ እንጠቀማለን, "ፅጂክ"ኢሽ የክርክር ልኬት, $ 1. ይህ እኛን በመተየብ ወደ ስክሪፕት እንጠራጠራለን, በዚህ ነጥብ ላይ በስክሪፕትዎ ስም "የእጅ ጽሑፍ ጽሑፍ" በመተካት በየትኛው አዲስ ቃል መፍጠር እንችላለን. በናኖ ውስጥ ያለው ኮድ ሊመስል ይገባል `` `bash sudo ንክኪ / ዩኤስኤ / ቢን / ቢን / $ 1 sudo chmod a + x / USR / BIN / BIN / $ 1 sudo nano / USR / BIN / BIN / $ 1 `` ` እና ናኖን ለመዝጋት የቁጥጥር ቁልፍን መያዝ እና ኤክስ ን ይጫኑ, ከዚያ ፋይሉን ለማዳን እና ተመጣጣኝን መምታት እንችላለን. አሁን እነዚህን ሦስት ትእዛዛት ከመፃፍ ይልቅtress ስክሪፕት, እንደገና ስክሪፕቱን እንደገና ለማርትዕ የሱዶ ቅጂ ጽሑፍ ጽሑፍን መተየብ እንችላለን. ይህ ይሰራል! እና ማንኛውም አዲስ ስክሪፕት በ she ል ውስጥ በመደወል በቀላሉ በቀላሉ ሊሄድ ይችላል. ስራችንን አሁን እንዳንገባ አዲሱን ስክሪፕታችንን ለማዳን እና ከዚያ በፕሮጀክታችን ማውጫ ውስጥ ወደ መጠባበቂያ ቅጂ ስክሪፕት (ስክሪፕቱን) ለማዳን እንጽፍለን. `` `bash የሱዶ ፅሁፍ ምትኬ ምትኬ `` ` አሁን በናኖ `` `bash Sudo CP / USR / BIN / BIN / BINUP / TAP / ማውጫ / ማውጫ / ማውጫ / Sudo CP / USR / BINE / BITEC / TERCE / PREP / PRE / ማውጫ / ማውጫ / `` ` የትከ mkdir ከፈጠሩ ፕሮጀክት ጋር ወደ / / / ማውጫው መንገድ ነው. በኋላ ላይ እኛ እንደ ኋላ እና ከዝርዝር ጋር ተመሳሳይ የሆኑ ዱካዎችን እንዴት እንደ መገልበጥ እንማራለን, ግን ለአሁን ቀለል ያለ ነገርን እንጠብቅ እና ጥቂት መስመሮችን እናድርግ. ይህንን ስክሪፕትዎን ለማካሄድ እና ኮድዎን ለመሰብሰብ እና ኮድዎን በመከታተል በ NANO ውስጥ ያለው ፋይል ከቁጥር ኤክስ, y እና መመለስ እና ከዚህ በታች ያለውን Shell ል ውስጥ ይተይቡ `` `bash ምትኬ `` ` ይህንን መጽሐፍ በማንበብ እና በ She ል ውስጥ በሚከተሉበት ጊዜ የይለፍ ቃል እንዲኖርዎት በሁሉም የይለፍ ቃል ከተጠየቁ እባክዎን ያስገቡSSWord በትክክል ትዕዛዙን እንደገና ማካሄድ ከመፈለግዎ በፊት ሶስት ሙከራዎች ይኖሩዎታል. ወደ ላይ እና ወደታች ቀስቶችን ወደ REEROUN ትዕዛዞችን) መጠቀም እና እነሱን ማርትዕ ይችላሉ, ሁለት ጊዜ ማንኛውንም ነገር ማሄድ ከፈለጉ. ትዕዛዙን በትክክለኛው, የቀኝ ቦታን ከቀኝ, ግራ ቀሚሶች እና ቁልፍን እና ቁልፍን በመሰረዝ ትእዛዝ ከመምረጥዎ በፊት ቀላል እና ወደታች. እንኳን ደስ አለዎት! በሚሰሩበት ጊዜ ሁለት አስፈላጊ የ Shell ል ስክሪፕቶችን የሚደግፍ ግሩም የመጠባበቂያ ቅጂ ስክሪፕትን መፍጠር ችለዋልምደባ. ፕሮጀክቱ እየጨመረ ሲሄድ ኋለኞቹን እንያዝ ይሆናል, ግን ይህ ለአሁን ይሠራል. በደመናው ውስጥ ለመደገፍ እንሂድ (ለዚህ የመጠባበቂያ ቅጂዎች) እኛ ወደ አገልጋይዎ እንደምናውቅ ሁሉ እነሱ ተመሳሳይ ናቸው.) Git ለሶፍትዌርዎ የመቆጣጠሪያ ሶፍትዌሮች አሉ. ሶፍትዌርዎን በማዳን ረገድ የመሳሪያ ችሎታ ነው,አንድ ነጠላ ኮድ ሲጨርቁ አንዳንድ ጊዜ የሚበሰብሱበት ጊዜ ወደ ሰርቀን ወደ ተዳክለሽ የሊኑክስ ምሳሌዎች ስንገፋ, እርስዎ የሚሸፍነው በራስ-ሰር ለመምታት እድሉ እንዳያገኙ ቢተገበርዎ ይቆለፉ. በዚህ ነጥብ ላይ ኡቡን ubudu ምናባዊ ማሽን የማይጠቀሙ ከሆነ, በዚህ ነጥብ ላይ የ Ubuntu ምናባዊ ማሽን በመጠቀም, የሥራ ድር ጣቢያ ለመገንባት እናበኮምፒተርዎ ላይ የጥንቃቄ የጥንቃቄ ትምህርቶችን መልቀቅ. በቅርብ ጊዜ ውስጥ ኮዱን ወደ ድር አገልጋይ እንሄዳለን, ግን ይህንን ለማድረግ በርካታ የሊኑክስ ፓኬጆችን መጠቀም ከሚያገለግሉት ከድር አገልጋይ በስተጀርባ ቢያንስ ጥቂት የደህንነት ሽፋን እንዳለ ማረጋገጥ እንፈልጋለን. አሁንም Mac OS ን ለመጠቀም ከፈለጉ በመስመር ላይ አስፈላጊውን ፓኬጆች ለመፈለግ እና ለመጫን እንኳን ደህና መጡ, ግን ይህ መጽሐፍ ወይም ተከታታይ የሚሸፍኑ አማራጮች ሊሆኑ ይችላሉ. ጥቂቶች እንጨምርትዕዛዙን የሱዶ ፅሁፍ ምትኬን በማስኬድ ሥራችንን ወደ መጠባበቂያ ቅጂ ስክሪፕት ድረስ. `` `bash # ... git ያክሉ - ሁሉም የ GITS "ምትኬ" git መግፋት - የመጀመሪያ ማስተር `` ` እንደገና ለማዳን እንደገና ይቆጣጠሩ. አሁን ለዚህ ፕሮጀክት አንድ የተወሰነ የጊዜ አወቃቀር ማድረግ አለብን. በቅርቡ የጌት ፕሮጀክት ይሆናል, ከ GIT ማከማቻዎች ባዘጋጃለን, ግን የማሰማራትን እስክሪፕቶች ሲጽፍ የዚህን ተንጠልጣይ እንሆናለን. መጀመር, እኛ እናረጋግጣለንe በትክክለኛው ማውጫ ውስጥ የ GAT ማከማቻውን ያስጀምሩ እና የ SSS ቁልፎችን ያስገባሉ. `` `bash ሲዲ / ዱካ / ማውጫ / ማውጫ GIT Git ቅርንጫፍ - ማስተር Ssh-Keygen `` ` Ssh-Keygen ከተለያየ በኋላ አዲሱ ቁልፍ በአቃፊው ውስጥ በተጠየቀው አቃፊ ውስጥ መቀመጥ አለበት. ይህ id_rsa. pub ይባላል. ይህንን ቁልፍ እናገኝ እና ይቅዱ. እሱን ለማየት, `` `bash ሲዲ ~ ድመት .Sh / id_rsa. pub `` ` በመጨረሻው ትዕዛዝ የተመለጠውን ጽሑፍ ይቅዱ እና ከ GIT አቅራቢዎ ጋር መለያ ይፍጠሩ (በተገቢው gitubub),ወደ መለያዎ የ SSH ቁልፍን በማከል. አንዴ መለያ ካለዎት በኋላ የላይኛው ቀኝ ምናሌዎን ጠቅ ያድርጉ እና በቅንብሮች ውስጥ ጠቅ ያድርጉ, እና በምናሌው ውስጥ ተደራሽነትዎ ስር ከመድረሱ በፊት ቅንብሩን ጠቅ ያድርጉ. የ SSS ቁልፍን ይምረጡ እና በማዳን እና ለማጽደቅ እና ለዕርፊያ ከመግባትዎ በፊት አዲስ ማከማቻን ለመፍጠር ከግቡር ከመመለስዎ በፊት ርዕስ መስጠትን እና ርዕሱን በመስጠት የራስዎን ያክሉ. ይህ ለሌሎች የጂአይኤስ አቅራቢዎች ተመሳሳይ ነው, ሰነዶቻቸውን ማንበብ ያስፈልግዎታል. በአዲሱ ማከማቻ ውቅር ውስጥ ማከማቻዎ ገላጭ ስምዎን ይስጡ እና ይወስኑሊታተሙ ትፈልጋለህ እናም ገና ለማካተት ምንም ፋይሎችን ማዋቀርዎን ያረጋግጡ. ማከማቻው አንዴ ከተፈጠረ በኋላ ክሎኑን በ SHS URL ጋር ይቅዱ እና ወደሚከተለው ትእዛዝ ይዝጉ. `` `bash GIT DARTET GITED: // ... (የርቀት ዩ.አር.ኤል.) `` ` አሁን ይህን ታውቁታላችሁ ወደ ማከማቻዎ ወደ ማከማቻዎ መመለስ ይችላሉ. የመጠባበቂያ ቅጂ ስክሪፕትዎን አሁን ከጠባቂዎች ጋር ይሞክሩ በጣም ጥሩ! አሁን በእውነቱ ኮድ ማግኘት እንችላለን. ቤንጎን እና ባሽ ላይ ጥሩ ተግቶል እንዳለን አሁን እንጫን. Django ይንጠናልሶፍትዌሮቻችንን በስሜትስ ምትኬ, ባሽ ይህንን ሊያደርገው ይችላል ግን ዲጀንጎ ቀለል ያለ ደህንነቱ የተጠበቀ ትግበራ ሊኖረው ይገባል (ሊሰናከል ይችላል እና የበለጠ በቀላሉ ያዋቅረው). በኡቡንቱ ሶፍትዌርን ለመጫን, የሱዶቹን አሃድ- ትዕዛዝን እንጠቀማለን. በመጀመሪያ, አሁን ያለንን ሶፍትዌሮች ወቅታዊ እና አሻሽል. ይህ በሱዶ APT- ማዘመን ይችላል, ዝመና እና ሱዶ APTON ያግኙ. ቀጥሎም, የ Python እና ምናባዊ አካባቢችንን, የኮዱን ቤት እና የእኛን የኮዴርዎን ቤት እንጭናለን, ከሱዶ ትዕዛዝ: sudo apt-n-is-pytho3 Python3- ivv በኡቡቱቱ ምሳሌ ውስጥ ከሶፍትዌር ጭነቶች አንፃር ከ Django ጋር መሄድ ያለብዎት ይህ ነው. ለዊንዶውስ እና ሊኑክስ ቀጥተኛ መሆን አለበት, ግን የ Ubuntu አካባቢን ለማዋቀር ነፃ ወይም ከላይ የሚከፈልበት ምናባዊ አከባቢን በመጠቀም ምናባዊ ማሽን እና ሊኑክስን መጫን ይፈልጉ ይሆናል. Ubuntu በዚህ ጉዳይ ላይ ወሳኝ ነው ምክንያቱም ድር...
ተግባራዊ የድር ላይ የተመሠረተ ጥልቅ ትምህርት እና ደህንነት በ

ተግባራዊ የድር ላይ የተመሠረተ ጥልቅ ትምህርት እና ደህንነት በ ሦስተኛው እትም ቻርሎት ሃር per ር ጁላይ 3, 2024 የዘመነ / የተሻሻለው ሰኔ 3, 2025

መቅድም: -

የደህንነት ማገጃዎች በድር ጣቢያ ውስጥ ሶፍትዌሮችን በመገንባት ረገድ የማንኛውም ድር የገንቢ ዕቅድ እና ግድያ አስፈላጊ ነው, ምህንድስና በሚያንቀሳቅሱበት ጊዜ ምህንድስና እና ለተግባራዊ ዓላማዎች ጠቃሚ ነው. የ HTML, ጃቫስክሪፕት, እና Python, C / C ++ ን በመተግበር, የጃቫ እና ባሽ የሚተገበሩ በርካታ የተለያዩ ፕሮጄክቶችን በመተግበር, አጠቃቀምን የሚገልጹ በርካታ ፕሮጄክቶችን ለመፍጠር ነፃነት እና ሀይልን በመጠቀም ድረገፃዎችን ያዘጋጁ

ስለ እኔ: - እኔ በ C / C ++, ጃቫ, ፓይሆን, ኤችቲኤምኤል, CSS እና ጃቫስክሪፕት ውስጥ ሰፊ ተሞክሮ ያለው እጅግ በጣም ብዙ የንግድ ገንቢ ነኝ. ሰዎች ለመጠቀም, ለመጎብኘት, ለመጎብኘት, ለማዝናናት እና ለመግደል የሚፈልጉትን ሱሰኛዎች ሱሰኛዎችን እፀዳለሁ, እና አልፎ ተርፎም ከሁሉም በላይ, ሶፍትዌሮችን እሸጣለሁ. አንድ ድርጣቢያ እንዲመስሉ እና ሥራዎ እንዴት እንደሚፈልጉ ሀሳብ ካለዎት, የራስዎን ፍላጎት እያገኘሁ ያሉትን ፍላጎቶች ለማሟላት እንድችል እኔን ለመርዳት ፈቃደኛ ነዎት, እናም የድር ጣቢያውን የማሽከርከር ወጪዎችን ለመሸፈን ፈቃደኛ ነዎትእጅግ በጣም ሀብታም, ብልህ, ስኬታማ, ወይም ሌላው ቀርቶ መተግበሪያን ለመገንባት የተደራጁ ወይም የተደራጁ መሆን አለባቸው. ኮምፒተርው ያንን ድርጅቶች ለእርስዎ ይንከባከባል. በሙከራ እና በስህተት በኩል መጽናት ያስፈልግዎታል, ትኩረትን ጠብቆ ማተኮር እና በሚሰሩበት ጊዜ ጠንክረው መሥራት, እና እርስዎ በሚኖሩበት አጠቃላይ ውስጥ በጣም ስኬታማ የሥራ መስክ ይኖርዎታል

ማን ነኝ የመጨረሻው ክፍል ስለ መማር የበለጠ ስለ መማር እና ከዚህ መጽሐፍ የመውሰድ መንገድ እንደወሰደ አውቃለሁ. እኔ በትክክል ማን ነኝ? ያ የተወሳሰበ ጥያቄ ነው. እኔ ይህንን መጽሐፍ እንኳ አልፎ ተርፎም ይህንን መጽሐፍ እንኳን ለማካሄድ ወይም ለማፅዳት አስቸጋሪ ሆኖብኛል. በአጭሩ, ይህንን መጽሐፍ እያነበቡ ከሆነ ወደ ቤት አመጡከዛሬ ቀደም ሲል ከፕሮጀክቶችዎ ጋር የተዋሃደውን እና እንደ ታዋቂው መተግበሪያ የሚመስሉ ቀላል መተግበሪያዎችን መዘርዘር የምችልባቸው በርካታ ሀሳቦች እና ምክሮች, እና በይነመረቡ ላይ ያተኮሩበት ቦታዎችን መፃፍ እና ምክሮችን መፃፍ ችያለሁ.

ይህ መጽሐፍ ምን ማለት ነው- ይህ መጽሐፍ የመማሪያ አጋዥ ነው. ኮድ እዚህ ማግኘት, ኮድዎን, ማረም, ስህተቶችዎን ለማስተካከል, አዝናኝ, አሳታፊ እና ሱስ የሚያስይዝ, የሚሰማዎት, ይህ አስፈላጊ የሆነው ለምንድነው, እና እራስዎን እና እንዴት እንደሆኑ እናባህሪዎች ነፃ ሶፍትዌሮችን በመጠቀም የደህንነት መፍትሄዎችን ለመጠቀም እና እነዚህን ባህሪዎች መጠቀም እና የእኛን አገልጋይ (ፓምፖት) ሞዱል (ፓም (ፓም) በመጠቀም አገልጋያችንን ደህንነት ይጠብቁ. ከዚያ የፋይል አያያዝን እና ማቀነባበሪያ, ቪዲዮ አርት editing ት, የድምፅ ማካካሻ, የባህሪ ልገሳ, የባሕርኮድ ቅኝት እና የኦፕቲካል ባህርይ እውቅናዎችን እንገመግማለን. በመንገድ ላይ ሶፍትዌራችን ከድነት የበለጠ ጠቃሚ እና ደህንነታችንን የበለጠ ጠቃሚ እና ደህንነቱ የተጠበቀ ለማድረግ የሚረዱንን ኤ.ፒ.አይ.ዎችን እንመረምራለን. በመንገዱ ዳር, አካላዊ ደህንነት እና እንመረምራለን

ይህ መጽሐፍ ምን ማለት አይደለም አንድ ድር ጣቢያ ለማግኘት ከፈለጉ ቀላል ሱቅ ማዋቀር እና የሚፈልጉትን መሸጥ, ብሎግ, ፖስታዎች ወይም ቪዲዮዎችን ይለጥፉ ወይም በሌላ መንገድ አንድ ኮድ ሳይጽፉ ማድረግ ይችላሉ. ይህ መጽሐፍ እንደዚህ አይደለም. ይህ መጽሐፍ ቀድሞውኑ የፕሮስቶ ፔን ንድፍ የሚሰጥ የቅርብ ጊዜ ሶፍትዌሮችን ስለሚያንኮል የበለጠ ጠቃሚ, የተሟላ, ተግባራዊ እና ደህንነቱ የተጠበቀ ሶፍትዌር መገንባት የሚቻለው እንዴት እንደሆነ ያስተምራዎታል

ምን ትማራለህ? ይህ መጽሐፍ ሶፍትዌሮችን, በእውነቱ ተግባራዊ ሶፍትዌሮች, እንደገና ተግባራዊ እና ፎቶዎች እንዴት እንደሚሠሩ, ማሽን ማቃጠል, የደኅንነት አቆጣጠር, እና እንደ ብሉቱዝ እና አከባቢዎች ያሉ መልዕክቶችን (NFC) መግባባት ይወዳሉ. ይህ መጽሐፍ በዳራ ሊኑክስ ላይ ማተኮር, የመጫን እና ለመጠባበቅ የዋጋ ኮድ እንዴት እንደሚገነቡ ያስተምራልድር. በተለይም, ሁለት የጉዳይ ጥናቶችን, የሁለትዮሽ ጥናቶችን እና የሁለተኛ ደረጃ የጦር መሳሪያዎችን እንመረምራለን, ይህም እንደ ግራፊክ በይነገጽ የሚገኙ እና ለፍርድ ውጤቶች በድር ውስጥ ሊዋሃድ ይችላል. ከዚህ በፊት ያለ ቅድመ-ልምድ የሌለበት ድር ጣቢያውን ከመውደቅ እና ማሰማራት, ተግባራዊ, ቆንጆ, ጠቃሚ እና በጣም አስፈላጊ ተግባራዊ ማድረግ እንደሚችሉ ይማራሉ. የማሽን ትምህርት እና የኮምፒተር ቪዥን ለማድረግ እንዴት እንደሚጠቀሙ ይማራሉ, ያስተዋውቁ, አገልግሎቶቻችሁን ለሚሹ ደንበኞች ይግባኝ እና ቀደም ሲል በሚኖሩባቸው መንገዶች አማካይነት ለደንበኞች ይስጡ እና ለራስዎ ስም ይስጡ, ርካሽ ናቸው, እና በጥሩ ሁኔታ ይሰራሉ. ለእርስዎ በሚሠሩ እና እርስዎ የሚፈለጉትን በደመና ኮምፒዩተሮች ላይ እንዴት እንደሚያስቀምጡ እና ምን እንደሚፈልጉ, እና እርስዎ የሚፈልጓቸውን ተጠቃሚዎችዎ እንዴት እንደሚያስቀምጡ እና ተጠቃሚዎችዎ በዋጋዎች, በኢሜል, በጽሑፍ መልዕክቶች, የስልክ ጥሪዎች ውስጥ በማስቀመጥ ላይ እንደሚቆዩ አስተምራችኋለሁ,ለተጠቃሚዎችዎ ለተጠቃሚዎችዎ ወደ ድር ጣቢያዎ እንዲመለሱ የበለጠ አቨነመሮችዎ ለእርስዎ የተረጋገጠበት ቁልፍ ብቻ. ይህ መጽሐፍ በጽሑፍ ወደ ኦዲዮ ለሚገኙ የቪድዮ ተመራማሪዎች ተግባራዊነት, እና እርስዎ በሚሰሩበት ጊዜ ውስጥ የሚገኙትን መረጃዎች, የአንተ ተወካይ, እና እርስዎ ብቻ, እና እርስዎ ብቻ, ሶፍትዌሮችዎ እና ኩባንያዎ የሚያንፀባርቅ መተግበሪያን በመሸጥ ላይ ያተኩራል.e በጣም ጥሩ መንገድ. እንዲሁም ከድግድ ምክሮች ውስጥ, እርስዎ የሚገኙትን ሁሉንም መሳሪያዎች, ከድግድዎ ጋር የሚገኙትን መሳሪያዎች እና ለጉዳዩዎ በጣም አስፈላጊ በሆነው የመሣሪያ ስርዓቶች ውስጥ የሚገኙትን መስመሮች ሁሉ እና የፎቶግራፍ ፍጥረታት, ሞዴሊንግ እና መርሃግብሮች, ሞዴሊንግ እና ፎቶግራፍ, ሞዴሊንግ እና መርሃግብሮች, ሞዴሊንግ እና የፎቶግራፍ ስራ, ሞዴሊንግ እና ፎቶግራፍ, እና አስፈላጊ በሆነው የፎቶግራፍ ጥራት, እና አስፈላጊ ነው. ይህ መጽሐፍ ተብሎ ይጠራልበጽሁፉ ውስጥ ለተዘረዘሩትን ተግባራዊ ዓላማዎች የሚያገለግሉ የስራ ኮምፒዩተሮች, የፊት እውቅና እና የቪዲዮ ማወቂያ እና የቪዲዮ ግኝት በሚያስተካክለው, በተለመደው እይታ ውስጥ, በተግባራዊ እይታ, በተለይም ለድር አገልግሎት የሚተኩር ነው, በተለይም ለድር የሚሠራው ለድር ነው.እንደ ትክክለኛ, በኮምፒተር የተላለፉ ምስል, ወይም የኦፕቲካል ፎቶን (የምስሉ ፎቶ) ያሉ ምስሎችን, የምስሉ መግለጫ, የምስሉ መግለጫ ማግለጫ እና ሌሎች ተግባራት. ወደ የድር ደህንነት እና ሶፍትዌር ደህንነት ሲመጣ የማሽን ትምህርት በጣም አስፈላጊ ነው, ምክንያቱም ካልሆነ በስተቀር የማይቻል ነው. ኮምፒተርዎ ከ PassCode ጋር ሊገባዎት ይችላል, ግን ከእርስዎ ጋር ሲመዘገብ ለመጠቀም ደህንነቱ የተጠበቀ ሊሆን ይችላልእርስዎ የአገልጋይ ኮምፒተርን ማዘጋጀት ይችላሉ, ኮምፒዩተር በተለምዶ የተጠቃሚ ስም እና የይለፍ ቃል እንዲሰጥዎት የሚጠይቅ, ምናልባትም ለእያንዳንዱ አዲስ የመግቢያ ወይም ለአዲስ የአይፒ አድራሻ የሚገጥም, ለመሠረታዊ ደረጃ, ለመሠረታዊ ደህንነቱ የተጠበቀ እና ኃይለኛ ሶፍትዌር ከሆነ, ይህ በቂ ሊሆን ይችላል. እንደ ኢሜል አገልግሎት ወይም የጽሑፍ መልእክት አገልግሎት ሁሉ ሶፍትዌሮችዎን ለሌላ ሰው ሶፍትዌር ማቀድ, ሶፍትዌሮችዎን ወይም ለማንም የሚጠቀሙበት ማንኛውም ጣቢያ (የሚጠቀሙባቸውን ጣቢያ) ለማንም በቂ አይደለም. ማንኛውም ሰውሆ ሶፍትዌሮችን ይገነባል, ይህ የሚያመለክተው ይህ ምን እንደሆነ የተወሰነ ስሜት አለው. ሶፍትዌሩ ለመድረስ የምንጠቀምባቸው መሳሪያዎች እና መለያዎች ሁል ጊዜ አይደለንም ምክንያቱም እኛ ለሶፍትዌሩ የታመሙ የማንኛውም ሰው እጅ ውስጥ ሊሆኑ ይችላሉ ስለሆነም ለሶፍትዌሩ ራሱ አደጋ ሊያስከትሉ ይችላሉ. ይህ የዚህ መጽሐፍ ትኩረት የሆነ ነገር ነው. የተተረጎመው ኮምፒተር በተባለ, ተብሎ በሚጠራ እና ደህንነቱ የተጠበቀ የ Shell ል ቁልፍ, እና በጥሩ ሁኔታ ደህንነቱ የተጠበቀ ነውበድር አገልጋይ, የድር አገልጋዩ ክፍት ተደራሽነት እንዲሁም በአገልጋዩ ላይ የሚሮጡ የኪነጥበብ ደህንነት መሳሪያዎች ግዛት ስለሆነ. የድር አገልጋዩ የተጠቃሚው ድር አሳሽ የሚገኝበት የተጠቃሚው መሣሪያ በጣም ኃይለኛ ክፍል ነው, ምክንያቱም ተጠቃሚው የተከራዩበት ቦታ ነው. ይህ የመሳሪያ ስብስብ ጽሑፍን ሊቀለበስ ይችላል, እና ምስሎችን, ኦዲዮ እና ቪዲዮ (እንደ ፊት ወይም እንደ የስቴት መታወቂያ (እንደ ፎቶ መታወቂያ እንደ ፎቶ ሊመዘገቡ ይችላሉ), ወደ ብሉቱዝ ሬዲዮ ማንበብ እና መጻፍ ይችላልመሳሪያዎች ለማንበብ እና ለማነበብ, ርካሽ ቁልፍ ካርዶች, ቅባቶች, ተለጣፊዎች, ቀለበቶች እና አልፎ ተርፎም ከድር ጣቢያው ጋር በተያያዘ በድር አገልጋይ ሊነበብ እና ሊነበብ እና ሊተነብሱ ከሚችሉ ልዩ የመለያ ቁጥሮች ጋር ሊተነብዩ ይችላሉ. ደህንነቱ የተጠበቀ ሁሉንም መሳሪያዎች በመጠቀም, በዚህ መጽሐፍ ደህንነቱ የተጠበቀ ድር ጣቢያ ለመገንባት በእውቀት እራስዎን ያዘጋጃሉ, እና በአጠቃላይ ለእርስዎ የሚሰራ ደህንነቱ የተጠበቀ አውታረመረብ ስርዓት, ጨረታዎ እና የሚሰማዎት እና ይሰማዎታል

የት እንደሚጀመር: ከዚህ መጽሐፍ ጋር, ወይም በማንኛውም ክፍል, በተለይም ከላይ በተጠቀሱት መሳሪያዎች ወይም ከእነሱ ጋር በተያያዘ በዚህ መጽሐፍ ውስጥ ከደረሱበት ጊዜ እና በመጽሐፉ ውስጥ በዝርዝር በመግለጽ እና ተግባራዊ ምሳሌዎችን በመመዝገብ እገባለሁ. በጽሁፍ ኮድ ውስጥ ተሞክሮ ከሌለዎት ይህንን መጽሐፍ ሁሉ እንዲያነቡ በጣም እመክራለሁ, እና በተለይም ያለፉ መጽሐፍ መሆኑን ለማረጋገጥ በተለይ የቀደሙ ክፍሎችን እንዲያነቡዎት እና ያደርጉዎታል

ይህንን መጽሐፍ እንዴት እንዳነበቡ ጽሑፉ በአስተማማኝ ሁኔታ የተጎበኘ, ጽሑፉ በትእዛዝ ጥያቄ ውስጥ ያለው, የሚሮጡበትን ኮድ ይጽፋሉ. የትእዛዝ ጥያቄ በጣም ጥሩ ቁልፍ ሰሌዳ ያተኮረ እና የስራ ፍሰትዎን ለማፋጠን እና ነገሮችን ለማድረስ ጥቂት ለማድረግ እምብዛም አይጠይቅም.

እንደ መጀመር፥ እንሂድ. በአካባቢያዊ ማሽን ላይ የግንባታ ኮድ እንጀምራለን እናም ከበይነመረቡ ጋር የተገናኘ ድር ጣቢያውን ሳይገነቡ እንጀምራለን. ይህ ከመጀመር የበለጠ ደህና ነው, ምንም አያስከፍልም, እና ለእርስዎ ቀላል ነው. በአሠራርዎ ስርዓት ላይ በመመርኮዝ ወደ ባሽ ሲስተውሉ ውስጥ በመገጣጠም በጣም ትንሽ የተለየ ይሆናል. ለማክ ኦፕሬስ ከእንጨት ባልሆኑ ማሽን ጋር ተኳሃኝነት ሲያገኙ በዚህ ነጥብ ላይ ምናባዊ ማሽን እንዲጭኑ እመክራለሁ. እንደ ምናባዊ UNCEBER እና ፓራክስ ያሉ የተለያዩ አቅራቢዎች ሀ

ደረጃ 1 - ዊንዶውስ ተጠቃሚዎች ብቻ በዊንዶውስ ውስጥ, ክፍት ትዕዛዝ ፈጣን እንደ አስተዳዳሪ እና ዓይነት WSL -installall

ደረጃ 2 - እዚህ ቀጥ ይበሉ, ወይም ዊንዶውስ ካልጠቀሙበት ወደዚህ ይዝጉ ወይም ይለፉ በክፍት ተርሚናል ውስጥ (በ <OS ላይ በመመርኮዝ በ <OS ላይ በመመርኮዝ, በማክ ወይም በሊቡል ወይም ተመሳሳይ ስም ላይ በመመርኮዝ, ፕሮጀክት በመፍጠር ይጀምሩ. ይህንን የምናደርገው በማውጫ የሚፈጥር ከ MKDir ትዕዛዝ ጋር እናደርጋለን. ፕሮጀክትዎን ለማከማቸት ከፈለጉ (ፕሮጄክትዎን) ለማከማቸት ከፈለጉ, የሚመከር, ወደ ማውጫው ለመለወጥ የ CD ትዕዛዙን ይጠቀሙ እና እና እና

ሲዲ / ዱካ / ማውጫ / ማውጫ - ዱካው ከመድረሻ ማውጫዎ የሚመዝኑ አቃፊዎች (ፋይሎች) ነባሪ ዱካዎ (የተጠቃሚ ስምዎ የእርስዎ የተጠቃሚ ስም ነው). ወደ ነባሪ ማውጫ ለመቀየር ሲዲ ወይም ሲዲን ይተይቡ mkdir ምሳሌ - በምርጫው ስም "ምሳሌ" ምሳሌ "ይተኩ

አሁን ለፕሮጄክትዎ የሥራ ማውጫ አለዎት. ወደ ተለያይተሩ ወደ ተለየ ማሽን ለመቀየር ወይም የሚጽፉትን ኮድ ለማሰማራት በጣም አስፈላጊ ሆኖ እንዲገኝ ለማድረግ ለድር ዝግጁ ነው, በሚቀጥሉት ጥቂት ደረጃዎች ውስጥ ማውጫዎን ለማዳን ቃል እንገነባለን. ነገር ግን ስክሪፕት መገንባት ትንሽ ኮድ ይወስዳል, እና ኮድ በተቻለ መጠን ጠቃሚ ሆኖ እንዲቆይ ይፈልጋል. ስለዚህ በመጀመሪያ እስክሪፕቶችን የመገንባት ስክሪፕትን እንገንባ. እስክሪፕቱን በመፍጠር እና በሥራ ላይ ማዋል እንጀምር.እኛ ሱዶን, ቾዶዎን እንጠቀማለን እና ለዚህ ስክሪፕቱን ይደውሉ

sudo touch /usr/bin/ascript
sudo chmod a+x /usr/bin/ascript
sudo nano /usr/bin/ascript

አሁን ስክሪፕቱን ፈጥረናል, ተሳስቷል, እና ለማርትዕ ዝግጁ ነን. ናኖ ጽሑፍን ጠቅ ሲያደርጉ የሚያርትዑት, ይህም ግራፊክ ተጠቃሚ በይነገጽ ከመጠቀም የበለጠ ቀላል ነው. ከናኖ ጋር ፋይልን ለማርትዕ, ናኖን እና ከዚያ ወደ ፋይል መንገዱን ይጠቀሙ. አንድ ስክሪፕት የሚያደርገው ስክሪፕት ለማድረግ ስክሪፕቱን በመጀመሪያ ደረጃ መስጠቱ ተገቢ ነው. የ "ስክሪፕት" የሚለውን ስም ከክርክሪት መለኪያው ጋር በመተካት, "ፅሁፉ" የሚለውን ስም በመተካት, $ 1. ይህ እንድንጠራ ያደርገናልበአጭሩ በሱዶ ፅንስፍት ጽሑፍ ጽሑፍ በመተካት ስክሪፕት, በየትኛው አነጋገር በስክሪፕትዎ ስም "የእጅ ጽሑፍ ጽሑፍ" በመተካት በየትኛው አዲስ ስክሪፕት መፍጠር እንችላለን. ናኖ ውስጥ ያለው ኮድ ማየት አለበት

sudo touch /usr/bin/$1
sudo chmod a+x /usr/bin/$1
sudo nano /usr/bin/$1

እና ናኖን ለመዝጋት የቁጥጥር ቁልፍን መያዝ እና ኤክስ ን ይጫኑ, ከዚያ ፋይሉን ለማዳን እና ተመጣጣኝን መምታት እንችላለን. እስክሪፕትን ለማርትዕ እነዚህን ሦስት ትእዛዛት ከመፃፍ ይልቅ, የሱዶ ፅንጂ ጽሑፍ ቅጂውን እንደገና ለማርትዕ እንለውጣለን. ይህ ይሰራል! እና ማንኛውም አዲስ ስክሪፕት በ she ል ውስጥ በመደወል በቀላሉ በቀላሉ ሊሄድ ይችላል. ስራችንን አሁን እንዳንገባ አዲሱን ስክሪፕታችንን ለማዳን እና ከዚያ በፕሮጀክታችን ማውጫ ውስጥ ወደ መጠባበቂያ ቅጂ ስክሪፕት (ስክሪፕቱን) ለማዳን እንጽፍለን.

sudo ascript backup

አሁን በናኖ

sudo cp /usr/bin/backup /path/to/directory/
sudo cp /usr/bin/ascript /path/to/directory/

ከ mkdir ከፈጠሩ ፕሮጀክት ጋር የት / ዱካ / ማውጫው መንገድ ነው. በኋላ ላይ እኛ እንደ ኋላ እና ከዝርዝር ጋር ተመሳሳይ የሆኑ ዱካዎችን እንዴት እንደ መገልበጥ እንማራለን, ግን ለአሁን ቀለል ያለ ነገርን እንጠብቅ እና ጥቂት መስመሮችን እናድርግ. ይህንን ስክሪፕትዎን ለማካሄድ እና ኮድዎን ለመሰብሰብ እና ኮድዎን በመከታተል በ NANO ውስጥ ያለው ፋይል ከቁጥር ኤክስ, y እና መመለስ እና ከዚህ በታች ያለውን Shell ል ውስጥ ይተይቡ

backup

ይህንን መጽሐፍ በማንበብ እና በ She ል ውስጥ በሚከተሉበት ጊዜ እባክዎን የይለፍ ቃልዎን በትክክል ከተጠየቁ እባክዎን ትዕዛዙን እንደገና ለማስኬድ ከመፈለግዎ በፊት ሶስት ሙከራዎች እንዲኖርዎት ከማድረግዎ በፊት ሶስት ሙከራዎች ይኖሩዎታል. ወደ ላይ እና ወደታች ቀስቶችን ወደ REEROUN ትዕዛዞችን) መጠቀም እና እነሱን ማርትዕ ይችላሉ, ሁለት ጊዜ ማንኛውንም ነገር ማሄድ ከፈለጉ. ትዕዛዙን በትክክለኛው, የቀኝ ቦታን ከቀኝ, ግራ ቀሚሶች እና ቁልፍን እና ቁልፍን በመሰረዝ ትእዛዝ ከመምረጥዎ በፊት ቀላል እና ወደታች.

Congratulations! You managed to create an awesome backup script that backs up two important shell scripts in your working directory. We might move things around later as the project gets bigger, but this works for now. Let's move on to backing up in the cloud, we'll use GitHub for this (though there are numerous other Git solutions for backup, they are all about the same.) Git is a verision control software that lets you back up edits to your software as you make them to a server, while also enabling you to download entire copies of your software behind a password or key. It is instrumental in saving your software, especially as we migrate to secured linux instances that sometimes break when a single line of code fails, leaving you locked out while your code might not be backed up if you don't get a chance to back it up automatically, which we will cover.

በዚህ ነጥብ ላይ ኡቡን ubudu ምናባዊ ማሽን የማይጠቀሙ ከሆነ, በዚህ ነጥብ ላይ የ Ubuntu ምናባዊ ማሽን በመጠቀም, የሥራ ድር ጣቢያዎን ለመገንባት እና በኮምፒተርዎ ላይ ጥልቅ የመማር ሥራዎችን ለመገንባት አስፈላጊ ያደርገዋል. በቅርብ ጊዜ ውስጥ ኮዱን ወደ ድር አገልጋይ እንሄዳለን, ነገር ግን ለማስገር እና በቅደም ተከተል ከሚቋቋሙበት ድር አገልጋይ በስተጀርባ ቢያንስ ጥቂት የደህንነት ሽፋን እንዳለ ማረጋገጥ እንፈልጋለን, ሀይህንን ለማድረግ የሊኑክስ ፓኬጆች ብዛት. አሁንም Mac OS ን ለመጠቀም ከፈለጉ በመስመር ላይ አስፈላጊውን ፓኬጆች ለመፈለግ እና ለመጫን እንኳን ደህና መጡ, ግን ለዚህ መጽሐፍ ወይም ተከታታይ ጥያቄዎች አማራጮች አይኖሩም

ትዕዛዙን የሱዶ ፅሁፍ ምትኬን በማስኬድ ሥራችን ከጠባቡ ስክሪፕት ጋር ሥራችንን ለማከናወን ጥቂት ትዕዛዞችን እንጨምር.

# ...

Once again, Control X to save.

አሁን ለዚህ ፕሮጀክት አንድ የተወሰነ የጊዜ አወቃቀር ማድረግ አለብን. በቅርቡ የጌት ፕሮጀክት ይሆናል, ከ GIT ማከማቻዎች ባዘጋጃለን, ግን የማሰማራትን እስክሪፕቶች ሲጽፍ የዚህን ተንጠልጣይ እንሆናለን. ለመጀመር በትክክለኛው ማውጫ ውስጥ መሆናችንን እና የ GSAS ማከማቻችንን ማስጀመር እና የ SSH ቁልፎችን ያስገኛል.

cd /path/to/directory
git init
git branch -m master
ssh-keygen

After we type ssh-keygen, the new key should be saved in the home folder under a folder called .ssh. It is called id_rsa.pub. Let's find this key and copy it. To see it,

cd ~
cat .ssh/id_rsa.pub

በመጨረሻው ትእዛዝ የተመለሰውን ጽሑፍ ይቅዱ እና በመለያዎ ላይ የ SSH ቁልፍን ከመጨመርዎ በፊት ከጂይት አቅራቢዎ ጋር (በተገቢው gitubub) መለያ ይፍጠሩ. አንዴ መለያ ካለዎት በኋላ የላይኛው ቀኝ ምናሌዎን ጠቅ ያድርጉ እና በቅንብሮች ውስጥ ጠቅ ያድርጉ, እና በምናሌው ውስጥ ተደራሽነትዎ ስር ከመድረሱ በፊት ቅንብሩን ጠቅ ያድርጉ. የ SSS ቁልፍን ይምረጡ እና በማዳን እና ለማጽደቅ እና ለዕርፊያ ከመግባትዎ በፊት አዲስ ማከማቻን ለመፍጠር ከግቡር ከመመለስዎ በፊት ርዕስ መስጠትን እና ርዕሱን በመስጠት የራስዎን ያክሉ. ይህ ለሌሎች የጂኦ አቅራቢዎች ተመሳሳይ ነው, ያስፈልግዎታልሰነዶቻቸውን ለማንበብ. በአዲሱ የማጠራቀሚያ ውቅር ውቅር ውስጥ ማከማቻ ስምዎን ገላጭ ስም ይሰጡ እና ለማተም ከፈለጉ ይወስኑ, እና ለማካተት ምንም ፋይሎችን ማዋቀርዎን ያረጋግጡ. አንዴ ማከማቻው ከተፈጠረ በኋላ ክሎኑን ከ SHAS URL ጋር ይቅዱ እና ለተከተሉት ውስጥ ይለጥፉ

git remote add git://… (your remote URL)

Now you can move back to your repository with CD, you'll be familiar with this. Try your backup script now with backup

በጣም ጥሩ! አሁን በእውነቱ ኮድ ማግኘት እንችላለን. ቤንጎን እና ባሽ ላይ ጥሩ ተግቶል እንዳለን አሁን እንጫን. ዲጀንጎ ሶፍትዌራችንን በራስ-ሰር እንድንርቅ ያስችለናል, bash ይህንን ሊያደርገው ይችላል ግን ዲጀንጎ ቀለል ያለ ደህንነቱ የተጠበቀ ትግበራ ሊኖረው ይገባል (ሊሰናከል ይችላል እና የበለጠ በቀላሉ ያዋቅረው).

To install software in Ubuntu, we will use the sudo apt-get command. First, let's update and upgrade the software we already had. This can be done with sudo apt-get update and sudo apt-get upgrade -y. Next, let's install Python and our virtual environment, the home of our code, with the following command: sudo apt-get install python-is-python3 python3-venv

ቀደም ሲል ከተጠቀሱት

Let's dig into the Django.

በማውጫዎ ውስጥ እንደገና, ከሲዲ ጋር

python -m venv venv # ኮድ የተቀመጠበትን ምናባዊ አካባቢን ይፈጥራል
source venv/bin/activate #  Activates the virtual enviroment
django-admin startproject mysite . # ሚሚትስ ፕሮጀክት ያለውበት ቦታ አሁን አሁን አሁን እያወጣሁ ነው.

ዲጀንጎ እየጀመርን ነው, ምክንያቱም ዲጋንጎ የድር አገልጋዩን እያስተናግድ እና መሠረታዊ የአካባቢያዊ ድርጣቢያ እና የመሮጥ የሚያስፈልገንን ሁሉ እየሰራ ነው. አሁን Django እንዳለን, አሁን እኛ እንዴት እንደምንፈልግ ቅንብሮቹን በትንሹ ያርትዑ. በመጀመሪያ አዲስ መተግበሪያ ይፍጠር

python manage.py startapp feed

የመጀመሪያውን መተግበሪያ ምግብ ተብሎ የሚጠራው ያስተውላሉ. መተግበሪያው የሚወዱትን ሁሉ ተብለው መጠራት አለበት, እናም አዳዲስ መተግበሪያዎችን እንፈጥራለን, ግን መተግበሪያው በኮዱ ውስጥ በተጠቀሰው እያንዳንዱ መተግበሪያ ውስጥ ወጥነት ሊኖረው ይገባል. አዲስ መተግበሪያ ለማከል ሁል ጊዜ ቅንብሮችን ሁልጊዜ እናርትራትዎታለን, በሌላ ማውጫ ውስጥ ሁልጊዜ እናርትራት. ናኖን በመጠቀም,

nano app/settings.py

በቅንብሮች ውስጥ ተጭኗል_አድግ ፈልግ እና ወደ 3 መስመሮች ይለያሉ. በባዶ ማእከል መስመር ላይ አራት ቦታዎችን በመጠቀም 'ምግብን' ወይም የመተግበሪያዎን ስም ያክሉ. ይህ የቅንብሮች ክፍል. Toph ሊመስል ይገባል

INSTALLED_APPS = [
    'feed',
]

Before we forget, let's test that Django is working. Using the command python manage.py runserver 0.0.0.0:8000, we can run the server and then navigate in a web browser on the computer running the code to http://localhost:8000 and see an example webpage (It Works!) Quit the server with Control C, the same as any other command.

አሁን, አንዳንድ የ Python ኮድ ለመፃፍ እንቆፈር. ዲጀንጎ ሶስት ዋና ዋና ዋና ክፍሎች አሉት, ሁሉም ሙሉ በሙሉ በኮድ ይሮጣሉ. አካላት ሞዴሉ, ማየት እና አብነት ተጠርተዋል, እና እያንዳንዱ ድረ-ገፃችን ለተጠቃሚው ከመላክዎ በፊት በቅደም ተከተል ከፍ ያለ እና ዝቅተኛ ደረጃ ነው.

ሞዴሉ ለመምጣቱ, ለመደርደር እና ለአስተያየት በመረጃ ቋቱ ውስጥ መረጃን የሚያከማች ኮድ ነው.

The view decides how the model is rendered, manipulated, and modified, almost every view will use a model directly.

አብነቱ አንዳንድ ተጨማሪ ተጨማሪ ደወሎች እና ጩኸት ያለው የ HTML ኮድ ነው. አብነት በ Python ሕግ እና እንደ ሞዴሎች እና መረጃዎች (የ Usuall ሕብረቁምፊዎች እና መረጃዎች) ከእይታ ጋር በተሞላበት እይታ የሚሰራበት እይታ ነው.

Django has other components too, including but not limited to:

ከተወያየንበት ጊዜ መተግበሪያውን የሚያዋቅሩ ቅንብሮች.

URLs, which are patterns that the user follows to gain access to specific parts of the web application.

Forms, which define how information that is sent to the server is handled and rendered to the database as well as to the user. These are the foundation of processing information on the server side, and can accept any type of information the computer stores, most notably text strings, numbers, and True/False booleans (usually checkboxes).

Templates, which are HTML code and template language and bridge the gap between Python and HTML, meaning Python information can be served as HTML code that anyone can access and can secure a website with restricted access, while making Python code accessible to the web and useful for a variety of purposes on a remote device that doesn't need to be near the server.

Static files, which are usually JavaScript and it's libraries which the server serves and are linked in with the template.

አገልጋዩ የሚያገለግለው ወይም በውጭ የሚስተናገደ ወይም ወደ ሌላ አገልጋይ ከተለጠፈ እና ለአገልጋዩ ለመፃፍ በአገልጋዩ የተጻፉ ወይም ለአገልጋዩ የተጻፉ.

መካከለኛ የመነባበቂያው, ይህም ለእያንዳንዱ አመለካከት በተመሳሳይ ጊዜ የሚሮጡ እና "የተካተቱት" በአመለካከት "የተካተቱ" ናቸው.

የአውደ-ጽሑፍ አሰባሰብዎች የእያንዳንዱን እይታ አውድ እና ተጨማሪ ዐውደትን ለማከል የሚያገለግሉ.

Tests, which validate that the user or request passes certain requirements before the view is rendered.

ለግንኙነት ማካካሻዎች እንዴት እንደሚጠቀሙበት እና ምላሽ እንደሚሰጡ ተጠቃሚዎች,

Admin, which is used to register models so they can be manipulated in detail within the Django Admin page, where the database can be administered through a graphical interface.

Celery, which defines asynchronous tasks parts of the Django code can begin running before immediately proceeding to the next task or line of code.

ዲጀንጎ ብዙ ሌሎች አካላት ሊኖሩት ይችላል, ይህም በዝርዝር እንወያያለን. ዲጃካንጎን, ዥረት የተዘበራረቁ ዥረት ዲስኮችን, የተዘበራረቁ የተዛመዱ ሰርኮችን እና ዲጃናንጎዎችን ለማራመድ ብዙ ሌሎች በርካታ ሶፍትዌሮች አሉ, በተለይም ኮዱ የሚገደልበት. የእይታ ተግባራት ቁልፍ ናቸው ቁልፍ ናቸው ምክንያቱም ብዙውን ጊዜ ለአንድ የተወሰነ የዩ አር ኤል ንድፍ የተለዩትን እያንዳንዱን የኮድ ዕቃ ስለ አውጀዋል,

በመጀመሪያ, የእይታ ተግባሮችን እንዝርዝ. ተግባሮችን ይመልከቱ የሚጀምሩት በአመለካከት ጥቅም ላይ ከሚውለው አስመጪ ኮድ ጋር በሚገናኝ ኮድ ይጀምራል, እና መደበኛ የተግባር ፍቺዎችን ወይም ትምህርቶችን በመጠቀም ይገለጻል. በጣም ቀላሉ ዕይታዎች በተግባራዊ ፍቺ ይገለጻል, እና ኤችቲቲፒንስፖንን ከአንድ መሰረታዊ አብነት ይመልሳሉ. እስቲ ጽሑፉን "ጤና ይስጥልኝ" ለመመለስ መሰረታዊ እይታን በመግለጽ እንጀምር. እንደ ፍራፍሬው ከተገለፀው መግለጫ በኋላ እንደ መቆጣጠሪያ ከተገለጹ በኋላ,,,, ወዘተ, ለእያንዳንዱም 4 ክፍሎችን ማከል እንደሚያስፈልግዎ ኮዱን ሲጨምሩ ያስታውሱ

From our site's directory, edit the feed/views.py file using nano and add the following lines to the end of the file.

from django.http import HttpResponse

def hello(request):
    return HttpResponse('hello world')

የ Djangoo የ ht hotpsponse የመክፈቻ እና የመዝጋት የተወገበ የጽሑፍ ሕብረቁምፊ ምላሽ ይሰጣል. እንደ ጥያቄ ወይም እንደ ሕብረ ሕዋሳት መረጃን በተመለከተ መረጃ በሚያልፉበት ጊዜ ሁሉ ወላጅነት መጠቀም ያስፈልግዎታል (, መክፈት እና መዘጋት).

የእኛን አመለካከት ገና ማየት ያለብን ይህ ሁሉ አይደለም. በእርግጥ, አመለካከቱ በትክክል የተነገረው አገልጋይ እኛ አሁንም የእርሷን መንገድ ማስተካከል ያለበትን መንገድ አሁንም አንነግርም. በመተግበሪያ / ዩአርኤል.ፒ. ውስጥ መሰረታዊ ዱካዎችን በመግለጽ እንጀምር, እናም በኋላ ወደ ጎዳና ቡድኖች እንገባለን.

In app/urls.py, add a line after the import statements after the beginning importing the view we just created.

from feed import views as feed_views

ማ, ምክንያቱም ይህ እያንዳንዱን ሰው ይለያል. እያንዳንዱ ንጥል በቅንብሮች ውስጥ እንደ መተግበሪያው ልክ እንደ አንድ ጊዜ ከአራት ቦታዎች ጋር እንደገና አዲስ መስመር ላይ መሄድ አለበት. በድር አገልጋዩ ስርጭቱ ላይ የሚደርሰውን እይታ ለመፍጠር ባዶ ሕብረቁምፊ ተግባርን ከ <ባዶ ሕብረቁምፊ ተግባር> እንገልፃለን. የእርስዎ ዩአርኤል. አሁን መሰየም አለበት

from feed import views as feed_views

urlpatterns = [
    path('', feed_views.hello, name='hello'),
]

This is the basis for creating a website with Django that is completely static. In order to make a more dynamic website where we can begin caching information, like images, videos, audio and more, we will need to use models, which we will explore next. For now, let's check our code and run the server. To check the code for errors, run:

python manage.py check

If there are any error messages, you should carefully review the changes you made to your app and see if there is anything that needs to be fixed, like an extraneous or lacking space, an extra character, an unclosed string, any typo, any accidentally deleted character, or anything else. Reading through the error message (if you have one), you should be able to see the path to a file you created or edited along with a line number, so look into that file and line and see if you can fix anything that is there. If you have fixed the issue, run the above command again. When your software is ready to run and is working, you will see the output "System check identified no issues." Now you're ready to go. Run the server with:

python manage.py runserver 0.0.0.0:8000

Now open up a web browser and navigate to http://localhost:8000. You should see the text returned in the parenthesis and quotes of the HttpResponse function in your view. This is just a basic example, but if you made it this far, you understand the basics of how Linux, Bash, Python, and Django work. Let's dig deeper into some database modeling, and explore the power of a Python class in storing information. Then, we will begin to get a grip on HTML and CSS before we make our site fully featured, flexible and secure using JavaScript and Machine Learning.

የተወሰነ መረጃ ለማከማቸት የጽሑፍ መስክ. በኋላ ላይ ሞዴሉ ውስጥ ምን ማድረግ እንዳለብዎ የሚረዱበት ጊዜ, ፋይሎች, ቡሌዎች, እውነታዎች, ቡሌዎች, እውነታዎች, አምሳያውን ለመገንዘብ ሊያገለግል ይችላል), ወደ አገልጋዩ ውስጥ ለመግባት የሚረዳበት ምሳሌ, እና ሌሎችንም. ኮዱን እንወስዳለን

from django.db import models # ክፍሎቻችንን ለመግለጽ የሚያገለግል ነው, እና ባህሪያትን የሚያገለግል ማስመጣት
class Post(models.Model): #  The definition of our class itself
    id = models.AutoField(primary_key=True) #  The ID of our model, an automatically generated key that will let us query the model, keep it unique, and is useful when we need to interact with the model once it has been created.
    text = models.TextField(default='') #  The attribute our class stores, in this case, some text, defaulting to an empty string.

Close and save the file as we did before to finish.

እኛ ይህንን ክፍል እንደ ተለውጦ እንደወጣ ይህንን ክፍል በምንዘራበት ጊዜ ብዙ ሌሎች መስኮች እና አማራጮች አሉ, ግን የተወሰነ ጽሑፍ ለመለጠፍ መተግበሪያ የመፍጠር መሰረታዊ አስፈላጊ ነገሮች ናቸው. ሆኖም, ይህ ሞዴል ብቻውን አይሰራም. ከዚህ በፊት እንደተገለፀው ይህንን ሞዴል ሥራ እንድንሠራ የብጁ እይታ እና ብጁ ዩ አር ኤል ንድፍ እንፈልጋለን, እናም አብነትም አንድ ቅፅ እንፈልጋለን. በመጀመሪያ ቅጹን እንመርምር.

To define a form, edit app/forms.py with nano and add the following lines. We will need two imports, our forms class, as well as the model we created (feed.models.Post), a class definition similar to the model, and a field along with a subclass called Meta that will define the model the form interacts with. The form can also have an initialization function which sets it up based on information in the request, model or otherwise, we will explore this later.

Model forms are so useful because they can create a model or also edit a model, so we will use them for both. Let's define one in forms.py below.

from django import forms
from feed.models import Post

class PostForm(forms.ModelForm):
    text = forms.CharField(widget=forms.Textarea)
    class Meta:
        model = Post
        fields = ('text',)

This is the basics of what a form and model look like. This model form can be used to instantiate or edit a post, changing the text it contains. We'll look at integrating this form into a view next. First, let's make the migrations and migrate the database so our code can interact with the model when it runs. To do this, run the following commands:

python manage.py makemigrations
python manage.py migrate

ይህ አንድ ደቂቃ ለመፈፀም አንድ ደቂቃ ይወስዳል, ግን አንዴ ከሆነ በአመለካከቶች, በአማካይ ሊወርድ ወይም በሶፍትዌሩ ውስጥ በየትኛውም ቦታ ውስጥ ያለውን ሞዴሉን እንዲደርሱዎት ያስችልዎታል. አርአያችንን ማየት የምንችልበት እይታ በመናገር እንቀጥል. አርትዕ የመመገቢያ / ዕይታዎች. አርትዕ እና ቀደም ሲል እንደተጠቀሰው የሚከተለውን ኮድ ያክሉ. ከ # ምልክቱ በኋላ ማንኛውንም ነገር ማከል አያስፈልግዎትም, ያ ኮድ ስለ ኮዱ መረጃን ለማመልከት የሚያገለግሉ አስተያየቶች ነው. የእኛን ሞዴሎቻችንን በአመለካከት በማስመጣት እና በ ሀ ውስጥ ማንቀሳቀስ የምንችልበትን አውድ ማከል እንጀምራለን

    posts = Post.objects.all() #  Query all the posts in the database so far

This all looks pretty simple until we get to the bottom. Render, the value returned by the function instead of in a HTTP response like the previous example, always takes a request as its first input, accepts a context (in this case the posts in the database), which can now be rendered in the template, and returns the template defined in the function. The template is going to be an HTML document with a little bit of a language called Jinja2, which renders Python information into the HTML.

To start creating templates, make two directories in feed.

mkdir feed/templates
mkdir feed/templates/feed

Next, edit a template in the directory above, feed/templates/feed, and add the code for this example. Let's look at the template for this example.

This is a very simple template. It defines opening and closing HTML tags, a document type tag, a body tag with a legend title, a break tag which adds a small line across the screen, and a for loop that renders each post in the list of posts as a paragraph in the template. This is all it takes to render posts, but there are none in the database yet. Let's create some with the shell. We can run the shell with manage.py

python manage.py shell

Now, let's import our post model

from feed.models import Post

Next, we will create a simple post with a string and exit the shell. The string can be anything, as long it's valid text.

Post.objects.create(text='hello world')
exit()

Lastly, we will need to add a URL pattern to our feed. Because our feed app will use multiple URLs and we want to keep file sizes small, let's create a local urls.py in our feed app that looks like this:

from django.urls import path
from . import views

urlpatterns = [
    path('', views.feed, name='feed'),
]

We will also need to edit the urls.py in the base app, whatever we decided to call it, this was the first directory we created. Edit app/app.py and add the following to the URL patterns

from django.urls import include # ከላይ
    # ... previous code here

Now, when we run the server with python manage.py runserver, we will see the page we created because we have the model, view and template as well as URL pattern, along with items in the database. Next, let's implement the form we created and begin creating our own posts. But before we write too much code, let's make a backup using the script we wrote earlier, backup. Run this script in the shell, wait a few moments, and all of the code will be backed up to our git repository.

backup

ቅጹን መተግበር በአንፃራዊነት ቀላል ነው. ቅጹን እናቀርባለን, የልጥፍ ጥያቄ ተቆጣጣሪን ወደ እይታ አንፃር እንጨምር እና ወደ ተመሳሳይ እይታ ከመመለስዎ በፊት በመረጃ ቋቱ ውስጥ ያስገቡ. ቀደም ሲል የመጣነው የአቅጣጫ ተግባርን እና የእይታ ንድፍ ዩአርኤል ዩአርኤል ለማግኘት ተከላካይ ተብሎ ተጠርቷል. ይህንን በገመድ 'ምግብ' እንጠይቃለን: - ምግብን 'ምግብን' የሚካተቱትን ንድፍ ስምምነቱ ምግብ ስለሆነ እና አመለካከቱም ምግብ ተብሎም ይጠራል.

    posts = Post.objects.all() #  Query all the posts in the database so far
    if request.method == 'POST': #  Handle the post request
        form = PostForm(request.POST) #  Create an instance of the form and save the data to it
        if form.is_valid(): # ቅጹን ያረጋግጡ
            form.save() # አዲሱን ነገር ያስቀምጡ
        return redirect(reverse('feed:feed')) #  Redirect to the same URL with a get request
        'form': PostForm(), # ቅጹን በጥቅሱ ውስጥ ማለፍዎን ያረጋግጡ ስለዚህ እኛ ልንከፍለው እንችላለን.

Now, we'll need to update the template to account for the new form. We can do this by using the

tag in HTML and rendering the form in the HTML template with a submit button. We will also need a csrf token, a token which prevents external sites from posting to the form without first loading a page.

o የማገጃ መለያዎችን በመጠቀም ጽሑፉን እና የአብነት መለያ በመጠቀም ያሳዩ. አብነት የመብላት ክፍሎች ከእነሱ ጋር እንዴት እንደተሰጣቸው መግለፅ ስለቻልን, እና አብነት መለያዎች ተለዋዋጮችን እንዴት እንደምናደርግበት መሠረት ናቸው

Now we need to make our app look better, because for now it looks really basic. We can do this by using CSS, either inline, or in classes tied to each object in the document. CSS is really nice because it tells everything on the page how it should look, and can make it look really good. There are a few libraries that can do this, but my personal go to is Bootstrap.

Bootstrap can be downloaded from their website, getbootstrap.com/. Once there, press the button to read the installation docs, and copy the code from the include via CDN section. You will need this code at the top of your HTML document, in a tag called head. Also, let's go ahead and create a base template so we don't need to recreate these links in each template.

Make a new directory called templates with mkdir templates, and then edit templates/base.html.

It should look like this:

Make sure to copy the CSS and JavaScript, the .css and .js files, because we will need the JavaScript to make our site more functional in the future.

Now, let's return to the bash shell and run a quick command. Remember, if you ever need to access the virtual environment, type source venv/bin/activate. This will let you install python packages locally in a way that lets Django access them. To give our forms generated by Django bootstrap classes, we will use a python package called crispy forms. We can download this with the following command

pip install django-crispy-forms

Once this is installed, add it to the settings.py

    #  … previous code here

Now, back in our feed template, we can remove some things. Let's remove the beginning and end of the document and replace it with inheritance from our base template, using extends and the block definition. Also, we will add a template filter import with load and a template filter to the form. Lastly, let's add a bootstrap class to the button on the form to make it look more like a button. That should look like this:

Beautiful! That's quite a bit of code already. Next, we should test it out and make sure we can see that everything looks nice, and also be sure everything is working properly. Run the server as per previous instructions and make sure the site looks and works alright. Great job! You're ready to move on to the next step, in which we will add user login functionality using similar URLs, forms, views and templates. The base template is important, and we will continue to modify it and make changes as needed, but for now let's focus on making our site more secure, by enabling users to log in with a username and passcode, and eventually even more important information that will help keep your app secure and your own account accessible only by you.

To do this, we'll need to use the User model built into Django. The user model is a database model, like our post, that can be rendered to log a user into the website. In the future, before we deploy the site to the internet, we will extend this model with other models attributed to it, and build additional security measures for the login that are resistant to phishing. We will begin by using some built in login forms that Django provides. First, let's create a new app that we will use to render the templates and views for the basic login page. We will also create other apps to represent the continued login challenges in order to secure the app, including a pincode, facial recognition, near field communication, external devices, multi factor authentication, and fingerprint recognition.

አንድ መተግበሪያ ስለ መጀመር ቀደም ሲል ተነጋገርን. በምርጫችን ውስጥ, በእውነተኛው አካባቢ ውስጥ, በእነዚህ ነጋሪ እሴቶች ያስተዳድሩ

python manage.py startapp users

Now, we should have a directory for the new app. Let's start by creating a view in that directory that corresponds to the user login. Django has built in views for user logins, but these won't be suitable for us because we need a custom view, which is preferably done with a definition.

በዚህ እይታ ውስጥ ለድህረ ክፍያ ጥያቄን በመፈተሽ, የተጠቃሚውን መለያ በመግዛት የተጠቃሚውን መለያ ማረጋገጥ, የተጠቃሚውን መለያ ለማረጋገጥ እና ከመመገቢያ መተግበሪያዎ በፊት እነሱን ከማዞርዎ በፊት በተጠቃሚው ውስጥ ይግቡ.

In users/views.py, add the following code

        username = request.POST['username'] #  Get the username and password from the post request
        password = request.POST['password'] #  Authenticate the user

This is all you need for a basic login view. Now, let's create a form for the view by extending the base template. We'll start by creating a new directory for templates in the users folder.

mkdir users/templates
mkdir users/templates/users

Now, we should be able to edit users/templates/users/login.html. While we're at it, we'll create a template to allow the user to sign up too.

nano users/templates/users/login.html

Now, in the template,

ይህ የመግቢያ አብነት መሠረታዊ ነገሮች ናቸው. እሱ በእውነቱ ልክ እንደሌለው ሌላ ንድፍ ውስጥ ነው, ግን በሚተላለፍበት ጊዜ ትንሽ የተለየ ይመስላል. ይህንን ኮድ ለመገንባት ይህንን ኮድ ይመዝግቡ ይመዝገቡ የተመረቀውን ሌላ በጣም ተመሳሳይ የሆነ ተመሳሳይነት መመዘኛን ለመገንባት እና የምንገነባውን አዲስ ቅጽ የምንጠቀምበት ነው. አብራችሁ አብረን እንሁን. ተጠቃሚዎች / አብነቶች / ተጠቃሚዎች / ተጠቃሚዎች / ይመዘግባሩ / ይመዘግባሩ እና የሚከተለውን ኮድ ያክሉ

Now, let's build a form for our user registration and circle back to the views before we upgrade our user logins with a model. We'll make this form basic to start with, but incorporate more details and security features such as agreements and Captcha in the future. Edit the forms with nano users/forms.py, and add the following code.

from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm

class UserRegisterForm(UserCreationForm):
    email = forms.EmailField()

    class Meta:
        model = User
        fields = ['username', 'email', 'password1', 'password2']

ስለዚህ በቀላሉ በትክክል በትክክል የሚሠራ እዚህ አንድ ዓይነት አለን. የተጠቃሚ ስም, ኢሜል እና በይለፍ ቃል እንዲሁም እንዲሁም በይለፍ ቃል መስክ አማካኝነት የተጠቃሚ ምዝገባ ቅጽ ነው. ይህ ቅጽ መደበኛ ቅጾችን እንዳያንፀባርቅ ልብ በል, እሱ የሚሠራው የሞዴል ቅፅ ነው ማለት ነው. አንድ መስክ አንድ ዓይነት ብቻ ነው የተገለፀው እና የክፍሉ ሜታ ሞዴሉን ለቅሪው ከተጻፈው መረጃዎች ጋር ይዛመዳል. አብዛኛዎቹ ይህ ቀደም ሲል በተጠቃሚዎች በተገነባው የመላኪያ አገልግሎት ውስጥ አሉ, ስለዚህ እኛ

ቀጥሎም, አንድ ተጠቃሚ እና አንድ አብነት አለን የሚለውን ተጠቃሚ ለመመዝገብ ያለውን አመለካከት እንመረምራለን. ይህ በአዲሱ የልብስ እይታ ውስጥ እንደነበረው ሁሉ ይህ ሞዴል ነው. ተጠቃሚዎችን / እይታዎችን / እይታዎችን ያርትዑ እና የሚከተለውን ኮድ ያክሉ

# ... አስመጣ

This is all we need to get a user registered, but we should have more information. We want to know the time the user registered, what time they were last on the site, some information about them, like a biography, timezone, etc. Also, we will need to update our feed model, Post, to account for the User model and attribute posts to each user. In order to do that, we will update the models.py in both apps. Let's start by editing the feed model. It should look like this now:

from django.db import models # ... አስመጣ
    author = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True, related_name='posts') #  Add in this line

ወደ ፋይል ለተጨመረው ሁለተኛው መስመር ትኩረት ይስጡ. ይህ ለእያንዳንዱ ልኡክ ጽሁፍ እያንዳንዱ የውጭ ቁልፍ ነው, ስለሆነም እያንዳንዱን ልኡክ ጽሁፍ ውስጥ በተጠቃሚው መሠረት ላይ ባሉ ተጠቃሚዎች ላይ ማዳን እናረጋግጣለን እንዲሁም ለተጠቃሚው ሳያገለግሉ መደረግ የለብንም. ይህንን የውጭ ቁልፉ ከክፍል ክፍል ጋር እንያንፀባርቃለን, ተጠቃሚው አስፈላጊ ከሆነ ተጠቃሚውን ማስወገድ እንደምንችል እና ለተጠቃሚው እጥረት ለማመቻቸት መሰረዝ ሰርዝልጥፎችን ለመጥቀስ የምንጠቀምበት እና የተዛመደ ስም, ተጠቃሚው ለድህረ-ሀሳቦች ለመጥቀስ የምንችልበት ከድህበቶች ላይ ነው. የፖስታው ደራሲ ከፖስታ ጋር በተለየ መልኩ ይህ ተዛማጅ ስም ልጥፉን እራሱን እንዲለጠፍ ተጠቃሚ ይሰጠናል. አሁን በተንቀሳቃሽ ተጠቃሚው የተሰራ ተጠቃሚ አሁን ልጥፎችን ማግኘት እንችላለን.

አሁን, ዝግቦቻችን የበለጠ ለመቋቋም እናድርግ. እኛ ወደ ጣቢያው ለመግባት የምንፈቅድላቸውን ጊዜያት ብዛት በመገደብ ለማስመሰል ጣቢያችንን ለማስገር አቅማችን አስገርሞ ማድረግ እንችላለን, ይህ በጣም ቀላል ነው. እንዲሁም የእኛን መተግበሪያ ማጎልበት እንደቀጠለ ስለ እያንዳንዱ ተጠቃሚ የተወሰነ መረጃ ማከማቸት እንጀምር. ተጠቃሚዎችን / ሞዴሎችን.ፒ.ፒ.

from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone

class Profile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE, null=True, blank=True, related_name='profile')
    account_created = models.DateTimeField(default=timezone.now)
    last_seen = models.DateTimeField(default=timezone.now)
    can_login = models.DateTimeField(default=timezone.now)
    preferred_name = models.CharField(max_length=20,default='', null=True, blank=True)
    bio = models.TextField(blank=True, default='')

Note that this model is fairly similar to the Post model. We have an additional import, timezone, which will allow us to set defaults on the datetime fields, and we also have a CharacterFeild and TextField like the post. Using all of these timestamps helps us secure the site and understand its use, and the text fields let us render information about each user, or author, on the website. The OneToOneField should be the only minor consideration, it behaves exactly the same as a ForeginKey but with only one per subsequent model. This way, the user only has one profile, while they may have many posts.

Now, let's improve our login and register views to account for the profile. First, edit users/views.py and focus on the register view:

# ... አስመጣ
            Profile.objects.create(user=user) # ለተጠቃሚው መገለጫ ለመፍጠር ይህንን መስመር ማከልዎን ያረጋግጡ

This simply creates a profile for the user, without filling in any of the information. Now, we want to make sure the user account can't be logged into too often, or at least passwords can't be tried too often, so let's update the login view.

# ... አስመጣ
        if user and user.profile.can_login < timezone.now(): #  Note that we now check if the user can log in
        else: #  If the login wasn't successful,
            user = User.objects.filter(username=username).first() #  This is the part where we update the users profile 
                profile.can_login = timezone.now() + datetime.timedelta(seconds=15) # ስለዚህ ለጥቂት ሰከንዶች እንደገና መግባት አይችሉም

This is the basic fundamental of security. Make sure the site isn't vulnerable to someone simply trying every possible password combination, or even a few of them at the same time. This won't be frustrating to the ordinary user who knows their passcode and just logs in on a few devices, but it will keep numerous phishing robots out of the app. Note that we added an if statement with a variable, can_login, that should be a time in the past, and update it with each unsuccessful login using the same username. This way, a malicious user won't be able to guess a password anywhere near as quickly. The number of seconds in the datetime.timedelta() can be updated too, and the website will be more resilient yet slightly less usable with more seconds. I recommend 15 to start with.

Remember, we built a backup script to save our work, so let's go ahead and back up what we have so far to make sure we have everything saved. Run the command:

sudo backup

Once again, this will save your work so far. I recommend running frequent backups to save your work, and you might even want to run a backup job automatically. You can do this using a UNIX utility called cron. To activate this utility, run the following command and enter your password:

sudo crontab -e

If you haven't already select option 1 for nano, the text editor you should already be familiar with, and scroll to the bottom of the file using the arrow keys. Add the following line:

0 * * * * sudo backup

Cron uses the format minute, hour, day of month, month, day of week, where a * or a number represents when to run the command. Using a 0 for the minute and * for the rest of the options, we can run a command on the first minute of every hour at the start of the minute. This lets us back up the code automatically. All of cron's jobs when executed with sudo run as root, so we won't need to type in a password every hour.

የይለፍ ቃል ሳይጠቀሙ ኮዱን ለማግኘት ቀላል ለማድረግ, የመጠባበቂያ ቅጂ መመሪያችን የይለፍ ቃል እናሰናከል. ይህንን ትእዛዝ በመፈፀም እና የይለፍ ቃል ለማስገባት ይህንን እናደርጋለን-

sudo visudo

Now, let's scroll to the bottom of the file and add another line:

ALL ALL=NOPASSWD: /bin/backup

ይህ የይለፍ ቃል የሌለበት የትእዛዝ "ምትኬ" እንድንሰራ ያስችልናል. ለዚህው ቅርጸት "ሁሉንም መስመር" ቅድመ-ቅጥያ "ከሁሉም ሁሉም = NOPAPADDD /" ከትእዛዙ ጋር, ለምሳሌ / ቢን / ቢን / ቢን / ቢን / ቢን / ቢን / ቢን / ቢን / ቢን / "

Now, let's start working with email. Email is really important for websites, because it's a way to keep a website more secure, verify users are real people, and even market products or services to customers. Many people who frequent the internet check their email daily, and receive all sorts of marketing email about products and services they are interested in. There are a few options when it comes to enabling email on a Django website, and you're welcome to pick whichever works best for you.

በመጀመሪያ, ከጎራዎ ኢሜል ለመላክ እና አነስተኛ ኮድ እንዲፈልጉ የሚያስችልዎ የኢሜል አገልግሎት መክፈል ይችላሉ. እንደ ጉግል የስራ ቦታ, ላክልቢል, የመልእክት ቦውጅ እና ሌሎችም ያሉ ብዙ አገልግሎቶች አሉ.

Otherwise, you are well off building your own email service within your server from scratch. I recommend this option, even though it's more code and may require special hosting. You won't be able to start a mail server from your home computer most likely, so let's go ahead and examine the configuration and code to send email before we start a server in the cloud and create our own mail server within.

በመጀመሪያ, ቅንብሮችን ያርትዑ. ከሚከተለው ትእዛዝ ጋር

nano app/settings.py

መተግበሪያው ከጅምሩ ሲጀምሩ የመተግበሪያው ስም የት ነው.

የሚከተሉትን መስመሮች ያክሉ

SITE_NAME = 'Django App'

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_ADDRESS = username@server.com'
EMAIL_HOST_USER = 'username'
EMAIL_HOST_PASSWORD = config['EMAIL_HOST_PASSWORD']
DEFAULT_FROM_EMAIL = '{} <{}>'.format(SITE_NAME, EMAIL_HOST_USER)

መተግበሪያዎን ለማሰማራት ዝግጁ በሚሆኑበት ጊዜ እነዚህን መለወጥ ያረጋግጡ, ይህንን በኋላ እንጎበኛለን. የኢሜል_አድግ ማቆያ ቅንጅት ለመላክ የሚፈልጉት ኢሜል መሆን አለበት, እና የይለፍ ቃል (ኢሜል_አስፈላጊ_አስተዋይ) ለአገልጋዩ ለሚያመሩት የይለፍ ቃል መዘጋጀት አለባቸው. ከዚህ በላይ በቅንብሮች ውስጥ ከዚህ መስመር በላይ ከሚጠቀሙት ኮዱ ውስጥ ለማስቀመጥ የይለፍ ቃሉን ከጨረር ጋር እጭናለሁ.

import os
import json
with open('/etc/config.json') as config_file:
    config = json.load(config_file)

Then, I have set up a JSON file with the config in /etc/config.json using nano as follows.

ፋይሉን ለማረም:

sudo nano /etc/config.json

የሚከተሉትን መስመሮች ያክሉ

{
	"EMAIL_HOST_PASSWORD": "<some password here>"
}

We will continue to edit the config file and add all of the passwords and keys we will use in the app. For now, let's quickly examine how to send email using Python. First, let's create a template for a verification email we can send to our users, and put it in the user templates directory. This template will be written in HTML.

nano users/templates/users/verification_email.html

This email is fairly simple. It takes a context of a user, the base URL for the site, and a user ID and token which are used to verify the user's email. Make sure to define the base URL in settings.py before we write some Python code to render the template. Go ahead and add the following lines to app/settings.py, near the beginning.

SITE_NAME = 'Django App'
PROTOCOL = 'https'
DOMAIN = 'example.com'

BASE_URL = PROTOCOL + '://' + DOMAIN

Eventually, when your site is ready for the internet and you deploy it, you will want to define your domain as the domain name you buy to represent the site. This is the name that you will type in the navbar in order to access your site. For now, you can leave the domain blank or use a placeholder. You will also want to change the SITE_NAME to a name you want to give your site, of your choosing.

ኢሜል ከመላክዎ በፊት የተስፋፋ ማነቃቂያ ማስነሳት የሌለበት የመለያ አግብር ማነቃቂያ እንዲኖረን ለማድረግ የተረጋገጠ የጄኔሬተር ይፍጠር. የሚከተሉትን የሚመስሉ የመለያ ማግበር ማነቃቃትን በመገንባት እና በማስመጣት ይህንን ማድረግ እንችላለን. ፋይሉን ያርትዑ

nano users/tokens.py

Add the following code:

from django.contrib.auth.tokens import PasswordResetTokenGenerator
import six
class TokenGenerator(PasswordResetTokenGenerator):
    def _make_hash_value(self, user, timestamp):
        return (
            six.text_type(user.pk) + six.text_type(timestamp)
        )
account_activation_token = TokenGenerator()
unsubscribe_token = TokenGenerator()

This basic token generator generates a token we can send the user in a URL and the user can use to verify their email and activate their account.

Next, let's see how to send an email. Using nano, edit users/email.py.

nano users/email.py

የማረጋገጫ ኤችቲኤምኤል ኢሜል መላክ እንደዚህ ይመስላል-

from django.contrib.auth import get_user_model
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.encoding import force_bytes
from django.core.mail import EmailMultiAlternatives
from django.shortcuts import render
from .tokens import account_activation_token
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from django.template import Template, Context
from django.conf import settings
import traceback

def send_verification_email(user):
    User = get_user_model()
    mail_subject = '[{}] Activate your account.'.format(settings.SITE_NAME)
    html_message = render_to_string('users/verification_email.html', {
        'user': user,
        'domain': settings.DOMAIN,
        'protocol': 'https',
        'uid': urlsafe_base64_encode(force_bytes(user.pk)),
        'token': account_activation_token.make_token(user),
    })
    send_html_email(user, mail_subject, html_message)

This is fairly simple. We import the functions we need to send the email, render the email with templates, and our settings, and then we define the email by the template name and send it to the user using a function. You'll notice we haven't defined the function to send the mail, send_html_email, yet, so let's write this below the code we already added to users/email.py

def send_html_email(user, mail_subject, html_message):
    to_email = user.email
    username = user.username
    if to_email == '':
        return None
    unsub_link = settings.BASE_URL + user.profile.create_unsubscribe_link()
    html_message = html_message + "<p><a href=\"" + unsub_link +  "\" + title=\"Unsubscribe from " + settings.SITE_NAME + " emails\">Unsubscribe</a></p></body></html>"
    msg = EmailMultiAlternatives(mail_subject, strip_tags(html_message), settings.DEFAULT_FROM_EMAIL, [to_email], headers={'List-Unsubscribe' : '<' + unsub_link + '>'},)
    msg.attach_alternative(html_message, "text/html")
    profile = user.profile
    try:
        msg.send(fail_silently=False)
        if not profile.email_valid:
            profile.email_valid=True
            profile.save()
    except:
        profile.email_valid=False
        profile.save()

This is a bit more complex, and we aren't ready to run all of this code yet. Notice we are defining an unsub_link, the link the user can use to unsubscribe from our emails. This is important, because users will need to be able to opt out of our emails unless they want to see them, at any time. We also add a text alternative to our message, which is the HTML message stripped of HTML tags. Lastly, we check if the email sent, and if it didn't, we mark in the user's profile that their email isn't valid.

Let's move back to the user models so we can make this all work. We need to define a function to generate a link to unsubscribe, and define a boolean field to mark that the user's email is not valid.

First, add the following imports to the top of users/models.py

nano users/models.py
#  …

Next, let's add functions to the user model to make the token and check the token used to activate the email, as well as the field to save whether the user is successfully receiving their mail. In users/models.py again, add the following code to the end of the model (indented code)

#  …
            TimestampSigner().unsign(key, max_age=60 * 60 * 24 * 30) # ለ 30 ቀናት ይሠራል

This is fairly simple, we use a timestampsigner, which is a basic cryptography tool, to create a token which will expire after a certain amount of time, and we also use another function to check if it is valid. We use these tokens twice, once to verify the email, and once for an unsubscribe link.

Now that we have these, the last of the work we will need to do is in the views. Within users/views.py, let's add views to verify the email address, and to unsubscribe.

nano users/views.py

First, add the following imports. I threw in a few extra so we won't have to import more items again later.

from .email import send_verification_email #  Make sure to import the verification email sending function

You may already have some of these imports, but it doesn't hurt to repeat them. You're going to need to import the verification email sending function, as well as account_activation_token from users.tokens, among other imports.

Now, at the bottom of the file, add the following code:

        #  unsubscribe them
    #  Otherwise redirect to login page
#         sendwelcomeemail(request, user)

ለዚህ መሰረታዊ ቅጹን ይጠቀሙ እና የማረጋገጫ ኢሜሉን ለመላክ ተግባሩን ይደውሉ. ይህንን ከማድረጋችን በፊት በመጀመሪያ ደረጃ ወደ የመመዝገቢያ እይታ ውስጥ የተግባር ጥሪ በማከል በመጀመሪያ ደረጃ እንደተላከ እናረጋግጣለን. በመመዝገቢያ እይታው ውስጥ ከመቀየርዎ በፊት ይህንን መስመር ያክሉ, ከመልሶው ምዝገባ ውስጥ, በ ውስጥ

nano users/views.py
#  … (after) def register(request):
# ... (በፊት) አቅጣጫ (

You don't need to add the first and last lines in that code snippet, just make sure the register view sends the verification email to the user. It should look like this:

# ... አስመጣ
            send_verification_email(user) #  Make sure to add this line!

አሁን, ማግበር ኢሜል ለመምራት አንድ ቅጽ ማከል አለብን. በተጠቃሚዎች / ቅጾች. Doy ውስጥ የሚከተሉትን ቅጽ ያክሉ

#  … (imports)

We will also need a template corresponding to this resend email activation form. Let's add this template in. Edit the file:

nano users/templates/users/resend_activation.html

ቀጥሎም የሚከተሉትን ኮድ ወደ ፋይል ያክሉ.

Whew, that's a lot! Now, when we deploy the code to our server, we will be able to send HTML email and activate user accounts with a click in the email. We also might want to send a simple welcome email, so let's see how to do that. Back in users/email.py, add the following code:

def sendwelcomeemail(user):
    User = get_user_model()
    html = open('{}/users/welcome_email.html'.format(settings.BASE_DIR)).read()
    subject = 'Welcome to ' + settings.SITE_NAME + ', {{ username }}!'
    template = Template(html)
    subjtemplate = Template(subject)
    context = Context({'username': user.username, 'base_url': settings.BASE_URL, 'model_name': 'Daisy Holton, 'site_name': settings.SITE_NAME})
    renderedtemplate = template.render(context)
    subjcontext = Context({'username': user.username})
    subjrenderedtemplate = subjtemplate.render(subjcontext)
    send_html_email(user, subjrenderedtemplate, renderedtemplate)

እንዲሁም ይህንን መረጃ ሁሉ ለማስተናገድ አንድ ንድፍ እንፈልጋለን. በድር ጣቢያዬ ላይ አብቅቷል ከዚህ በታች የተወደደ ይመስላል, ግን እርስዎ የሚወዱትን ያህል ወደቀ.

Note that we don't have closing body or html tags, because we add these in when we add the HTML unsubscribe link. These are important, but we don't want to define them twice.

te.

We'll also need a password reset view, so let's add that in really quick. Django's built in password reset view is broken in some functions, but we'll look at how to write our own view, email template, forms, and URL patterns. Here's what the view looks like, in users/views.py

# ... imports

This form is built in to Django, but we'll need a template to confirm the password reset, users/templates/users/password_reset_confirm.html

We also have a template to send a password reset email, with a simple form, in users/templates/users/password_reset.html

ኢሜል ራሱ በቀላሉ ቀላል ነው, በተጠቃሚዎች / አብነቶች / ተጠቃሚዎች / ተጠቃሚዎች / ተጠቃሚዎች / ተጠቃሚዎች ውስጥ የይለፍ ቃሉን ለማስጀመር አገናኝን የሚያመለክቱ መሰረታዊ የኤችቲኤምኤል ፋይል ነው. ዲጀንጎ ይህንን ፋይል በራስ-ሰር ይተረጉማል.

We'll also need two more templates. The first is to confirm that the email has been sent. Views for these are already in Django, so we just need to address them in the urls.py. This template is located at users/templates/users/password_reset_done.html

And lastly, to confirm that the password reset is complete, users/templates/users/password_reset_complete.html

Now, we need URL patterns for these views. In users/urls.py, add the following URL patterns:

    # ... Previous URLs here

Four templates, that's a lot! But now we can be sure to be able to reset the user's password any time we need to, all from the web browser.

ለመቀጠል, በመቀጠልም ኮድዎን ወደ ሩቅ አገልጋይነት ማሰማራት እና የሜይል አገልጋይዎን ለማስተካከል እና የባህራቸውን አገልግሎት ማዋቀር, ስለሆነም በጥቂት ቀላል ፕሮጀክት ማዋቀር ይችላሉ

ስለዚህ የእኛን ግባችን ተጨማሪ ደህንነት ለማከል ጥቅም ላይ ከሚውለው የተጠቃሚ ሞዴል ጋር ማሽከርከር, የተሽከረከር መለያ ያክሉ. የተጠቃሚውን ሞዴሎች, ተጠቃሚዎች / ሞዴሎች. Top., የሚከተሉትን ያክሉ

#  Make sure to import the uuid, timestamp signer and URL generator (reverse)
    #  Add this code here
    # እና ይህንን ተግባር ያክሉ
            TimestampSigner().unsign(key, max_age=60 * settings.AUTH_VALID_MINUTES) #  Valid for 3 mins

እሱ ተጠቃሚ. ሁለት የመረጃ ማረጋገጫ ማረጋገጫ እይታን ለመገንባት ይህንን መሰረታዊ ምስኪኖች እንጠቀማለን. ሌላ ማንኛውንም ነገር ከማድረጋችን በፊት የተጠቃሚ ሞዴሎች እንዲዘመኑ ፍልሶቹን እንሂድ. ከማውጫው ጋር በማውጫው ውስጥ, ከሚያገለግሉት ትዕዛዞች የሚከተሉትን ትዕዛዞች ለማጠናቀቅ እና ለማጠናቀቅ የሚከተሉትን ትዕዛዞች ያሂዱ

source venv/bin/activate
python manage.py makemigrations && python manage.py migrate

This is important because every time we make changes to the models, we will need to create the tables and update the database with defaults before we can actually use the models.

Next, let's improvise our login view to redirect to a secondary authentication view. In users/views.py, remove the login function and redirect to the URL we just generated in the user models.

# ... አስመጣ
        if user and user.profile.can_login < timezone.now(): #  Note that we now check if the user can log in
            #  Remove the auth_login function that was here
                return redirect(user.profile.create_auth_url()) #  Note we redirect to a new URL here
            else: #  If the user isn't using mutli-factor authentication, just log them in.
        else: #  If the login wasn't successful,
            user = User.objects.filter(username=username).first() #  This is the part where we update the users profile 
                profile.can_login = timezone.now() + datetime.timedelta(seconds=15) # ስለዚህ ለጥቂት ሰከንዶች እንደገና መግባት አይችሉም

So this is pretty simple, we now have a way to redirect to the two factor authentication view when we create it. We also have a fallback in case the user hasn't added a phone number. We will add a basic view to add a phone number soon and log in with a text message soon.

First, we need an easy way to send a text message from our code. To do this, we can choose from a number of APIs, but the easiest one in my opinion is Twilio. They also offer good pricing for smaller projects, as well as bulk discounts. Create an account on Twilio.com, fill in some details about your project, buy a phone number, and copy your API keys to your settings.py. Then, add this code under a new file, users/sms.py.

nano users/sms.py
#  Import all of the necessary packages
#  This code sends the text with twilio
#  A helper function to get a number with so many digits
# ተጠቃሚውን ለማረጋገጥ ጽሑፉን ይላኩ
#  Send a user any text with this function
#  Validate the code with this function
#  Validate the time

ቅንብሮችዎን በተገቢው ሁኔታ መለወጥዎን ያረጋግጡ, እነዚህን መስመሮች ጋር በመጨመርዎ ላይ ማከልዎን ያረጋግጡ.

#  Make sure to copy these from your Twilio dashboard
AUTH_VALID_MINUTES = 3 # የ TFA ገጽ ቁጥር የቲፋ ገጹ ቁጥር አንድ ጊዜ የተካሄደ ነው

በመጀመሪያ ለሁለቱም የማረጋገጫ ማረጋገጫ አመለካከቶች ቅጾችን እንፈልጋለን. ተጠቃሚዎችን / ቅጾችን / ቅጾችን ማረም, የሚከተሉትን ኮድ ያክሉ.

# ... አስመጣ
# የስልክ ቁጥራችንን ለማስገባት አንድ ቅጽ
#  A form for authenticating

Next, let's create the views in users/views.py

# ... አስመጣ

ለሁለቱም አመለካከቶችም አብነቶች እንፈልጋለን. በመጀመሪያ የኤምኤፍ አብነት እንጨምር.

nano users/templates/users/mfa.html

ይህንን HTML ኮድ ወደ አብነት ያክሉ

ይህ በጣም ራስን ማገገም ነው. ቅጹ አንድ ኮድ ወይም ባዶ ኮድ ይልካል, እና ባዶ ኮድ ከተቀበልን ኮዱን በምንቀበልበት እይታ ውስጥ ያስተውላሉ. ከዚያ እኛ ሁለት የማስረከቢያ ቁልፎች አሉን, እናም በዚህ መንገድ ኮዱን በሁለቱም አዝራር አማካኝነት መላክ እንችላለን. ቀጥሎም የስልክ ቁጥርን ለማከል አንድ ቀላል ቅጽ እንጨምራለን.

nano users/templates/users/mfa_onboarding.html

የሚከተሉትን HTML ያክሉ

This form is a lot simpler, it just renders the phone number form we created and lets the user add a phone number.

This looks really good! As long as everything is properly set up, we should be able to send messages, and log the user in with their phone number as soon as we add the URL patterns. The last thing we need to set up is a profile view so we can make sure the user can change their phone number without being logged in. Also, eventually we will want to add a "stop to quit" option, so the user can text "stop" to opt out of future text messages.

ለተጠቃሚዎች / ዕይታዎች. Topy የመገለጫ እይታን እንመልከት. ይህ አመለካከት የተጠቃሚውን ባዮ, ኢሜል, የተጠቃሚ ስም እና የስልክ ቁጥርን ይዘን ያዘምናል, እንዲሁም እኛን የሚገልጽ ማረጋገጫ ማረጋገጫ. በመጀመሪያ, በተጠቃሚዎች / ቅጾች ውስጥ ሁለት ተጨማሪ ቅጾችን እንፈልጋለን

# ... imports

ቀጥሎም ሁለቱንም እነዚህን ቅጾች ለመጠቀም እይታ መፍጠር እንችላለን. ተጠቃሚዎችን / እይታዎችን / እይታዎችን ያርትዑ እና በእይታ ውስጥ ይጨምሩ.

# እነዚህን ማስመጣት ያክሉ

እኛ ደግሞ ለዚህ አመለካከት አብነት እንፈልጋለን.

nano users/templates/users/profile.html

ይህንን ያስተውላሉ, በትክክል ቀላል ቅጽ ነው, ግን በቅጹ ላይ እንደተዘመኑ በራስ-ሰር የሚገልጹ አንዳንድ ጃቫስክሪፕት አለው. ይህ ጠቃሚ ነው, ስለዚህ እያንዳንዱን ጊዜ ማስገባት ሳይኖርብዎት አርት ed ቶችን ማድረግ ችለዋል.

ቀጥሎም, እነዚህን ሁሉ ዕይታዎች በተጠቃሚዎች የዩ አር ኤል ፓርቲዎች ውስጥ እነዚህን ሁሉ ዕይታዎች የሚወክሉ ኡልሎች እንፈልጋለን. ተጠቃሚዎችን / ዩ.አር.ኤል.ፒ.

# ... የቀደመ ኮድ, አስመጣ
# ከዚህ ቀደም የገባን የዩ አር ኤል ቅጦች የሚቀጥሉትን ሶስት መስመር ያክሉ

ፕሮጀክታችን ለመፈተን አሁን ጥሩ ጊዜ ነው. ግን በመጀመሪያ ሌላ ምትኬን እንሂድ.

backup

And run the server. Before we deploy to a linux server, it's a good idea to enable two factor authentication on the account. We'll do this going to our profile URL, /users/profile/, and checking the box to enable authentication after entering our phone number, and then submitting the form.

python manage.py runserver localhost:8000

ወደ የድር አሳሽዎ በመሄድ ድረ-ገጽን ይጎብኙ, Google Chrome በዚህ ምሳሌ ውስጥ እጠቀማለሁ, እና ወደ ዩ.አር.ኤል. ኤም.ቲ.ፒ.ፒ.ፒ.

You will be able to log in if necessary and enable two factor authentication.

This project needs a server to run on so it can really send mail. But first, we need a way to see errors. You'll notice that if you run the server in debug mode, with settings.DEBUG equal to True, the server shows errors automatically. To show errors without using debug mode, which is unsafe on a production server, we should add a view for it. The most important errors we need to be able to handle are:

Error 500 - A problem with our code Error 404 - A page that wasn't found (broken URL) Error 403 - A permission denied error

Let's add an new app to handle these errors, called errors.

python manage.py startapp errors

ከዚህ በፊት ይህንን ወደ ቅንብሮች ያክሉ. በተጫነ_አድሪፕት ውስጥ እንዳደረግነው መተግበሪያ መተግበሪያ / ዩ.አር.ኤል.ፒ.

handler404 = 'errors.views.handler404'
handler500 = 'errors.views.handler500'
handler403 = 'errors.views.handler403'

This is all we need besides error views, templates and a little bit of middleware. Let's define those as so:

#  Create your views here.

ቀጥሎም በመካከላተኛ መሃንዲስን እነዚህን ስህተቶች ለማስተናገድ እንችል. እኛ በመነሻዊነትዎ ውስጥ በመነሻዊነት ቅንብሮች ውስጥ ወደ መካከለኛ ፍለጋ_ቆጥር_ቆሳዎች በመጨመር ይህንን እናደርጋለን.

    # ... previous middleware

ቀጥሎም, መካከለኛ ደረጃውን እንጨምር.

from threading import local
import traceback
from django.utils.deprecation import MiddlewareMixin

_error = local()

class ExceptionVerboseMiddleware(MiddlewareMixin):
    def process_exception(self, request, exception):
        _error.value = traceback.format_exc()

def get_current_exception():
    try:
        return _error.value
    except AttributeError:
        return None

def set_current_exception(exception):
    try:
        _error.value = exception
    except AttributeError:
        print('Attribute error setting exception.')

We add a function to get the current exception by using a threading local, which helps us trace any errors in our code. In terms of templates, we only need one, because we dynamically define the title in the view. The template just needs to render the title and "trace", our error traceback from the context.

nano errors/templates/errors/error.html

This is our simplest template yet, but that's how easy it is to see the errors in our project. Next, let's disable debug in settings.

nano app/settings.py

ወደ እውነት የተቀመጠበት ይህንን መስመር ይፈልጉ እና ወደ ሐሰት ይለውጡት

DEBUG = False

Go ahead and backup the app now. We are ready to deploy to a remote linux server, and keep adding features from there.

sudo backup

እንደ የጣት አሻራ ወይም የፊት ቅኝት የመታወቂያ አሻራ ወይም የፊት ቅኝት ቅኝት

እኛ የምንመረምነው ባለብዙ መረጃ ማረጋገጫ ማረጋገጫ ምሳሌ, ነገሮች የተለያዩ ሊሆኑ ይችላሉ. ዝማሬዎችን እና የምስጋና የምስክር ወረቀቶችን በገደብ እንዴት እንደምንወጣ ልብ ይበሉ. ሮቦቶች አንድ ጣቢያ የሚጠቀሙ ከሆነ, ተጠቃሚው በተመሳሳይ ጊዜ ኮዶች እንዲገቡ ለማድረግ ሁለት መረጃ ማረጋገጫዎች የበለጠ ከባድ ሊሆን ይችላል. ይህንን ለመዋጋት በተጠቃሚዎች ሞዴሎች ውስጥ አንድ ሞዴል እንጠቀም. ከጣቢያው ጋር አንድ ሞዴል እንጠቀምበት, ከጣቢያው ጋር እንዴት እንደምንገናኝ እናገለግለን ከጣቢያው ጋር እንዴት እንደምንገናኝ እናገለግለን. እኛ ደግሞ እንጨምራለን

nano users/models.py

This is what the model we are adding should look like. We don't need any methods, just variables to store an id, the user, the timestamp, expiration, length and attempts against any multi factor authentication (a code like 123456 sent to a phone or email).

#  A basic token used to log in to the website

Let's also add a privilege to our user, and we will set it manually for now, before eventually migrating to enlisting privileged users automatically. In the user models, add this line in the Profile:

    vendor = models.BooleanField(default=False)

As with any changes to the database, we need to make migrations and migrate the database any time we edit a models.py file in Django. Remember, to do this we use source first (if it hasn't been used already since the terminal was open) and then python manage.py to make the migrations and migrate.

cd project-directory-you-named #  (if needed)

For now, you can enlist any accounts you have created as vendors by using the shell.

python manage.py shell
from users.models import Profile
p = Profile.objects.get(user__username='Charlotte')
p.vendor = True
p.save()
exit()

Now, let's evolve our multi factor authentication view to use this token. First, we need to modify our MFA helper utilities. Using nano,

nano users/mfa.py
from django.utils import timezone
import random
import datetime
from django.conf import settings
from feed.middleware import get_current_request
from django.contrib import messages
from .email import send_html_email
import traceback
from .models import MFAToken

account_sid = settings.TWILIO_ACCOUNT_SID
auth_token = settings.TWILIO_AUTH_TOKEN
source_phone = settings.PHONE_NUMBER

def send_text(target_phone, text):
    from twilio.rest import Client
    try:
        client = Client(account_sid, auth_token)
        if len(target_phone) >= 11:
            message = client.messages.create(
                to=target_phone,
                from_=source_phone,
                body=text + ' Text STOP to cancel.')
    except:
        messages.warning(get_current_request(), 'There was an error sending the message.')
        print(traceback.format_exc())

def get_num_length(num, length):
    n = ''
    for x in range(length):
        n = n + str(num)
    return int(n)

def send_verification_text(user, token):
    length = user.profile.verification_code_length
    code = random.randint(get_num_length(1, length), get_num_length(9, length));
    token.token = code
    token.expires = timezone.now() + datetime.timedelta(minutes=settings.AUTH_VALID_MINUTES)
    token.save()
    send_user_text(user, "Your verification code for {} is {}".format(settings.SITE_NAME, str(code)))

def send_verification_email(user, token):
    length = user.profile.verification_code_length
    code = random.randint(get_num_length(1, length), get_num_length(9, length));
    token.token = code
    token.expires = timezone.now() + datetime.timedelta(minutes=settings.AUTH_VALID_MINUTES)
    token.save()
    send_html_email(user, "Your verification code for {} is {}".format(settings.SITE_NAME, str(code)), "<p>Dear {},</p><p>Your verification code for {} is {}. Thank you for using this code to secure your account.</p><h2>{}</h2><p>Sincerely, {}</p>".format(user.profile.name, settings.SITE_NAME, str(code), str(code), settings.SITE_NAME))

def send_user_text(user, text):
    send_text(user.profile.phone_number, text)

def check_verification_code(user, token, code):
    token.attempts = token.attempts + 1
    profile = user.profile
    result = (token != None and code != '' and token.token == code and (token.expires > timezone.now()) and token.attempts <= settings.MFA_TOKEN_ATTEMPTS)
    if token.attempts < 3 and result:
        profile.verification_code_length = 6
    elif token.attempts > 1 and not result:
        profile.verification_code_length = profile.verification_code_length + 2
        if profile.verification_code_length > settings.MFA_TOKEN_LENGTH: profile.verification_code_length = settings.MFA_TOKEN_LENGTH
    token.save()
    profile.save()
    return result
#  Authenticate the user using their email or phone number
    token = MFAToken.objects.filter(uid=username, expires__gt=timezone.now() + datetime.timedelta(seconds=30)).order_by('-timestamp').last() #  Filter the token by the value passed in the URL (a UUID)
    if not token: token = MFAToken.objects.create(user=User.objects.filter(profile__uuid=username).first(), uid=username, expires=timezone.now() + datetime.timedelta(seconds=115)) #  If this session hasn't been created, create it
    user = User.objects.filter(id=token.user.id).first() #  Get the user from the token
    if not user and request.user.is_authenticated: return redirect(reverse('feed:home')) #  If they are already authenticated, log them in
    if not user: raise PermissionDenied() #  Deny if no user was found
    if not user.profile.enable_two_factor_authentication and user.is_active and user.profile.check_auth_token(usertoken, token): #  Check the auth token
        auth_login(request, user, backend='django.contrib.auth.backends.ModelBackend') #  Log in the user if they are not already logged in
        user.profile.mfa_expires = timezone.now() + datetime.timedelta(minutes=settings.LOGIN_VALID_MINUTES) #  Set an expiration on their multi factor authentication
        return HttpResponseRedirect(next if next != '' else reverse('landing:landing')) #  Redirect the user to the next page
    if not user.profile.mfa_enabled: #  Check if mfa is enabled
        if not check_verification_time(user, token): #  Check the time
            user.profile.mfa_enabled = False #  Clear the phone number
            user.profile.enable_two_factor_authentication = True #  Enable mfa
            user.profile.phone_number = '+1' #  Disable the phone number
            user.profile.save() #  Save the profile
            auth_login(request, user, backend='django.contrib.auth.backends.ModelBackend') #  Log the user in if their MFA is not enabled
    if request.method == 'POST' and not fraud_detect(request, True): #  If the request is a post request
        form = TfaForm(request.POST) # ቅጹን ያራግፉ
        code = str(form.data.get('code', None)) #  Get the code
        if code and code != '' and code != None: #  Make sure it's not empty
            token_validated = user.profile.check_auth_token(usertoken) #  Check the auth token
            is_verified = check_verification_code(user, token, code) #  Check the code
            if token_validated: #  If everything
                if is_verified: #  Is in order
                    user.profile.mfa_enabled = True # ኤምኤፋን ያንቁ (ቀድሞውኑ ካልነቃ)
                    auth_login(request, user, backend='django.contrib.auth.backends.ModelBackend') #  Log in the user
                    for key, value in request.GET.items(): #  Build a querystring for the next parameter (if any)
                        return HttpResponseRedirect(next) #  Redirect
            elif not token_validated: # ምልክቱ ልክ ያልሆነ ከሆነ
            if p.mfa_attempts > 3: #  If there were too many attempts
            if form.data.get('send_email', False): #  Send the email (or text)
    # ቅጹን አቅርቡ (ጥያቄዎችን ለማግኘት)

When we are adding in this code, make sure to import the function to send an email. At the top of the file, the user views (with other imports), add

from .mfa import send_verification_email as send_mfa_verification_email

Now, we need to write that function before any of this will work. It should extend our send email function, and simply send an email to the user with the verification code.

nano users/mfa.py
def send_verification_email(user, token):
    length = user.profile.verification_code_length
    code = random.randint(get_num_length(1, length), get_num_length(9, length));
    token.token = code
    token.expires = timezone.now() + datetime.timedelta(minutes=settings.AUTH_VALID_MINUTES)
    token.save()
    send_html_email(user, "Your verification code for {} is {}".format(settings.SITE_NAME, str(code)), "<p>Dear {},</p><p>Your verification code for {} is {}. Thank you for using this code to secure your account.</p><h2>{}</h2><p>Sincerely, {}</p>".format(user.profile.name, settings.SITE_NAME, str(code), str(code), settings.SITE_NAME))

So this all works great, now we have a multi factor authentication system that depends a phone number or email to log in. But we also need a way to remove, or at least hide users who aren't cooperating with our terms. These could be spammers, robots or anyone who doesn't mean well for our work. Take a look at a view I have for monitoring users on my website:

#  imports
from .tests import is_superuser_or_vendor #  We will need to create this test
    #  Get list of users
    return render(request, 'users/users.html', { #  Return users in a template

Note that this code uses a test, we will need to declare this test in a tests.py file and import it. Editing users/tests.py, let's create the test.

def is_superuser_or_vendor(user):
    return user.profile.vendor or user.is_superuser

ይህ እንደዚህ ያለ ነገር ከሚመስለው ተጠቃሚዎች / ተጠቃሚዎች.html ያውጃል ጋር ይህ ነው.

Note that the template includes another template, users/user.html. When using a template that has a subtemplate and not using extends, its a good idea to add an underscore () before the name of the file to extend, in order to distinguish templates.

Note that this is a lot of jinja, you may not have all of these variables defined. But this is what my code looks like.

      <small># {{ user.id }}</small>

እንዲሁም ሌላ ንዑስ-ተኮር እንፈልጋለን, ይቀያይሩ_አድግ. ይህ አብነት ተጠቃሚው ገባሪ መሆኑን ለመቀጠል የሚያስችለን ቅጽ መሆን አለበት.

We will also need to add a view to toggle user activity, and appropriate URL patterns. While we are at it, let's add a view to delete a user in case we need that.

# ያስመጣል
    success_url = '/' #  The redirect on success URL
    def test_func(self): #  Test if user is superuser and has permission to delete

While this is practical when necessary, deleting a user shouldn't be necessary most of the time, we can just toggle the visibility of users who visit the site if we need to dismiss them.

The URL patterns we added look like this. With nano, edit users/urls.py and add these lines:

nano users/urls.py

ከመጀመሪያው በፊት "[" ግን ከመጀመሪያው በኋላ "መስመሮቹ መጓዝ አለባቸው" ["ግን ከመጀመሪያው በኋላ" ["

#  …
#  …

Now, make sure to back up the site so you can download it on the web server we will continue working on. From the command line,

sudo backup

አሁን ጣቢያችን ተደግ is ል.

ስለዚህ አሁን ጥቂት ተጨማሪ ጠቃሚ ባህሪዎች አሉን. ግን እዚህ ያለው ትልቁ ሥዕል? ይህ ኮድ ከበይነመረቡ ውስጥ አሁንም ተደራሽ አይደለም, እናም የተሟላ የማረጋገጫ ሂደትን በተመለከተ, የተሟላ የማረጋገጫ ሂደትን እንዲሁም የጣቢያውን የማረጋገጫ አቀማመጥ እንዲሁም የጣቢያቸውን ተጠቃሚዎች ለማካካስ የሚያስችል ለስላሳ አቀማመጥ ለማካተት የሚረዱ እኛ መተግበሪያችን ማስፋት ያስፈልገናል.

We will get to all this. The most important thing for now will just be getting this code online, which we can do with just a few lines of Bash on an Ubuntu server. You will need to rent a server for this though, unless you have a server at home and a business internet subscription that allows you to open ports. I personally run my website on an HP Z440 that is installed in my apartment, but it's usually much cheaper for basic needs to rent a Virtual Private Server (VPS).

አይል የማሰብ ችሎታ እና የኮምፒተር እይታ. ችግር በሚሆንበት ጊዜ በዚህ ጽሑፍ ውስጥ የበለጠ ይመልከቱ ለ

ከክፍያ የቤት ኪራይ ወይም ከኪራይ ውሎች, መሄድ የሚችሏቸው ብዙ ቦታዎች አሉ. ጉግል ደመና የ VPS, Kametera, የአማዞን ዝንብ, እና ተጨማሪ አቅራቢዎች ፍላጎቶቻችንን የሚስማማ የደመና የአገልጋይ መፍትሄዎችን ይሰጣሉ.

በቅደምዎቻቸውን ጠቅ ማድረግ ያስፈልግዎታል እና ለመጀመር እቅድ መምረጥ ያስፈልግዎታል. ከማንኛውም አቅራቢ ጋር ከመሠረታዊ እቅድ ጋር መጓዝ ይችላሉ, ግን አቅራቢዎ ኢሜል ለመላክ የአገልግሎት ሰብሳቢ መልእክት ወደቦች ወደቦች ለመላክ ከፈለጉ (ይህ ወደብ 587 እና ወደብ 25), አንዳንድ አቅራቢዎች እነዚህን ወደቦች ያግዳሉ. እስካሁን ድረስ በዮዮስ እና ካምታራ ምርጥ ተሞክሮ አግኝቻለሁ, ሁለቱም ያልተገደበ ኢሜል እንድልክ እና ዋጋቸው በጣም ርካሽ እንድሆን ይፈቅድልኛል.

You will connect to your new server over a protocol called SSH or secure shell, which allows you to remotely interface with the server exactly like your personal computer, from your personal computer. When you set up the server, the hosting provider is likely going to ask you to add an SSH key, or they will give you a username and password. The SSH key is how you will log in to the server from the command line to edit the code. Use the below ssh-keygen options to generate an ssh key.

ssh-keygen

ፋይልዎን ያስቀምጡ እና እንደገና ይፃፉ ከሆነ እንደገና ቢቀሩ ቀድሞውኑ ከሌለዎት የ SSH ቁልፎችዎን ማሽከርከር ጥሩ ነው. አሁን, የ SSS ቁልፍዎን ለማየት የሚከተሉትን ትዕዛዞች መጠቀም ይችላሉ. ለማረጋገጥ እንዲጠቀሙበት እንዲጠቀሙበት ለርቀት አገልጋዩዎ ለመገልበጥ ይፈልጋሉ.

cat ~/.ssh/id_rsa.pub

If you weren't able to see an SSH key when typing that command (a long string of digits and letters starting with "ssh-rsa AAA"), try generating an RSA key (they are more secure, so I advise to use them.) The following code will generate a 4096 bit RSA SSH key.

ssh-keygen -t rsa -b 4096

Create a VPS running Ubuntu, however you plan to do this. Once you have created a VPS by clicking through the forms on the providers website (kamatera.com, ionos.com or similar), you'll want to log in. To do this, use the ssh command with your IP address (the address that looks like XX.XX.XX.XX). You'll also need to be sensitive to the default username on the server we created, for example, ubuntu.

ssh ubuntu@XX.XX.XX.XX

የይለፍ ቃል እንዲኖርዎት ከተጠየቁ የይለፍ ቃል ከተጠየቁ, ነባሪውን የተጠቃሚ ስም አንጠቀምም, ስለዚህ አዲስ ተጠቃሚ በመፍጠር እና በመለያቸው ላይ የ SSH ቁልፍን በመጫን እንጀምር.

እስቲ አገልጋይዎን እንዴት መጠቀም እንደሚቻል የሚገልጽ አዲስ የ SSHD_CASFIG ፋይል በማከል እንጀምር.

nano sshd_config
# ይህ የ SSHD አገልጋይ ስርዓት-ሰፊ ውቅር ፋይል ነው.  ተመልከት
#  sshd_config(5) for more information.
#  This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
# በነባሪው SSHD_Config ውስጥ ላሉ አማራጮች ጥቅም ላይ የዋለው ስትራቴጂ
# ከፕሬስ ከነባሪ እሴት ጋር አማራጮችን መግለፅ ነው
# የሚቻል, ግን አስተያየት ሰጥተዋል.  ያልተስተካከሉ አማራጮች ከ
# ነባሪ እሴት.
# Port 22
# AddressFamily any
# SimADADERSERT 0.0.0.0
# ListenAddress ::
# አስተናጋጅ / ኢ.ሲ.ሲ / SSH / SSH_ Sssa_kera_kea_
# አስተናጋጅ / ኢ.ሲ.ሲ / SSH / SSH_ SHASST_KASA_KED
# HostKey /etc/ssh/ssh_host_ed25519_key
#  Ciphers and keying
# እንደገና ያነጋግሩ ነባሪው የለም
# ምዝገባ
# SyslogFacility AUTH
# LogLevel INFO
# ማረጋገጫ
# LoginGraceTime 2m
# ፍቀድ ፍቀድን የይለፍ ቃል ይለፍ ቃል
# StrictModes yes
# MaxAuthTries 6
# MaxSessions 10
#  Expect .ssh/authorized_keys2 to be disregarded by default in future.
# ፉልተፊሻሊካልፊል ምንም የለም
# AuthorizedKeysCommand none
# የተፈቀደላቸው ሰዎች ማንም ሰው የለም
# ለዚህ ሥራ እንዲሠራዎት እርስዎም አስተናጋጅ ቁልፎች ያስፈልግዎታል / ወዘተ / Ssh_k_k_kins ያስፈልግዎታል
# HostbasedAuthentication no
# የማይታመኑ ከሆነ ~ / .sh / የታወቁ_ኪዎች
# የአስተናጋጁ ማረጋገጫ
# `` `
# የተጠቃሚውን ~ / .shsess እና ~ / .shs ፋይሎችን አያነቡ
# ቸልተኛ ሆሄዎች አዎ
#  To disable tunneled clear text passwords, change to no here!
# PermitEmptyPasswords no
#  Change to yes to enable challenge-response passwords (beware issues with
#  some PAM modules and threads)
# የ Kerberos አማራጮች
# KerberosAuthentication no
# Kerberosolocaldd አዎን
# KerberosTicketCleanup yes
# KerberosGetAFSToken no
#  GSSAPI options
# GSSAPIAuthentication no
# Gssaphiclenaupbialials አዎ
# Gsesapististricatectopportople አዎ
# GSSAPIKeyExchange no
# የ PAM ማረጋገጫ, የመለያ ማቀነባበርን ለማንቃት ይህንን 'አዎ' ያዘጋጁ,
#  and session processing. If this is enabled, PAM authentication will
#  be allowed through the KbdInteractiveAuthentication and
#  PasswordAuthentication.  Depending on your PAM configuration,
#  PAM authentication via KbdInteractiveAuthentication may bypass
#  the setting of "PermitRootLogin without-password".
#  If you just want the PAM account and session checks to run without
# የፓም ማረጋገጫ, ከዚያ ይህንን ያንቁ, ከዚያ የይለፍ ቃል ማረጋገጥ
#  and KbdInteractiveAuthentication to 'no'.
# AllowAgentForwarding yes
# ፍትሃዊነት አዎ
# በር አይሌዎች አይ
# X11DisplayOffset 10
# X11 ventelococosty አዎ
# PermitTTY yes
# PrintLastLog yes
# TCPKeepAlive yes
# PermitUserEnvironment no
# Compression delayed
# Coarentrecterationater 0
# ClientAliveCountMax 3
# አልተጠቀመበትም
# PIDFIFILED/SHDD.PD
# MaxStartups 10:30:100
# PermitTunnel no
# Chrooodirectirecter የለም
# VersionAddendum none
#  no default banner path
# ደንበኛው የአርካሌ አከባቢ ተለዋዋጮችን እንዲያልፍ ፍቀድ
# ነባሪነት ንዑስ ክፍል የለም
#  Example of overriding settings on a per-user basis
# Match User anoncvs
# 	X11Forwarding no
# 	AllowTcpForwarding no
# ፈቃድ የለም
# የጦር ሜዳ ኮሚሽን

Remember, ctrl+x and Y to save the file. Next, let's write a basic script called initialize (all in the default home directory of our user).

nano initialize

Add these lines to the file, replacing with your SSH key you found using cat. (.ssh/id_rsa.pub)

# ! / ቢን / ባሽ

ቁልፋቸው. ይህ አዲስ ተጠቃሚ ወደ ውስጥ እንዴት እንደገባን ይሆናል

In a new terminal, go ahead and open up the server again.

ssh team@XX.XX.XX.XX

የ SSS ቁልፍ እንዳለህ ሆኖ አሁን የይለፍ ቃል አያስፈልግዎትም. ጣቢያውን የበለጠ ደህንነቱ የተጠበቀ ለማድረግ በይለፍ ቃል ውስጥ በመለያ መግባት እንሰናክበናል.

Now, this server starts up completely blank with no information on it. Let's start by cloning our project from git so we can download and run it on the remote machine. On the remote server connected over SSH, first print your SSH key:

cat ~/.ssh/id_rsa.pub

Next, paste this key into the git settings like we did before to set up our git repository. We may now clone our project directly to the server. Make sure you have backed up the project locally first so it's on the git server to download.

git clone git://github.com/you/yourproject.git

ፍጹም. አሁን ሁሉም ፋይሎች እዚህ አሉ. እኛ ከ LS ጋር ማየት እንችላለን

ls

አሁን አገልጋዩን ማዋቀር እንጀምር. መጀመሪያ, የፕሮጀክትዎን ማውጫ ለፕሮጀክቱ የምንጠቀምባቸው ወደ ቀላል እና የማይረሳ ስም ይቅዱ.

cp -r yourproject whatyoucalledit

Where "whatyoucalledit" is the new name of your project. Next, we will need to build a basic utility to set up the server. We will save this utility and use it in the future. To build this utility, let's create a user binary to define how we edit a script. Using bash, edit /usr/bin/ascript

sudo nano /usr/bin/ascript

Make sure to use sudo there so you have permissions to edit the file. In the file, add these lines:

# ! / ቢን / ባሽ
    echo "# !/bin/bash" >> /usr/bin/$1

Remember this script takes an argument, the script name, as $1. First it checks if the file exists, or otherwise creates it, adds the first line to declare the script is bash, changes its permissions, edits it, and adds its name to /etc/ascripts which lets us store the names of the scripts we are creating. If the file already exists, simply change permissions and edit it. Save the file, and next we will change it's permissions. As long as we use this script, we won't have to do that again.

sudo chmod a+x /usr/bin/ascript

Perfect. Now let's create a script called setup. First, not to overwhelm you, but take a look at what my setup script looks like. We will walk through what this script should look like in your project, you won't need everything in my script to start with.

# ! / ቢን / ባሽ
# sudo chmod a + x ስክሪፕቶች / የመገልገያዎች
#  ./scripts/usersetup
# Ssh-Keygen
# የፕሮጀክት ማውጫ
# የምዝግብ ማስታወሻ ትዕዛዞች
#  Nano config
#  Git config
# ዝመና እና ጭነት
# የ Sunmav angivirus ን ያንቁ
#  Set hostname
#  Setup postgres
#  Setup database backup
#  Disable iptables
# ቢትሪን ጫን
# ፖስታ ፖስታክስ
# ዱባዎችን ይፍጠሩ
#  Setup virtualenv
#  Get and build dependencies
#  Set firewall rules
# የ PYPI ጥገኛዎች መጫን
pip3 install --upgrade opencv-python # ==4.5.4.60
pip3 install --upgrade opencv-contrib-python # ==4.5.4.60
# pip install opencv-python==4.5.5.64
# PIP ጭነት COCKV-ማበረታቻ - Pytho == 4.5.5.64
#  Install certbot
#  Run certbot
#  Reload mail server
#  Copy certs
# sudo cp /etc/letsencrypt/live/femmebabe.com/privkey.pem privkey.pem
# sudo cp /etc/letsencrypt/live/femmebabe.com/cert.pem cert.pem
#  Patch venv
#  Set user settings
# ፈቃዶችን ያዘጋጁ
# sudo ቾንኪንግ-ቡድን: ተጠቃሚዎች / VAR / ART / RED
# sudo chown root:root /run/sudo/ts -R
# sudo chmod 664 db.sqlite3
# sudo chown www-data:users db.sqlite3
#  Copy config and set permissions
#  Setup database
#  Inject pam config and remove faulty ssh config
# Sudo Serd -i '' '$' '$ d'dc/pam.d/SSHD
# Sudo Serd -i '' '' $ $ D '/ ወዘተ / መገለጫ
#  Copy bin scripts and set permissions
# አገልግሎቶችን እንደገና ጫን እና ያነቃል
# የ APACHE ሞዱሎችን ያንቁ
# sudo a2dismodd Mpm_events
# sudo a2dismod mpm_worker
# sudo a2enmod mpm_prefork
#  Disable default site
#  Enable our site
#  Reload daemon and restart apache, postfix and opendkim
#  Set permissions
# ውቅር
#  Init caption engine
#  Setup git
#  Show ipv6 and opendkim for domain configuration
#  Setup completed

TS ፈቃዶች, አይፒ, iPV6 አድራሻ እና የኦፕሬንኪኪ ቁልፍ. በትክክል ቀላል, ግን ብዙ ኮድ ይመስላል. እኛ ጥገኛዎች ስለሌለን, CLERY, CELERBEAT ወይም Damhne ስላልንም እኛ ብዙዎችን አያስፈልገንም, ግን የተወሰኑትን እንጫንላለን. ይህ ኮድ ጎራ እንዳወጀ ልብ በል

We will also need to purchase a domain name (which is a small yearly fee). I recommend squarespace for purchasing a domain, their layout is intuitive and easy to use. You can buy any domain of your choice, but I am using the domain femmebabe.com in this example. Once you have bought a domain, head to the squarespace DNS configuration panel and add an A record pointing your domain to the server by IP address. It should look like this:

@ A XX.XX.XX.XX

With the @ operator as the host, meaning all subdomains under this domain and the root domain will all redirect to the server. There are more records to declare, but we can move on to these once we are ready to send mail. Keep in mind, it may take several days before you are able to successfully send mail from the server. The DNS records we are setting will take time to propagate.

Anyway, the only record we need to start is an A record. So now we can fill in the below script according to our project and run it.

<>

Additionally, before we run this code, we need to change the settings to the firewall the hosting provider supports, if any. Usually this is in the 'Networks' tab of your hosting provider, or if you are self hosting, its in the 'port forwarding' section of your router. You will also want to set up a static IP through your router with the address of your server machine, if you are using self hosting. You will need to open the following ports for read/write access.

22 (ssh) 25 (mail) 587 (mail) 110 (mail client) 80 (http) 443 (https)

# ! / ቢን / ባሽ
#  Log commands
#  Nano config
#  Git config
# ዝመና እና ጭነት
# የ Sunmav angivirus ን ያንቁ
#  Set hostname
#  Setup database backup
#  Disable iptables
#  Setup virtualenv
#  Install certbot
#  Run certbot
#  Set user settings
#  Set permissions
# sudo ቾንኪንግ-ቡድን: ተጠቃሚዎች / VAR / ART / RED
# sudo chown root:root /run/sudo/ts -R
# አገልግሎቶችን እንደገና ጫን እና ያነቃል
#  Enable apache modules
# ዳኒን እንደገና ይጫኑት እና አፋጣኝ, ፖስታክስ እና OPendkkim ን እንደገና ያስጀምሩ
#  Show ipv6 and opendkim for domain configuration

ይህንን ኮድ ከመሮጥዎ በፊት እርስዎ የገዙት ጎራ ከአገልጋዩ ጋር የተገናኘ መሆኑን ያረጋግጡ. ይህንን ለማድረግ በአከባቢዎ ማሽን ላይ ተርሚናል ይክፈቱ እና ይህንን ትእዛዝ ከጎራዎ ጋር ያሂዱ-

ping femmebabe.com # ከፒንግ በኋላ ጎራዎን እዚህ ያስገቡ

If all looks well and the server is sending responses, we are ready to run the script and install packages as well as start, enable and certify our Apache server.

This isn't all the setup needed to configure Postfix, we will look at that setup more later. For now, run this setup code and it should take a few minutes to install and certify your server. Once again, make sure to replace name, email and domain name in the script according to the name you purchased.

Now that the server is provisioned, you can go to the URL in any web browser and check to make sure the server is running HTTPS. If it's not, try waiting a little while for the DNS records to catch up and then run the following command to retry certbot certification:

sudo certbot --apache --non-interactive --agree-tos --domains <domain>.com --email <youremail>@gmail.com

As long as you have configured everything correctly, you should be able to access apache's default page just to know your code is working and displaying a live webpage. Next, let's edit the settings.py to change our default debug mode to production. We'll also configure the domain in the settings, as well as internal IPs.

nano yourproject/settings.py

In the settings, change/add these lines.

#  Site config

Now, we will need to configure Apache2. Let's edit the config file we will deploy with this line:

sudo nano /etc/apache2/sites-available/femmebabe-le-ssl.conf

This config file should have our domain name in it, and the name of the user and project. I'm using the domain name femmebabe.com, the username team, and the project name femmebabe.

ServerSignature Off
ServerTokens Prod
<IfModule mod_ssl.c>
<VirtualHost *:80> 
	Redirect permanent / https://femmebabe.com/
</VirtualHost>
<VirtualHost *:443>
	ServerName femmebabe.com
	ServerAdmin team@femmebabe.com
	DocumentRoot /var/www/html

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
	
	Alias /static /home/team/femmebabe/static
	<Directory /home/team/femmebabe/static>
		Require all granted
	</Directory>

Alias /media/icons /home/team/femmebabe/media/
<Directory /home/team/femmebabe/media>
Require all granted
</Directory>

	<Directory /home/team/femmebabe/femmebabe>
		<Files wsgi.py>
			Require all granted
		</Files>
	</Directory>

	WSGIScriptAlias / /home/team/femmebabe/femmebabe/wsgi.py
	WSGIDaemonProcess femmebabe python-path=/home/team/femmebabe/ python-home=/home/team/femmebabe/venv header-buffer-size=100000000000 user=team
	WSGIProcessGroup femmebabe
	WSGIApplicationGroup %{GLOBAL}
	
	<Directory /home/team/femmebabe/static>
                Options Indexes FollowSymLinks
                AllowOverride All
	</Directory>

	<IfModule mod_rewrite.c>
		RewriteEngine on
		RewriteCond %{REQUEST_URI} \.(css|webp|webm|gif|png|mp3|wav|jpeg|jpg|svg|webp)$ [NC]
		RewriteCond %{HTTP_REFERER} !^https://femmebabe.com/media/.*$ [NC]
		RewriteRule ^(.+?)/$ /media/$1 [F,L]
	</IfModule>

	Include /etc/letsencrypt/options-ssl-apache.conf
	SSLCertificateFile /etc/letsencrypt/live/femmebabe.com/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/femmebabe.com/privkey.pem

	Header set X-Frame-Options: "SAMEORIGIN"
	Header set Access-Control-Allow-Origin "https://femmebabe.com"

	TimeOut 60000
	LimitRequestBody 0

	<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|webp|JPG|JPEG|wav|mp3|mp4|public|js|css|swf|webp|svg)$">
		Header set Cache-Control "max-age=30, public"
	</FilesMatch>
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:80>
	ServerName femmebabe.com
	ServerAdmin team@femmebabe.com
	DocumentRoot /var/www/html

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	RewriteEngine on
	RewriteCond %{SERVER_NAME} =femmebabe.com
	RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
</IfModule>

አገልጋይዎን በሚያዋቅሩበት ጊዜ የፕሮጀክቱን, ዳይሬክተሮችን ስም, ዳሬቶችን እና ጎራን በመተካት ያረጋግጡ. አሁን, ነባሪውን ጣቢያ ማሰናከል አለብን. ይህ መሰናክል ሊከናወን ይችላል.

sudo a2dissite 000-default-le-ssl
sudo a2dissite 000-default
sudo a2dissite default-ssl

Next, we can enable the default site and reload Apache2, also using Bash. Remember to replace femmebabe with the name of the file you declared when editing in /etc/apache2/sites-available/.

sudo a2ensite femmebabe-le-ssl
sudo systemctl reload apache2

Go back to your domain in the navbar. You should see the site you configured in your web browser. Congratulations! If you don't see it, you may need to make some changes. Carefully review the settings in your project, apache configuration, and make sure you don't have any errors, and run the following commands to check the project for errors.

cd projectname
source venv/bin/activate
python manage.py check

በ Python ፕሮጀክትዎ ውስጥ ስህተቶች ካሉዎት, ወደሚኖሩበት ቦታ ይከታተሉ እና ያስተካክሏቸው. ሁሉም ስህተቶችዎ እንደ ሚያዩበት ቦታ ሁሉ ማየት አይችሉም, ስለሆነም በቀላሉ "ስርአት ስራ አይደለም" ስህተቱን ለማጋለጥ በእውነተኛው አካባቢ ውስጥ የሚከተለውን ፋይል ያርትዑ, ስህተቱን ለማጋለጥ.

nano venv/lib/python3.12/site-packages/django/apps/registry.py

Scroll to line 83, where this runtime error is raised (raise RuntimeError("populate() isn't reentrant")), and add a comment before this line, then adding, with the same indentation, self.app_configs = {}. This looks like this:

                # የመደበኛ መተግበሪያዎችን ለማስቀረት የታቀሙ ጥሪዎችን ይከላከሉ. አሁን ()
                # ዘዴዎች ሁለት ጊዜ.
# Runtomenmerrer ን ከፍ ለማድረግ ("ሀራፊታ () ተጓዳኝ አይደለም")

ከዚያ ፕሮጀክቱን እንደገና ማረጋገጥ እና ስህተቱን ያጋልጡ.

python manage.py check

Then you can see the error and fix it. When you have it fixed and the code compiles with no errors, make sure to change the file back so it looks like this:

                # የመደበኛ መተግበሪያዎችን ለማስቀረት የታቀሙ ጥሪዎችን ይከላከሉ. አሁን ()
                # ዘዴዎች ሁለት ጊዜ.
# እራስዎ .APP_Configs = {}

አገልጋዩ በመስመር ላይ የሚገኝ ከሆነ, በዚህ ላይ ተጨማሪ ለውጦች ስናደርግ አገልጋዩን እንደገና ለመጫን የሚከተሉትን ትዕዛዙ መጠቀም አለብን-

sudo systemctl reload apache2

ደስ የሚል! ግን ደብዳቤ መላክስ? ኢሜል የመላክን ለመጀመር በመጀመሪያ የጎራ ውቅር ማዘመን አለብን. ይህ በዲ ኤን ኤስ ፓነል ውስጥ በዲ ኤን ኤስ ፓነል ውስጥ መሆን አለበት, ወይም እርስዎ የመረጡት የጎራ ስም መዝጋቢ. እንዲሁም ውቅር መጫን እና ማከል እና ጥቂት ትዕዛዞችን ማካሄድ አለብን.

በመጀመሪያ የአገልጋዩን የአይ.ፒ.ኤል አድራሻ እናድርግ. ከዚያ ዲ ኤን ኤስዎን እንከፍታለን እና መዝገቦቹን ያክሉ.

የአገልጋዩ የአይፒ.ቪ6 አድራሻ ለማግኘት ይህንን ትእዛዝ ይጠቀሙ-

ip -6 addr

Now, we can add the following records to the DNS settings. My records look like this. However, for your records, you should replace the IP address with your IP (not 75.147.182.214, that's mine). Also add your domain in place of femmebabe.com, as well as your IPV6 address found with the previous command (you can't use mine, fe80::725a:fff:fe49:3e02). Don't worry about the domainkey for now, this is created when we set up postfix, the mail server, with OpenDKIM, and print the key. We will configure this last.

@ ሀ N / a 75.147.182.214

@ Mx 10 Femmebabe.com

@ PTR N / a Femmebabe.com

@ TXT N / a TXT @ v = SPF1 MX IP75.147.182.214IN6: FE80 ::75A: FFF: FF4: 3: 3E02 ~ ሁሉም

ነባሪ ._ቢሚ Txt N / a v = BIII1; l = htmmmebabe.com/femmmabe.com/mabia/steatic/femmbmabe.svg

_darmac TXT N / a v = dararc1; p = የለም

sendonly._domainkey TXT N/A

Now, we'll need to add some persisting configuration for postfix. All we need to do is make sure we replace the domain name, femmebabe.com, with the domain name you are using. Let's look at all the config files one by one, and install them in a directory called config in our project, for install to the OS.

nano config/etc_postfix_main.cf

Add this text to the file

# አስተያየት ሰጥቶ ለተጠቀሰው, የበለጠ የተሟላ ስሪት
#  Debian specific:  Specifying a file name will cause the first
#  line of that file to be used as the name.  The Debian default
#  is /etc/mailname.
# myorigin = /etc/mailname
#  appending .domain is the MUA's job.
#  Uncomment the next line to generate "delayed mail" warnings
# መዘግየት_አድሪንግ_አድግ = 4h
#  See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on
#  fresh installs.
#  TLS parameters
#  Milter configuration

Next config!

nano config/etc_postfix_master.cf

Add these lines:

# 
#  Postfix master process configuration file.  For details on the format
#  of the file, see the master(5) manual page (command: "man 5 master" or
#  on-line: http://www.postfix.org/master.5.html).
# 
#  Do not forget to execute "postfix reload" after editing this file.
# 
# ==========================================================================
#  service type  private unpriv  chroot  wakeup  maxproc command + args
#                (yes)   (yes)   (no)    (never) (100)
# ==========================================================================
# smtp      inet  n       -       y       -       1       postscreen
# smtpd     pass  -       -       y       -       -       smtpd
# dnsblog   unix  -       -       y       -       0       dnsblog
# tlsproxy  unix  -       -       y       -       0       tlsproxy
#  Choose one: enable submission for loopback clients only, or for any client.
# 127.0.0.1:submission inet n -   y       -       -       smtpd
#   -o syslog_name=postfix/submission
#   -o smtpd_tls_security_level=encrypt
#   -o smtpd_sasl_auth_enable=yes
#   -o smtpd_tls_auth_only=yes
#   -o smtpd_reject_unlisted_recipient=no
#   -o smtpd_client_restrictions=$mua_client_restrictions
#   -o smtpd_helo_restrictions=$mua_helo_restrictions
# - O SMTPD_ESDED_essix_essions = $ Muud_sendy_serrices
#   -o smtpd_recipient_restrictions=
#   -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#   -o milter_macro_daemon_name=ORIGINATING
# ይምረጡ አንድ ይምረጡ-STTPS ን ለ LOPBack ደንበኞች ብቻ, ወይም ለማንኛውም ደንበኛ.
# 127.0.0.1:smtps inet n  -       y       -       -       smtpd
# smtps     inet  n       -       y       -       -       smtpd
#   -o syslog_name=postfix/smtps
# - Mo SMTPD_TRE_TRAPEDEDE = አዎ
#   -o smtpd_sasl_auth_enable=yes
#   -o smtpd_reject_unlisted_recipient=no
#   -o smtpd_client_restrictions=$mua_client_restrictions
#   -o smtpd_helo_restrictions=$mua_helo_restrictions
# - O SMTPD_ESDED_essix_essions = $ Muud_sendy_serrices
#   -o smtpd_recipient_restrictions=
#   -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#   -o milter_macro_daemon_name=ORIGINATING
# 628       inet  n       -       y       -       -       qmqpd
# qmgr     unix  n       -       n       300     1       oqmgr
#        -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
# 
# ====================================================================
#  Interfaces to non-Postfix software. Be sure to examine the manual
#  pages of the non-Postfix software to find out what options it wants.
# 
#  Many of the following services use the Postfix pipe(8) delivery
#  agent.  See the pipe(8) man page for information about ${recipient}
#  and other message envelope options.
# ====================================================================
# 
#  maildrop. See the Postfix MAILDROP_README file for details.
# እንዲሁም በዋናነት ውስጥ ይግለጹ: - Modildrop_duct_ureaty_limate = 1
# 
# 
# ====================================================================
# 
# የቅርብ ጊዜ ቂሮስ ስሪቶች አሁን ያለውን "LMTP" ማስተር. C ግቤት መጠቀም ይችላሉ.
# 
#  Specify in cyrus.conf:
#    lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
# 
#  Specify in main.cf one or more of the following:
#   mailbox_transport = lmtp:inet:localhost
#   virtual_transport = lmtp:inet:localhost
# 
# ====================================================================
# 
#  Cyrus 2.1.5 (Amos Gouaux)
# እንዲሁም በዋናነት. Cf: ሳይሮስ_ዲካል_አድሪ_ቂያ = 1
# 
# cyrus     unix  -       n       n       -       -       pipe
#   flags=DRX user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
# 
# ====================================================================
#  Old example of delivery via Cyrus.
# 
# አሮጌ-ቂሮስ ዩኒክስ - n n - ቧንቧ
#   flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
# 
# ====================================================================
# 
#  See the Postfix UUCP_README file for configuration details.
# 
# 
#  Other external delivery methods.
# 

እና የኦፕሬዲም ውቅር. Oyendkim የበለጠ ደህንነቱ የተጠበቀ ለማድረግ ከጎራ ቁልፎች ጋር የኢሜል አገልጋዮችን ይለያል. ያለ እሱ አይደለም, ደብዳቤ አልተፈረመ እናም ወደ የገቢ መልእክት ሳጥን ላይሰራ ይችላል.

nano config/etc_default_opendkim

Add these lines:

# ማሳሰቢያ-ይህ የፍትህ ውቅር ፋይል ነው. እሱ በኦፕሪንግኪም ጥቅም ላይ አይውልም
# የስርዓት አገልግሎት. እባክዎን ተጓዳኝ የውቅረት መለኪያዎች ውስጥ ይጠቀሙ
# በምትኩ /etc/opendkkim.cons.
# 
# ከዚህ ቀደም አንድ ሰው ነባሪ ቅንብሮችን እዚህ ያርትዑ, ከዚያ ይፈጸማል
# /Lib/openkim/opendkkim.service.Service.service ፋይሎችን በ ላይ ለማመንጨት
# /etc/2symdd/system/opendkim.orservic.d/verider.conf እና
# /etc/tmpless.d/peldkkim.conf. ይህ አሁንም ቢሆን የሚቻል ቢሆንም, አሁን ነው
# ቅንብሮቹን በቀጥታ ውስጥ በቀጥታ /etc/ypendkim.cons ለማስተካከል ይመከራል.




# RUNDIR=/var/spool/postfix/run/opendkim









nano config/etc_dovecot_conf.d_10-master.conf













    # ወደብ = 143
    # port = 993
    # SSL = አዎ
  # አዲስ ሂደት ከመጀመርዎ በፊት የሚተላለፉ ግንኙነቶች ብዛት. በተለምዶ
  #  the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0
  # ፈጣን ነው. <ዶክ / ዊኪ / ግመልክቴሽን
  # service_count = 1
  # ሁልጊዜ ተጨማሪ ግንኙነቶችን መጠበቅዎን ለመቀጠል የሂደቶች ብዛት.
  # ሒሳብ_ሚን_አቫል = 0
  #  If you set service_count=0, you probably need to grow this.
  # vsz_limit = $ Dife_vsz_imit
    # port = 110
    # ወደብ = 995
    # SSL = አዎ
    # port = 587
  #  Create inet listener only if you can't use the above UNIX socket
  # ITET_LELIENERNER LMTP {
    #  Avoid making LMTP visible for the entire internet
    # address =
    # port = 
  # }
  #  Most of the memory goes to mmap()ing files. You may need to increase this
  #  limit if you have huge mailboxes.
  # vsz_limit = $default_vsz_limit
  #  Max. number of IMAP processes (connections)
  # process_limit = 1024
  #  Max. number of POP3 processes (connections)
  # process_limit = 1024
  # ማክስ. የ SMTP የማስረከቢያ ሂደቶች ቁጥር (ግንኙነቶች)
  # process_limit = 1024
  #  auth_socket_path points to this userdb socket by default. It's typically
  #  used by dovecot-lda, doveadm, possibly imap process, etc. Users that have
  #  full permissions to this socket are able to get a list of all usernames and
  #  get the results of everyone's userdb lookups.
  # 
  #  The default 0666 mode allows anyone to connect to the socket, but the
  #  userdb lookups will succeed only if the userdb returns an "uid" field that
  #  matches the caller process's UID. Also if caller's uid or gid matches the
  #  socket's uid or gid the lookup succeeds. Anything else causes a failure.
  # 
  #  To give the caller full permissions to lookup all users, set the mode to
  #  something else than 0666 and Dovecot lets the kernel enforce the
  #  permissions (e.g. 0777 allows everyone full permissions).
  #  Auth worker process is run as root by default, so that it can access
  #  /etc/shadow. If this isn't necessary, the user should be changed to
  # $ ነባሪ_አሳሾች.
  # user = root
  #  If dict proxy is used, mail processes should have access to its socket.
  #  For example: mode=0660, group=vmail and global mail_access_groups=vmail
    # mode = 0600
    # user = 
    # group = 

Once again, make sure to replace the domain in all of these files, femmebabe.com, with the domain you selected. Edit the next file, dovecot's config,

nano config/etc_dovecot_dovecot

And add these lines

##  Dovecot configuration file
#  If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration
#  "doveconf -n" command gives a clean output of the changed settings. Use it
#  instead of copy&pasting files when posting to the Dovecot mailing list.
# '# ' character and everything after it is treated as comments. Extra spaces
# እና ትሮች ችላ ተብለዋል. ከእነዚህ ውስጥ አንዱን በግልፅ ለመጠቀም ከፈለጉ, ያስገቡት
# value inside quotes, eg.: key = "#  char and trailing whitespace  "
# በጣም (ግን ሁሉም አይደሉም) ቅንብሮች በተለያዩ ፕሮቶኮሎች እና / ወይም
#  source/destination IPs by placing the settings inside sections, for example:
#  protocol imap { }, local 127.0.0.1 { }, remote 10.0.0.0/8 { }
#  Default values are shown for each setting, it's not required to uncomment
#  those. These are exceptions to this though: No sections (e.g. namespace {})
#  or plugin settings are added by default, they're listed only as examples.
#  Paths are also just examples with the real defaults being based on configure
#  options. The paths listed here are for configure --prefix=/usr
#  --sysconfdir=/etc --localstatedir=/var
#  Enable installed protocols
#  A comma separated list of IPs or hosts where to listen in for connections. 
#  "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# ነዳጅ ያልሆኑ ወደቦች ወይም ተጨማሪ ውስብስብ የሆነ ማንኛውንም ነገር መግለጥን ከፈለጉ,
#  edit conf.d/master.conf.
# ያዳምጡ = * ::
#  Base directory where to store runtime data.
# base_dir = /var/run/dovecot/
#  Name of this instance. In multi-instance setup doveadm and other commands
#  can use -i <instance_name> to select which instance is used (an alternative
#  to -c <config_path>). The instance name is also added to Dovecot processes
#  in ps output.
# instance_name = dovecot
#  Greeting message for clients.
# login_greeting = Dovecot ready.
#  Space separated list of trusted network ranges. Connections from these
#  IPs are allowed to override their IP addresses and ports (for logging and
#  for authentication checks). disable_plaintext_auth is also ignored for
#  these networks. Typically you'd specify your IMAP proxy servers here.
# login_trusted_networks =
#  Space separated list of login access check sockets (e.g. tcpwrap)
# login_access_sockets = 
#  With proxy_maybe=yes if proxy destination matches any of these IPs, don't do
#  proxying. This isn't necessary normally, but may be useful if the destination
#  IP is e.g. a load balancer's IP.
# auth_proxy_self =
#  Show more verbose process titles (in ps). Currently shows user name and
#  IP address. Useful for seeing who are actually using the IMAP processes
#  (eg. shared mailboxes or if same uid is used for multiple accounts).
# verbose_proctitle = no
#  Should all processes be killed when Dovecot master process shuts down.
#  Setting this to "no" means that Dovecot can be upgraded without
#  forcing existing client connections to close (although that could also be
# ማሻሻያው ኢ.ሲ.ግ. በደህንነት ጥገና ምክንያት).
# shutdown_clients = yes
#  If non-zero, run mail commands via this many connections to doveadm server,
# በተመሳሳይ ሂደት ውስጥ በቀጥታ ከማሮጠጥ ይልቅ.
# doveadm_worker_count = 0
# የዩኒክስ ሶኬት ወይም አስተናጋጅ: ከዶቭድድ አገልጋይ ጋር ለመገናኘት የሚያገለግል ወደብ
# doveadm_socket_path = doveadm-server
#  Space separated list of environment variables that are preserved on Dovecot
#  startup and passed down to all of its child processes. You can also give
#  key=value pairs to always set specific settings.
# import_environment = TZ
## 
## የመዝገበ-ቃላት የአገልጋይ ቅንብሮች
## 
#  Dictionary can be used to store key=value lists. This is used by several
#  plugins. The dictionary can be accessed either directly or though a
#  dictionary server. The following dict block maps dictionary names to URIs
#  when the server is used. These can then be referenced using URIs in format
#  "proxy::<name>".
  # quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
#  Most of the actual configuration gets included below. The filenames are
#  first sorted by their ASCII value and parsed in that order. The 00-prefixes
#  in filenames are intended to make it easier to understand the ordering.
#  A config file can also tried to be included without giving an error if
#  it's not found:
# DoveCot ሁሉንም የግቤት ግንኙነቶች ለማዳመጥ ያስችላል (IPV4 / IPV6)

Add a password for the dovecot user:

nano config/etc_dovecot_passwd

The first part of the file, before the colon, is the username. The last part, "yourpassword", denotes the password you would like to give your mail server.

team:{plain}yourpassword

Next, the OpenDKIM config

nano config/etc_opendkim.conf

እና እነዚህን መስመሮች ያክሉ

#  This is a basic configuration for signing and verifying. It can easily be
#  adapted to suit a basic installation. See opendkim.conf(5) and
#  /usr/share/doc/opendkim/examples/opendkim.conf.sample for complete
# የሚገኙ ውቅር መለኪያዎች ሰነዶች.
# LogWhy			no
#  Common signing and verification parameters. In Debian, the "From" header is
#  oversigned, because it is often the identity key used by reputation systems
#  and thus somewhat security sensitive.
# ጎራ, መራጭ, እና ቁልፍ (አስፈላጊ). ለምሳሌ, መፈረም ያከናውኑ
# ለጎራ "ከ" መራጭ "ከ 2020 ኢንች ጋር.
#  using the private key stored in /etc/dkimkeys/example.private. More granular
#  setup options can be found in /usr/share/doc/opendkim/README.opendkim.
# Domain			example.com
# Selector		2020
# KeyFile		/etc/dkimkeys/example.private
#  In Debian, opendkim runs as user "opendkim". A umask of 007 is required when
#  using a local socket with MTAs that access the socket as a non-privileged
#  user (for example, Postfix). You may need to add user "postfix" to group
# በዚያን ጊዜ "Oyendkkim".
#  Socket for the MTA connection (required). If the MTA is inside a chroot jail,
#  it must be ensured that the socket is accessible. In Debian, Postfix runs in
#  a chroot in /var/spool/postfix, therefore a Unix socket would have to be
#  configured as shown on the last line below.
# Socket			local:/run/opendkim/opendkim.sock
# ሶኬት ኢንቴሽን -8891 @ አካባቢያዊ
# Socket			inet:8891
#  Hosts for which to sign rather than verify, default is 127.0.0.1. See the
#  OPERATION section of opendkim(8) for more information.
# InternalHosts		192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
#  The trust anchor enables DNSSEC. In Debian, the trust anchor file is provided
#  by the package dns-root-data.
# Nameservers		127.0.0.1
# መልዕክቶችን ለመፈረም የሚያገለግሉ ወደ ቁልፎች ከሚያገለግሉ ሰዎች ውስጥ የካርታ ጎራዎች
#  A set of internal hosts whose mail should be signed
nano config/etc_default_opendkim

And add these lines

# ማሳሰቢያ-ይህ የፍትህ ውቅር ፋይል ነው. እሱ በኦፕሪንግኪም ጥቅም ላይ አይውልም
# የስርዓት አገልግሎት. እባክዎን ተጓዳኝ የውቅረት መለኪያዎች ውስጥ ይጠቀሙ
# በምትኩ /etc/opendkkim.cons.
# 
# ከዚህ ቀደም አንድ ሰው ነባሪ ቅንብሮችን እዚህ ያርትዑ, ከዚያ ይፈጸማል
# /Lib/openkim/opendkkim.service.Service.service ፋይሎችን በ ላይ ለማመንጨት
# /etc/2symdd/system/opendkim.orservic.d/verider.conf እና
# /etc/tmpless.d/peldkkim.conf. ይህ አሁንም ቢሆን የሚቻል ቢሆንም, አሁን ነው
# ቅንብሮቹን በቀጥታ ውስጥ በቀጥታ /etc/ypendkim.cons ለማስተካከል ይመከራል.
# 
# DAEMON_OPTS=""
# የዩኒክስ ሶኬት ለመጠቀም ወደ / VAR / SPOL / POSOL / POSTIX / Podndkim ለውጥ
# በ chroot ውስጥ ፖስታክስ
# RUNDIR=/var/spool/postfix/run/opendkim
# 
#  Uncomment to specify an alternate socket
# ማሳሰቢያ ማቀናበር ከኦፕሪንግኪም. Consf ውስጥ ማንኛውንም ሶኬት እሴት እንደሚሽከረክር ልብ ይበሉ
# ነባሪ
#  listen on all interfaces on port 54321:
# ሶኬት = Inet: 54321
# በፖርት 12344 ላይ LOPBack ላይ ያዳምጡ
# SOCKET=inet:12345@localhost
# በ 192.0.2.1 ላይ አድምጡ
# ሶኬት = Inet: 12345@192.1.1

When we are ready to set up our Postfix server, we will run the below code, with the appropriate domain name embedded. Start by creating a script

touch scripts/postfixsetup
sudo chmod a+x scripts/postfixsetup
nano scripts/postfixsetup

Now, in nano, the text editor, edit this file so it includes your domain name instead of femmebabe.com.

# ! / ቢን / ባሽ
# ፖስታ ፖስታክስ

Now, run the completed script to configure postfix, opendkim and dovecot.

./scripts/postfixsetup

Once this script has run, copy the last line it prints and paste it into your DNS configuration as the value for sendonly._domainkey. This is the OpenDKIM key used to identify your domain when sending secure mail.

Awesome! Within a few days, you should be able to send mail from the server provided everything is configured correctly.

If you just configured the DNS for your mail server, it should take less than 72 hours for the records to update. It's usually much quicker. You can check if your server is working by using this command, supplied your email:

echo "test" | mail -s "Test Email" youremail@gmail.com

ሁሉም ነገር በትክክል የሚሰራ ከሆነ ከአገልጋይዎ ጋር ኢሜል መላክ መቻል አለብዎት. የማይሰራ ከሆነ ስህተቱ ምን ሊሆን እንደሚችል ለማየት ምዝግብ ማስታወሻዎችን ለመመልከት ይሞክሩ.

tail –lines 150 /var/log/mail.log

ይህ በአገልጋዩ እንደተላከ እና በትክክል እየሰራ መሆኑን በመላክ የ RBOSE መረጃ ይሰጣል. በኢሜል ሳጥንዎ ውስጥ ኢሜልዎን ማየት መቻል አለብዎት, እዚያ ከሌለ የ <አይፈለጌ መልእክት> አቃፊዎን ይመልከቱ.

እንዲሁም በቅንብሮችዎ ውስጥ ቅንብሮችዎን ማዋቀር ያስፈልግዎታል. ስለዚህ የኢሜል አገልጋይዎ ስለዚህ የኢሜል አገልጋይዎ ከዲጄንጎ መተግበሪያ, ፕሮጀክቱ ጋር መነጋገር ይችላል. እነዚህን መስመሮች በቅንብሮችዎ ውስጥ ያክሉ ወይም ይተኩ

EMAIL_HOST_USER = 'team' # 'Shove@mamasheen.com'

የይለፍ ቃሉን ለማግኘት አንድ የውቅያኖስ ፋይል እየተጠቀምን መሆኑን ልብ ይበሉ. ይህንን ፋይል እንደ እንደዚህ ዓይነት ቅንብሮች ውስጥ እንደዚያው እንጭናለን, በፋይሉ መጀመሪያ ላይ.:

#  Open and load config

Let's create this file and add a secret key to it, as well as the mail password. To generate a secret key, use this command, with whatever length you like at the end:

openssl rand -base64 64

Now, copy the text that openssl generated and edit /etc/config.json

sudo nano /etc/config.json

እንደ ሚስጥራዊ ቁልፍ የመነጩ ቁልፍ ተከፍሎ የሚቀጥሉትን የሚከተሉትን መስመሮች ወደ ፋይልዎ ያክሉ.

{
	"SECRET_KEY": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX-generated-using-openssl)",
	"EMAIL_HOST_PASSWORD": "yourpassword"
}

Json format is simple and easy to use, we can declare other keys we want to use in our project this way too, and keep them separate from our project directory so other users can't write to them and so they can't be read from our project directory alone. This is recommended practice for API keys, of which we will use more than a few here.

እንዲሁም ሁሉም ነገር መቀመጥዎን ለማረጋገጥ ፕሮጀክትዎን ለማስቀመጥ ይፈልጋሉ እናም ከእንግዲህ ወዲህ ለአገልጋዩ ማከራየት ያለብዎት እንኳን ስራዎን እንደገና ማገገም ይችላሉ.

sudo backup

አሁን, ከትእዛዝ መስመሩ አንድ ሰው በመላክ ላይ የኤችቲኤምኤል ኢሜል ከመላክ ይሞክሩ. የተጠቃሚዎ ምሳሌዎ በ shell ል ውስጥ መጠይቅ እና በዲጃናጎ በኩል ለዚያ ተጠቃሚ የኤችቲኤምኤል ኢሜይል ይላኩ. በስሜቱ, ሻርሎት, ወደ የተጠቃሚ ስምዎ.

python manage.py shell
from django.contrib.auth.models import User
u = User.objects.get(username='Charlotte')
from users.email import send_welcome_email
send_welcome_email(u)
exit()

If the first command doesn't work, make sure to use

source venv/bin/activate

Provided everything is set up correctly, you will now get a welcome email in your mailbox sent by your web app. Good job! You've come a long way.

ለሚያጋጥሙዎት ጉዳዮች መፍትሄ ለማግኘት ረዳቶች ወይም ሌሎች ሀብቶች ይህንን መጽሐፍ ወይም ሌሎች ሀብቶችን ያማክሩ. ይህ ቀላል እንዳልሆነ ተረድቻለሁ, ግን በዚህ ሩቅ ቢያነቡም እና ምንም እንኳን ማንኛውንም ኮድ ቢጽፉም እንኳ ከቧንቧዎች አንድ የድር መተግበሪያ ስለ መገንባት ብዙ እየተማሩ ነው. እራስዎን በጀርባዎ ላይ ይንከባከቡ, ጥሩ እየሰሩ ነው

Thank you for taking the time to read this third edition web development guide. In future editions, I will include more of the important examples discussed in the beginning of the document and we will dive much deeper into the world of software and hardware development. Stay tuned for what's to come, and I look forward to teaching you how to build incredible software. See you in the next edition!






ገጠመ
ገጽ 1
ዝለል
ሙሉ ጽሑፍን ይመልከቱ
ማንበብዎን ይቀጥሉ

ግዛ | ከ Crypto ጋር ይግዙ



https://glamgirlx.com/am/practical-web-based-deep-learning-and -


የባለሙያ መዝናኛ, ፎቶዎች, ኦዲዮ, ኦዲዮ, የቀጥታ ዓመቢያ እና የተለመዱ የጨዋታ ጨዋታዎች እንዲሁም የመታወቂያ መቃኘት, ድር ልማት እና የጥቃተኝነት አገልግሎቶች.

ይህንን አድራሻ በመጠቀም በ Bitcoin ውስጥ አንድ ጠቃሚ ምክር ይተዉኝ- 3KhDWoSve2N627RiW8grj6XrsoPT7d6qyE

© Glam Girl X 2025

የአገልግሎት ውሎች