သတင်း - site ကိုသွားရောက်ကြည့်ရှု
Practical Web Based Deep Learning and Security by Example Third Edition Charlotte Harper July 3, 2024 Updated/Converted June 3, 2025 Foreword: Security considerations in building software for the web are an important part of any web developer's plan and execution while engineering a prototype that is dependable, stable, and useful for practical purposes. The DOM (Document Object Markup), with it's implementation of HTML, JavaScript, and CSS as well as backend software implementing Python, C/C++, Java and bash, give web developers the freedom and power to create a wide variety of projects that express creativity, provide ease of use and functionality, portray humility and character, and provide ease of use as well as convenience and important services that are all attractive to the average Joe, the end user looking to kill time or get something done on the internet, usually on a touchscreen smartphone device. Most people wouldn't even know where to start when they want to build a website from scratch, they would tend to start on another person's website and build something limited in functionality, dependability, ease of use and especially creativity when they could have had all the latest powerful tools at their disposal in order to build something useful without wasting time pressing buttons, and especially wasting money paying for expensive subscriptions to software few people wanted to use anyway given it's limitations in ease of use and flexibility. If you have a few minutes to read through this book and learn what I want to teach you, or even speak with me personally about your goals and get some guidance in the right direction, and are motivated to learn to code and write your own software, take this book home and set aside some time to learn to build the next influential, powerful, streamlined and important web application, a website that is all on you and does exactly what you want and meets the needs of your audience. About me: I am a software developer with a wide range of experience in C/C++, Java, Python, HTML, CSS and JavaScript. I build websites people want to use, want to visit, and even get addicted to using just to learn, recreate and kill time, and most importantly, I sell software. If you had an idea as to exactly how you wanted a website to look and function, you were willing to support me so I can meet my own needs while I meet yours, and you are willing to cover the costs of running a website yourself, I would build you the next YouTube, TikTok, Twitter, Google, or even a high-tech security app only you can access. Instead of trying to sell you my time, I'm trying to buy yours: I want to talk you into building an app (website) yourself with the information that already exists, and teach you what you need to be an independent software developer, entrepreneur, leading a successful career in whatever field you desire. And let me be clear, the education I give you will be informal. You could go to school and learn all of this with a formal education, or even read this book in school, complete your assignments, and take away a great deal from your education, but I won't formally put you in the hot seat and ask you to complete assignments. I'm not your professor, you can think of me like a friend who wants to guide you toward a career driven by your own personal success. And I'm not selling you success either, you will need to buy it with your time. Learning to code has a steep learning curve and was never easy, or even supposed to be. You need to work as hard as you possibly can and continue to try and fail and try again even when you are frustrated in order to learn and build apps yourself. That's in the nature of code itself. Code is run by a compiler that is designed to give the programmer error messages, and these will teach you how to code, even if you are simply copying the error into your search engine and reading other people's examples. And I must say, you don't need to be extremely rich, smart, successful, or even detail oriented or organized to build an app. The computer takes care of that organization for you. You just need to persevere through the trial and error, maintain focus and work hard at what you do, and you will have a very successful career in the entirety of what you do. Who I am: I realize that the last section was more about learning and your take a ways from this book. Who am I exactly? That's a complicated question. I am unclear on that myself, as I suffer from medical conditions that can make it difficult for me to even code or write this book at times, while presenting challenges with socialization and identity issues that make my life more difficult when it comes to introducing myself. In short, if you are reading this book, you brought it home because you flipped through it and thought it was useful, or even if you just read this far in, to you I am a like minded individual who wants to see you succeed in everything that you do. I am an engineer myself, a software developer, and a student, and I am writing this book for other students who want to make their lives easier by having a handbook of the software they need making their lives easier by giving examples to copy that fit together like a big puzzle into a working, useful, large, functional, cohesive, and engaging app that can drive success no matter the line of business. Largely, this is what I do: I build apps to help myself and other people succeed. I am an author as well, though this is my first publication that I intend to complete in order to put my portfolio together into a useful document, and I am an artist as well. I'll admit this to you, I'm sort of a strange person. I'm not perfect, I've had run ins with the law even leading me to leave colleges and universities and leave states in order to try to make a name for myself with more success. I am a woman by birth, I wear makeup, take photos of myself, wear dresses and other womens clothing, and I stay conscious of myself as a female by nature. I've had issues with other people in the past that lead to struggles with writing and building webapps, and I apologize that I haven't been able to get this book in your hands sooner: You needed this. You will want to read and write code that looks like mine and works like mine and does the same thing but even better, because if you can afford to buy this book instead of mashing your keyboard like I do just to create a book yourself asking money for it, you have the resources you need to be successful in your life. I had all sorts of issues with family growing up, health conditions, doctors, the media, and the law, and my code deeply reflects the struggle that is feminism and female nature in a divided and frustrated world. However, this book is something I deeply care about, my baby, my portfolio, and my livelihood, so I appreciate your consideration when you take the text home and carefully pore over it in order to learn from me. Please keep in mind I am not perfect, this book will have errors, revisions, and new editions, and you will need to think with your logical brain as best you can in order to have a successful experience with my writing. Also, understand that I mean well for you even when you face challenges when writing. Think about it like this: When you can just rent a computer system to do anything you can possibly imagine in the digital space, store all the information you encounter, analyze and organize it, and come to understand it, you will inevitably encounter difficulties with the information you are ingesting and even publishing. I tell you this because I encounter the same difficulties. Use this book at your own risk, work with your community and communities available to you to build software within a safe setting, and don't take things to personally when you fail or even succeed in the wrong way: That's how I got this far, and why I can bring you this text and help you succeed without diverging off on a path of madness that leaves me ruined, torn and frayed while I encounter the ordinary problems everyone does on a global scale thanks to the paralellistic global scale of the network on which we will work, the internet. You might not be very familiar with who I am with just a few words, but I encourage you to read on, you will get to know me as you continue to read and understand me while building your own projects to complete your work. There will be no homework with this book, as long as your professors or teachers don't assign you any, but I highly encourage you to build a portfolio of projects yourself as you read along, as well as a capstone project showcasing how you can apply what you have learned. My capstone project is the basis for most of what you will read in this book, as it incorporates code from my previous projects, code I have created and learned to write methodically by hand, and a wide range of ideas and tips that have helped me succeed to the point where I can spin up a simple app that is fully featured and looks and behaves like a popular app you might see your friend or family using, on the internet, advertised to you, or in the news. What this book is: This book is a tutorial by example. You can find code here, instructions for how to learn to code, information on debugging code and fixing errors, troubleshooting steps, instructions on how to back up and save your code, re-deploy if anyone breaks your code, secure your code, deploy your code, build interactive websites that are entertaining, engaging, and addictive, and you will get a sense of who I am, why this is important, and how to portray yourself, your app and company image, as well as the software you build in the absolute best light to be the most attractive as possible to your end users, your website's visitors. In this book, I will demonstrate a number of examples of software design with a focus on the web as a platform as well as security. We will initiate the learning experience ...
ဥပမာအားဖြင့်လက်တွေ့ကျသော Based Based လေ့လာမှုနှင့်လုံခြုံရေး

ဥပမာအားဖြင့်လက်တွေ့ကျသော Based Based လေ့လာမှုနှင့်လုံခြုံရေး တတိယစာစောင် Charlotte Harper ဇူလိုင်လ 3, 2024 updated / ပြောင်းလဲဇွန် 3, 2025

-

0 က်ဘ်အတွက်ဆော့ဖ်ဝဲတည်ဆောက်ရန်လုံခြုံရေးထည့်သွင်းစဉ်းစားမှုများသည် 0 က်ဘ်တီထွင်သူ၏အစီအစဉ်၏အရေးကြီးသောအစိတ်အပိုင်းများနှင့်လက်တွေ့ကျသောရည်ရွယ်ချက်များအတွက်အသုံးဝင်သောရှေ့ပြေးပုံစံကိုအင်ဂျင်နီယာတစ်ခု၏အရေးကြီးသောအစိတ်အပိုင်းဖြစ်သည်။ dom (စာရွက်စာတမ်း Object Markup), ၎င်းသည် HTML, JavaScript နှင့် CSS ကိုအကောင်အထည်ဖော်ရန်အတွက် Python, C / C java နှင့် Bash တို့ကိုအကောင်အထည်ဖော်ရန်အတွက် 0 က်ဘ်တီထွင်သူများကိုဖန်တီးရန်, အသုံးပြုသူသည်အချိန်ကိုသတ်ရန်သို့မဟုတ်အင်တာနက်ပေါ်တွင်ပြုလုပ်သောအရာတစ်ခုခုကိုများသောအားဖြင့် touchscreen စမတ်ဖုန်းစက်ပေါ်တွင်ယူရန်ရှာဖွေနေသည်။ လူအများစုက 0 က်ဘ်ဆိုက်ကိုခြစ်ရာကနေဘမ်းတတ်ချင်တဲ့အချိန်မှာသူတို့ဟာအခြားသူရဲ့ဝက်ဘ်ဆိုက်ကိုဖွင့်ပေးနိုင်ပြီး, ဒီစာအုပ်ကိုဖတ်ပြီးမင်းကိုငါသွန်သင်ပေးချင်တဲ့အရာတွေကိုလေ့လာဖို့မိနစ်အနည်းငယ်လောက်ပဲလေ့လာပြီးသင့်ရဲ့ပန်းတိုင်တွေအကြောင်းကျွန်တော်တို့နဲ့စကားပြောပြီး code ကိုလေ့လာဖို့နဲ့သင့်ကိုယ်ပိုင်ဆော့ဖ်ဝဲကိုရေးဖို့လှုံ့ဆော်ပေးပြီးသင့်ရဲ့ပရိသတ်တွေရဲ့လိုအပ်ချက်ကိုဖြည့်ဆည်းပေးပြီးသင့်ရဲ့ပရိသတ်တွေရဲ့လိုအပ်ချက်တွေကိုဖြည့်ဆည်းပေးဖို့သင်ယူဖို့အချိန်ဖယ်ထားပြီးသင့်ရဲ့ပရိသတ်တွေရဲ့လိုအပ်ချက်ကိုဖြည့်ဆည်းပေးဖို့လေ့လာဖို့အချိန်ဖယ်ထားပြီးသင့်ပရိသတ်ကိုလုပ်ပြီးသင့်ပရိသတ်ကိုအတိအကျဖြည့်ဆည်းပေးဖို့သင်ယူဖို့အချိန်ဖယ်ထားပြီးသင့်ရဲ့ပရိသတ်တွေရဲ့လိုအပ်ချက်ကိုဖြည့်ဆည်းပေးဖို့သင်ယူဖို့အချိန်ဖယ်ထားပြီးသင့်ပရိသတ်ကိုလုပ်ပြီးသင့်ပရိသတ်ရဲ့လိုအပ်ချက်ကိုဖြည့်ဆည်းပေးဖို့လေ့လာဖို့အချိန်ဖယ်ထားပြီးသင့်ပရိသတ်ကိုလုပ်ပြီးသင့်ပရိသတ်ကိုအတိအကျလုပ်ပြီးသင့်ရဲ့ပရိသတ်တွေရဲ့လိုအပ်ချက်ကိုဖြည့်ဆည်းပေးဖို့လေ့လာဖို့အချိန်ဖယ်ထားပါ။

ကိုယ့်အကြောင်း: ကျွန်ုပ်သည် C / C ++, Java, Python, CSS နှင့် JavaScript တွင်အတွေ့အကြုံအမျိုးမျိုးရှိသောဆော့ဖ်ဝဲရေးဆွဲသူဖြစ်သည်။ ငါအသုံးပြုချင်တဲ့ဝက်ဘ်ဆိုက်များကိုတည်ဆောက်ချင်ကြတယ်, လာလည်ချင်ကြတယ်, လေ့လာချင်တယ်, ထပ်ခါတလဲလဲလေ့လာဖို့, If you had an idea as to exactly how you wanted a website to look and function, you were willing to support me so I can meet my own needs while I meet yours, and you are willing to cover the costs of running a website yourself, I would build you the next YouTube, TikTok, Twitter, Google, or even a high-tech security app only you can access. သင့်ရဲ့အချိန်ကိုရောင်းဖို့ကြိုးစားနေတာကမင်းကို 0 ယ်ဖို့ကြိုးစားနေတာပေါ့။ မင်းကိုသင်တည်ရှိထားပြီးသောသတင်းအချက်အလက်များနှင့်အတူ app (ဝက်ဘ်ဆိုက်) ကိုတည်ဆောက်ရန်ကြိုးစားနေသည်။ ပြီးတော့ရှင်းရှင်းလင်းလင်းပြောပြပါ, ငါပေးတဲ့ပညာရေးကိုအလွတ်သဘောဖြစ်လိမ့်မယ်။ သင်ကျောင်းသို့ သွား. ဤအရာအားလုံးကိုတရားဝင်ပညာရေးနှင့်အတူလေ့လာနိုင်သည်သို့မဟုတ်ဤစာအုပ်ကိုကျောင်း၌ပင်ဖတ်ရှုခြင်း, သင်၏တာ 0 န်များကိုဖြည့်စွက်။ သင့်အားစာတိုကိုမထားနှင့် ငါမင်းရဲ့ပါမောက္ခမဟုတ်ဘူး, မင်းရဲ့ကိုယ်ပိုင်အောင်မြင်မှုကြောင့်မောင်းနှင်ခဲ့တဲ့အလုပ်တစ်ခုဆီကိုလမ်းပြပေးချင်တဲ့သူငယ်ချင်းတစ်ယောက်လိုငါ့ကိုစဉ်းစားနိုင်တယ်။ ပြီးတော့မင်းကိုအောင်မြင်မှုမရဘူး, မင်းအချိန်နဲ့ဝယ်ဖို့လိုလိမ့်မယ်။ Code သို့လေ့လာခြင်းသည်မတ်စောက်သောသင်ယူမှုကွေးနှင့်ဘယ်တော့မှမလွယ်ကူပါ, သင်တတ်နိုင်သလောက်ကြိုးစားလုပ်ဆောင်ရန်လိုသည်မှာသင်ကိုယ်တိုင်အက်ပလီကေးရှင်းများကိုလေ့လာရန်နှင့်တည်ဆောက်ရန်စိတ်ရှုပ်ထွေးနေသည့်တိုင်, ဒါက code ကိုယ်နှိုက်၏သဘောသဘာဝ၌တည်ရှိ၏။ Code ကိုပရိုဂရမ်မာအမှားအယွင်းများပေးရန်ဒီဇိုင်းပြုလုပ်ထားသော compiler တစ်ခုဖွင့်လှစ်ထားသည်။ ၎င်းသည်သင်၏ရှာဖွေရေးအင်ဂျင်ထဲသို့အမှားကိုကူးယူခြင်းနှင့်အခြားသူများ၏ပုံနမူနာများကိုဖတ်ရှုခြင်းနှင့်အခြားသူများ၏ပုံနမူနာများကိုဖတ်ရှုခြင်းနှင့်အခြားသူများ၏ပုံနမူနာများကိုဖတ်ရှုခြင်းနှင့်အခြားသူများ၏ပုံနမူနာများကိုဖတ်ရှုခြင်းအားဖြင့်သငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျသညျသငျ၏။ ပြီးတော့ငါပြောရမယ်ဆိုရင် app တခုကိုတည်ဆောက်ဖို့သင်အရမ်းကြွယ်ဝတဲ့, စမတ်, အောင်မြင်မှု, ကွန်ပျူတာသည်သင့်အတွက်ထိုအဖွဲ့အစည်းကိုဂရုစိုက်သည်။ သင်သည်ရုံးတင်စစ်ဆေးခြင်းနှင့်အမှားမှတစ်ဆင့်ဆက်လက်လုပ်ဆောင်ရန်လိုသည်, အာရုံစိုက်ရန်လိုအပ်ပြီးသင်ပြုလုပ်သည့်အရာများတွင်ကြိုးစားလုပ်ဆောင်ရန်လိုအပ်သည်။

ကျွန်တော်ဘယ်သူလဲ: နောက်ဆုံးအပိုင်းသည်သင်ယူမှုနှင့် ပတ်သက်. ပိုမိုသိရှိပြီးသင်၏ဤစာအုပ်မှနည်းလမ်းများပြုလုပ်ရန်ကျွန်ုပ်သိသည်။ ငါဘယ်သူလဲ ဒါကရှုပ်ထွေးတဲ့မေးခွန်းပါ။ ကျွန်ုပ်အားဆေးဘက်ဆိုင်ရာအခြေအနေများမှခံစားနိုင်သည့်အတွက်ကျွန်ုပ်အတွက်ခက်ခဲသောဆေးဘက်ဆိုင်ရာအခြေအနေများမှခံစားနိုင်သည့်အတွက်ကျွန်ုပ်သည်မိမိကိုယ်ကိုမိတ်ဆက်ခြင်းနှင့် ပတ်သက်. စိန်ခေါ်မှုများကိုပိုမိုခက်ခဲစေသည့်အတွက်စိန်ခေါ်မှုများကိုပိုမိုခက်ခဲစေသည့်စိန်ခေါ်မှုများကိုတင်ပြစဉ်။ အတိုချုပ်ပြောရရင်ဒီစာအုပ်ကိုဖတ်နေရင်မင်းကအိမ်ကိုပြန်လှည့်ပြီးအသုံးဝင်တယ်လို့ထင်နေကြတယ်, ဒါမှမဟုတ်သင်ဟာအသုံးဝင်တဲ့အရာကမင်းကိုမင်းလုပ်တာကိုမြင်ချင်တဲ့သူတစ်ယောက်လိုမင်းနဲ့အတူရှိနေချင်တာလဲ။ ကျွန်ုပ်သည်အင်ဂျင်နီယာတစ် ဦး, ဆော့ဖ်ဝဲရေးဆွဲသူနှင့်ကျောင်းသားတစ် ဦး ဖြစ်သည်။ ကြီးမားသောပဟေ of ိအနေဖြင့်ကြီးမားသော, အသုံးဝင်သော, ကြီးမားသော, ကြီးမားသောအလုပ်လုပ်သည့်, အဓိကအားဖြင့်ဤအရာသည်ကျွန်ုပ်လုပ်သည် - ကျွန်ုပ်သည်ကျွန်ုပ်နှင့်အခြားလူများအောင်မြင်ရန်အက်ပလီကေးရှင်းများကိုတည်ဆောက်သည်။ ကျွန်ုပ်သည်စာရေးသူတစ် ဦး ပါ 0 င်သည်။ ငါဒီဟာကိုမင်းကိုဒီလောက်ဝန်ခံမယ်, ငါဟာမစုံလင်တော့ဘူး, ငါဟာကောလိပ်တွေ, တက္ကသိုလ်များကိုစွန့်ခွာဖို့တောင်မှထွက်ခွာရန်တောင်မှထွက်ခွာရန်တောင်မှထွက်ခွာရန်တောင်မှဥပဒေသည်ကျွန်ုပ်သည်မထီမဲ့မြင်ပြုခြင်းကိုပြုလုပ်ခဲ့သည်။ ကျွန်ုပ်သည်မွေးကင်းစကလေးငယ်တစ် ဦး ဖြစ်သည်။ ကျွန်ုပ်မိတ်ကပ်ကို 0 တ်ဆင်သည်, ကိုယ်အလေးချိန်နှင့်အခြားအမျိုးသမီးများအ 0 တ်အထည်များအပေါ်ကိုယ်ကိုသတိထားမိသည်။ ငါအရင်ကအခြားလူတွေနဲ့ပတ်သက်တဲ့ပြ issues နာတွေနဲ့ပတ်သက်တဲ့ပြ issues နာတွေရှိပြီး WebApps တွေကိုရေးဆွဲပြီး 0 င်ရောက်နေတဲ့အတွက်ရုန်းကန်နေရတယ်။ မင်းနဲ့တူတဲ့ code ကိုဖတ်ပြီးစာကိုရေးချင်ကြလိမ့်မယ်။ မင်းကဒီစာအုပ်ကိုမ 0 ယ်နိုင်လောက်အောင်လုပ်ပေးတာကမင်းအတွက်ပိုက်ဆံတောင်းဖို့လိုတယ်, ငါမိသားစုကြီးပြင်းလာတဲ့မိသားစုကြီးထွားလာခြင်း, ကျန်းမာရေးအခြေအနေ, ဆရာဝန်များ, မီဒီယာနှင့်ဥပဒေများနှင့်ဥပဒေများနှင့်အတူပြ issues နာအမျိုးမျိုးရှိခဲ့ပြီးကျွန်ုပ်၏ကုဒ်သည်ကွဲပြားမှုနှင့်စိတ်ပျက်ဖွယ်ကောင်းသောကမ္ဘာရှိအမျိုးသမီးတိုက်ပွဲနှင့်အမျိုးသမီးသဘာဝတရား၏ရုန်းကန်မှုကိုနက်နက်နဲနဲရောင်ပြန်ဟပ်သည်။ သို့သော်ဤစာအုပ်သည်ကျွန်ုပ်၏ကလေး, ကျွန်ုပ်၏အစုဘအနည်းနှင့်ကျွန်ုပ်၏အသက်မွေး 0 မ်းကျောင်းမှုဖြစ်သည့်အတွက်ကျွန်ုပ်၏စာသားကိုအိမ်သို့ယူပြီးသင်ထံမှသင်ယူရန်နှင့်၎င်းကိုသေချာစွာကြည့်ရှုသောအခါသင်၏ထည့်သွင်းစဉ်းစားမှုကိုတန်ဖိုးထားလေးမြတ်သည်။ ကျေးဇူးပြု. ကျွန်ုပ်မစုံလင်သောစိတ်ကိုမှတ်ထားပါ, ဤစာအုပ်သည်အမှားအယွင်းများ, ပြင်ဆင်မှုများနှင့်ထုတ်ဝေမှုအသစ်များရှိလိမ့်မည်။ ကျွန်ုပ်၏စာအရေးအသားတွင်အောင်မြင်သောအတွေ့အကြုံရှိရန်သင်၏ယုတ္တိရှိသော ဦး နှောက်ကိုအကောင်းဆုံးသင်စဉ်းစားရန်လိုအပ်လိမ့်မည်။ ဒါ့အပြင်စာရေးတဲ့အခါစိန်ခေါ်ချက်တွေနဲ့ရင်ဆိုင်ရရင်တောင်သင့်အတွက်သင့်အတွက်ကောင်းကောင်းဆိုလိုတာကိုနားလည်ပါ။ ဒီလိုမျိုးစဉ်းစားပါ။ သင်ဟာကွန်ပျူတာစနစ်ကိုသင်စဉ်းစားနိုင်သည့်အရာမှန်သမျှကိုစဉ်းစားနိုင်သည့်အခါသင်ကြုံတွေ့ရနိုင်သည့်အရာမှန်သမျှကိုစဉ်း စား. ခွဲခြမ်းစိတ်ဖြာခြင်း, ခွဲခြမ်းစိတ်ဖြာခြင်းနှင့်စုစည်းပါ။ ငါအတူတူအခက်အခဲများကြုံတွေ့ရသောကြောင့်ငါဒီလိုပြောတယ်။ ဤစာအုပ်ကိုသင်၏ကိုယ်ပိုင်စွန့်စားမှုဖြင့်အသုံးပြုပါ, လုံခြုံစိတ်ချရသော softwent တစ်ခုတည်ဆောက်ရန်အတွက်သင်၏အသိုင်းအဝိုင်းနှင့်လူမှုအသိုင်းအဝိုင်းများနှင့်အတူအလုပ်လုပ်ပါ, သင်မအောင်မြင်သည့်အခါတိုင်းဤသို့သောစာသားများနှင့်မအောင်မြင်ဘဲဤသို့သောစာသားများကိုမဖယ်ရှားဘဲကျွန်ုပ်အားအဘယ်ကြောင့်မအောင်မြင်ပါ, အင်တာနက်, အင်တာနက်အလုပ်လုပ်ပါလိမ့်မယ်။ ကျွန်ုပ်သည်စကားလုံးအနည်းငယ်သာဖြင့်မည်သူဖြစ်ကြောင်းနှင့်အကျွမ်းတဝင်မရှိခဲ့ပါ, သို့သော်စာဖတ်ရန်သင့်အားကျွန်ုပ်အားတိုက်တွန်းသည်။ သင်၏ကိုယ်ပိုင်စီမံကိန်းများတည်ဆောက်ခြင်းတွင်သင်၏ကိုယ်ပိုင်စီမံကိန်းများတည်ဆောက်စဉ်ကျွန်ုပ်ကို ဆက်လက်. နားလည်သဘောပေါက်ရန်သင်ဆက်လက်သိရှိနိုင်သည်။ သင်၏ပါမောက္ခများသို့မဟုတ်ဆရာများကသင့်အားမသတ်မှတ်နိုင်သရွေ့ဤစာအုပ်နှင့်အတူအိမ်စာမရှိတော့ပါ။ ကျွန်ုပ်၏ Capstone Project သည်ဤစာအုပ်တွင်သင်ဖတ်ရှုမည့်အရာအများစုအတွက်အခြေခံဖြစ်သည်။ ကျွန်ုပ်သည်ယခင်စီမံကိန်းများမှကုဒ်နံပါတ်များကိုထည့်သွင်းပြီး,

ဒီစာအုပ်ကဘာလဲ။ ဤစာအုပ်သည်ဥပမာအားဖြင့်သင်ခန်းစာဖြစ်သည်။ Code ကိုရှာတွေ့နိုင်သည်, ကုဒ်များကိုမည်သို့လေ့လာရမည်, အမှားများကိုဖြေရှင်းရန်, အမှားများကိုဖြေရှင်းရန်, သင် code ကိုဖြေရှင်းရန်နှင့်သင်၏ code ကိုဖြန့်ဖြူးပါ။ သင်၏ 0 က်ဘ်ဆိုက်၏ visitors ည့်သည်များနှင့်သင်၏အဆုံးတွင်အသုံးပြုသူများကိုတတ်နိုင်သမျှဆွဲဆောင်မှုအရှိဆုံးဖြစ်သည့်အကောင်းဆုံးအလင်းရောင်ကိုသင်တည်ဆောက်သည်။ ဤစာအုပ်တွင် software ဒီဇိုင်းနှင့်လုံခြုံရေးနှင့်လုံခြုံရေးအဖြစ် 0 က်ဘ်ဆိုက်ကိုအာရုံစိုက်သည့် software ဒီဇိုင်းဥပမာများကိုပြသပါမည်။ UNIX Shell ကို အသုံးပြု. အခြေခံစီမံကိန်းတစ်ခုတည်ဆောက်ခြင်းဖြင့်အခြေခံစီမံကိန်းကိုအရန်ကူးခြင်းနှင့် scripting features များဖြင့်အခြေခံဥပဒေများကိုကျွန်ုပ်တို့စတင်လုပ်ဆောင်မည်ဖြစ်သည်။ ထို့နောက်ကျွန်ုပ်တို့သည်အခြေခံဘလော့ဂ်ဝက်ဘ်ဆိုက်ကိုစစ်ဆေးပြီးကျွန်ုပ်တို့၏ဘလော့ဂ်ကိုဓာတ်ပုံနှင့်ဗွီဒီယိုအင်္ဂါရပ်များနှင့်အတူအဆင့်မြှင့်တင်ရန်အပြင်အခမဲ့ဆော့ဖ်ဝဲများကို အသုံးပြု. လုံခြုံရေးဖြေရှင်းနည်းများကို အသုံးပြု. ကျွန်ုပ်တို့၏ဆာဗာကိုလုံခြုံအောင်လုပ်ပါ။ အခြားသဘောတရားများအကြားဗွီဒီယိုတည်းဖြတ်ခြင်း, အသံလှူဒါန်းခြင်း, ကျွန်ုပ်တို့၏ဆော့ဖ်ဝဲကိုပိုမိုအသုံးဝင်ပြီးအာမခံထားသည့်ရွေးချယ်စရာများဖြင့်ကျွန်ုပ်တို့၏ဆော့ဖ်ဝဲကိုပိုမိုအသုံးဝင်စေရန်ကျွန်ုပ်တို့အားကူညီမည့် apis ကိုလေ့လာပါမည်။ လမ်းတစ်လျှောက်တွင်ကျွန်ုပ်တို့သည်စည်နှင့်ထပ်ခါတလဲလဲရေးဆွဲသူဒီဇိုင်း, မောင်းသူမဲ့လေယာဉ်ဒီဇိုင်းများအပါအ 0 င်သေနတ်များနှင့်ခဲယမ်းမီးကျောက်များဒီဇိုင်းနှင့်ထုတ်လုပ်မှုများကဲ့သို့သောရုပ်ပိုင်းဆိုင်ရာလုံခြုံမှုနှင့်စစ်သွေးကြွများကိုစူးစမ်းလေ့လာပါမည်။ ဂိမ်းများ, 2D နှင့် 3D 3D rendering Engines များကိုတည်ဆောက်ရန်နည်းလမ်းများနှင့်အတူကျိုးပဲ့သွားပြီး Silicone ရာဘာအတွက် Silicone ရာဘာတွင်ပြုလုပ်ထားသောအီလက်ထရောနစ်တုန်ခါနေသောရေတပ်နှင့်အီလက်ထရွန်နစ်တုန်ခါမှုစံပြပုဂ္ဂိုလ်တစ် ဦး နှင့်အလုပ်လုပ်ရန်နည်းလမ်းများဖြင့်ကျွန်ုပ်တို့အနားယူမည်။ လမ်းတစ်လျှောက်တွင်ကျွန်ုပ်တို့၏ဆော့ဖ်ဝဲကိုပိုမိုလုံခြုံစေရန်အတွက်ရရှိနိုင်သည့်စက်များသင်ယူမှုဖြေရှင်းနည်းများကိုလည်းအသုံးပြုပါမည်။ ကျွန်ုပ်တို့သည်လုပ်ငန်းစဉ်ကိုရပ်တန့်ရန် 0 က်ဘ်အတွက် 0 က်ဘ်အတွက်စတော့ရှယ်ယာကိရိယာများကိုအသုံးပြုပါမည်။ ဤစာအုပ်သည်သင်၏အောင်မြင်မှုအတွက် Web application တစ်ခုတည်ဆောက်ခြင်းနှင့်ကွန်ပျူတာနှင့် embedded စက်ပိုင်းဆိုင်ရာစနစ်များနှင့်ပေါင်းစပ်ပြီးဆော့ဖ်ဝဲလ်နှင့် embedded hardware နှင့်ပေါင်းစပ်ရန်လမ်းညွှန်ချက်တစ်ခုဖွင့်ရန်လမ်းညွှန်တစ်ခုဖြစ်ပြီးနောက်ခံဗဟုသုတများနှင့်ယခင်အတွေ့အကြုံများအတွက်လမ်းညွှန်ချက်တစ်ခုဖွင့်ရန်လမ်းညွှန်ဖြစ်သည်။

ဒီစာအုပ်ကဘာလဲ - သင်က 0 ဘ်ဆိုဒ်တစ်ခုကိုတကယ်လိုချင်ပါကရိုးရှင်းသောစတိုးဆိုင်တစ်ခုတည်ဆောက်ပြီးသင်လိုအပ်သည့်အရာများကိုရောင်းချခြင်း, ဒီစာအုပ်ကဒါမဟုတ်ဘူး။ ဤစာအုပ်သည်သင်ရှာဖွေနိုင်သောမည်သည့်ဆော့ဝဲလ်များထက်မဆိုအသုံး 0 င်သော, အပြည့်အဝအသုံးဝင်သည်, အပြည့်အ 0 အလုပ်လုပ်ခြင်း, အကယ်. သင်သည်ဤစာအုပ်ကိုအနီးကပ်လိုက်လျှောက်ပါကသင်ကုဒ်ရေးရန်, သုတေသနကုဒ်များကိုရေးရန်, သင်၏ကိုယ်ပိုင်အက်ပလီကေးရှင်းများကိုတည်ဆောက်ရန်လိုလိမ့်မည်။ ငါဒီစာအုပ်ကနေအစောပိုင်းအဆင့်ဆင့်မှာငွေရှာပါ့မယ်, ဘာဖြစ်လို့လဲဆိုတော့လူတွေကလူတွေကလိုအပ်တဲ့သတင်းအချက်အလက်တွေပါ 0 င်ပြီးစာဖတ်ချင်တာ, ဤစာအုပ်သည်သင့်အတွက်အက်ပလီကေးရှင်းတစ်ခုတည်ဆောက်ခြင်းမဟုတ်သော်လည်းသင်နှင့်သင်၏ထောက်ခံသူများ, ည့်သည်များ, ည့်သည်များ, သူငယ်ချင်းများ, မိသားစုများ,

သင်ဘာသင်ယူရမလဲ ဤစာအုပ်သည်သင့်အားမည်သို့တည်ဆောက်ရန်နှင့်ရောင်းချခြင်း, အသုံးဝင်သောဆော့ဖ်ဝဲ, မီဒီယာမှတ်တမ်းတင်ခြင်း, မျက်နှာအသိအမှတ်ပြုခြင်း, ဒီစာအုပ်က Debian Linux ကိုအာရုံစိုက်ဖို့အတွက် Python Code ကိုတည်ဆောက်ဖို့ BASS Code ကိုတည်ဆောက်ဖို့, ကူးယူထားတဲ့ပစ္စည်းတွေနဲ့တခြားကွန်ရက်စာမျက်နှာတွေကိုတည်ဆောက်ဖို့ BASS Code နဲ့ Interactivity ကိုတည်ဆောက်ဖို့ဘယ်လိုလုပ်မလဲ, အတည်ပြုခြင်းသို့မဟုတ်အခြားရည်ရွယ်ချက်များ, ID စကင်ဖတ်စစ်ဆေးမှု, ရုပ်ပုံနှင့်ဗွီဒီယိုဖြည့်ညှင်းမှု, သင်၏ဆော့ဖ်ဝဲကိုလုံခြုံစိတ်ချရသော, ငွေပေးချေမှု, cryptocricrencening trading, သင်၏ကိုယ်ပိုင် Bluetooth ကိရိယာများ, chargers များ, microcontrollers များ, circuits များ, motors များ, ငါ 3D ဒီဇိုင်းကျောင်းပြေးကွက်ကိုဖြန့်ဝေထုတ်လုပ်မှုနှင့်ကိရိယာများအတွက်အသုံးချပြီးသေဆုံးချမှတ်ခြင်းနှင့်သေဆုံးခြင်းဖြင့်သင်၏ကိုယ်ပိုင် embedded, hardware devices များကိုပေါင်းစပ်ပြီးဘက်ထရီများ, အားသွင်းစက်များ, နှင့် bluetooth နှင့်ဝဘ်နှင့်အတူသူတို့ကိုကွန်ယက်။ အထူးသဖြင့်ကျွန်ုပ်တို့သည် Prograce interface သို့မဟုတ် command line utility ကိုရရှိနိုင်သည့် Openscad တွင်ပါ 0 င်သည့်အမှုနှစ်ခုနှင့်အိမ်လုပ်သမားများနှင့်အိမ်လုပ်ခိုင်းခံထားရသောအိမ်လုပ်သမားများနှင့်အိမ်လုပ်ခိုင်းခံထားရသူများကိုဆန်းစစ်ကြည့်ရှုပါမည်။ သင်ကြိုတင်အတွေ့အကြုံမရှိသောမြေပြင်မှဝက်ဘ်ဆိုက်ကိုမည်သို့တည်ဆောက်ရမည်ကိုလေ့လာလိမ့်မည်, ၎င်းသည်၎င်းကိုကြိုတင်အတွေ့အကြုံမရှိချေ, သင်၏ 0 ဘ်ဆိုဒ်မှလုံခြုံပြီးပိုမိုလက်တွေ့ကျသော, ဗီဒီယိုနှင့်အသံကိုဖန်တီးရန်စက်ခြင်းနှင့်ကွန်ပျူတာရူပါရုံကိုအသုံးပြုရမည်, သင်ကမ်းလှမ်းသောအသုံးဝင်သောသတင်းအချက်အလက်များကိုဖြည့်ဆည်းနိုင်ရန်အတွက်အခြားဝက်ဘ်ဆိုက်များကိုတည်ဆောက်ရန်အတွက်အခြားဝက်ဘ်ဆိုက်များကိုတည်ဆောက်ရန်အခြားဝက်ဘ်ဆိုက်များကိုတည်ဆောက်ရန်အခြားဝက်ဘ်ဆိုက်များကိုဖြည့်ဆည်းရန်နှင့်အခြား 0 က်ဘ်ဆိုက်များကိုဖြည့်ဆည်းရန်သင်နှင့်တူသောအသံကိုမည်သို့ဖြတ်သန်းနိုင်မည်နည်း။ ဤစာအုပ်ကိုမီဒီယာ, လုံခြုံရေးနှင့်စက်စာကိုအများဆုံးအာရုံစိုက်လိမ့်မည်။ ၎င်းသည်မှန်ကန်သောအသုံးပြုသူများကိုလက်တွေ့ကျပြီးလက်တွေ့ကျခြင်း, လက်တွေ့ကျ, လက်များနှင့်ထိတွေ့ဆက်ဆံခြင်းတို့ဖြင့်မှားယွင်းသော, ဤစာအုပ်သည် UNIX, အထူးသဖြင့် Debian (Ubuntu), Bash Shell, Python, HTML, CSS, Python အတွက်အသုံးဝင်သော software package များနှင့် Python အတွက်အသုံးဝင်သော software packets များနှင့် Python အတွက်အသုံးဝင်သော software packets များနှင့် Python software များနှင့် Python အတွက်အသုံးဝင်သော software software များဖြစ်သည်။ Cryptocurrencres ကိုအလိုအလျောက်ဘယ်လိုကုန်သွယ်နိုင်မလဲ, Cryptocurrencybure မှာဒါမှမဟုတ်ပုံမှန်ဒက်ဘစ်ကဒ်တွေဆီကနေငွေပေးချေမှုကိုသင်ရွေးချယ်ပါက, သင်၏ 0 က်ဘ်ဆိုက်မှကြော်ငြာမှတစ်ဆင့်သင်၏ 0 က်ဘ်ဆိုက်မှငွေများမည်သို့ငွေရှာရမည်ကိုကျွန်ုပ်အားသင်ပေးမည်။ သင်၏ app ကိုရှာဖွေရေးအင်ဂျင်များအတွက်အဆင်သင့်ဖြစ်အောင်လုပ်ရမည်။ သင်၏ဆော့ (ဖ်) ဝဲကိုမည်သို့ရောင်းရမည်, 0 န်ဆောင်မှုများကိုရှာဖွေနေသည်, 0 န်ဆောင်မှုများကိုရှာဖွေနေသည်, 0 န်ဆောင်မှုများကိုရှာဖွေနေသည်, သင့်အတွက်သင့်အတွက်အလုပ်လုပ်သော Cloud Computer များ၌သင်၏ဒေတာများကို cloud cloud computers များပေါ်တွင်မည်သို့သိမ်းဆည်းရမည်, သင်၏အသုံးပြုသူများကိုသင်၏ 0 က်ဘ်ဆိုက်တစ်ခု၏ခလုတ်ကိုနှိပ်ခြင်းဖြင့်သင်၏ 0 ဘ်ဆိုဒ်များကိုသင် 0 က်ဘ်ဆိုက်တစ်ခုသို့ပို့ဆောင်ရန်နှင့်သင်အသုံးပြုသူများကိုသင်၏ 0 က်ဘ်ဆိုက်သို့ခေါ်ဆောင်သွားရန်မည်သို့ပြုလုပ်ရမည်ကိုကျွန်ုပ်အားသင်ကြားပေးမည်။ ဤစာအုပ်သည်မီဒီယာများကိုဗွီဒီယိုများဖြင့်ပုံနှိပ်ထုတ်ဝေရန်နှင့်ဖြန့်ဖြူးခြင်း၏လက်တွေ့ကျမှုများကိုစာသားမှဗီဒီယိုများသို့ကူးယူခြင်းနှင့် 0 ဘ်ဆိုဒ်တစ်ခုကိုဖန်တီးရန်သင်နှင့်သင်ကိုယ်တိုင်သာလျှင်သင်ကိုယ်တိုင်ကိုယ်စားပြုသည့်အက်ပလီကေးရှင်းကိုသင်ပြုလုပ်နိုင်သည့်အပလီကေးရှင်းကိုသင်ပြုလုပ်နိုင်သည့်အပလီကေးရှင်းကိုသင်ပြုလုပ်နိုင်သည်။ သင်ထံမှအကြံဥာဏ်များနှင့်လှည့်ကွက်အနည်းငယ်ကို coding tips မှမိတ်ကပ်နှင့်ဓာတ်ပုံရိုက်ခြင်းနှင့်ပိုမိုများပြားသောလက်တွေ့ကျသည့်လက်တွေ့ကျမှု, ဒီစာအုပ်ကို "လက်တွေ့ကျတဲ့0 က်ဘ်ဆိုက်အခြေပြုနက်ရှိုင်းသောသင်ယူမှုနှင့်လုံခြုံရေး "အကြောင်းပြချက်တစ်ခုအရ Code ကိုလေ့လာခြင်း, ဤစာသား၏လေ့လာမှု၏လေ့လာရေးအပိုင်း, Enhancement, image captrating နှင့် pultection Metrics ကဲ့သို့သောအခြားအလုပ်များကဲ့သို့သောပုံရိပ်များမှပုံရိပ်များမှရရှိသောပုံရိပ်များမှရရှိသောပုံရိပ်များမှရရှိသောပုံရိပ်များသို့မဟုတ်ပုံရိပ်တစ်ခု၏ဓာတ်ပုံတစ်ပုံ၏ဓာတ်ပုံ။ သင်၏မျက်နှာသည်သင့်အား username နှင့် passcode အသစ်တစ်ခုအတွက်အတည်ပြုရန်နှင့် IP address အသစ်တစ်ခုအတွက်အတည်ပြုရန်လွယ်ကူခြင်း, အခြေခံအားဖြင့်လုံခြုံစိတ်ချရသော, သုံးပါ) ။ impeccally လုံခြုံသောဆော့ဗ်ဝဲကိုတည်ဆောက်သူမည်သူမဆိုဤအဓိပ္ပာယ်ရှိသည်ကိုအချို့သောခံစားချက်ရှိသည်။ ဆော့ (ဖ်) ဝဲသည်မူလက 0 င်ရောက်နိုင်သည့်ကိရိယာများနှင့်အကောင့်များအားလုံးကို 0 င်ရောက်နိုင်ခြင်းမဟုတ်သည့်အတွက်၎င်းတို့သည်ဆော့ (ဖ်) ဝဲအတွက်မကောင်းသောအကြံဥာဏ်များကိုအမြဲတမ်းမရရှိနိုင်ပါ။ ဤစာအုပ်သည်ဤစာအုပ်၏အဓိကအချက်ဖြစ်သည်။ ကွန်ယက်ကွန်ပျူတာတစ်ခုသည် default token နှင့် SSH သို့မဟုတ် SACK SHALL ခလုတ်ဖြင့်ပုံမှန်အားဖြင့်လုံခြုံသည်။ ဝက်ဘ်ဆာဗာတွင် 0 က်ဘ်ဆာဗာတွင်ဖွင့်ထားသည့်အနုပညာလုံခြုံရေးကိရိယာများကိုဖွင့်ထားသည့်အတွက်အကောင်းဆုံးလုံခြုံမှုရှိသည်။ 0 က်ဘ်ဆာဗာသည်သုံးစွဲသူ၏ဝဘ်ဘရောက်ဇာကို အသုံးပြု. အသုံးပြုသူစက်၏အင်အားအကြီးဆုံးအစိတ်အပိုင်းဖြစ်သောကြောင့်အသုံးပြုသူစက်၏စွမ်းအားအရှိဆုံးအစိတ်အပိုင်းဖြစ်သည်။ ဒီကိရိယာတန်ဆာပလာများ, သင်မြင်သောဝက်ဘ်စာမျက်နှာများကိုပြန်လည်ပေးပို့နိုင်ပြီးရုပ်ပုံများ, အသံနှင့်ဗွီဒီယိုများကိုမှတ်တမ်းတင်နိုင်ပြီးဘလူးတူပီများရေဒီယိုစက်များ, ဆိုဒ်။ သင်၏စွန့်ပစ်ခြင်းဆိုင်ရာကိရိယာများအားလုံးကိုအသုံးပြုခြင်းဖြင့်သင်ဤစာအုပ်ဖြင့်လုံခြုံစိတ်ချရသော 0 ဘ်ဆိုဒ်တစ်ခုတည်ဆောက်ရန်နှင့်သင့်အတွက်အလုပ်လုပ်သောလုံခြုံသောကွန်ရက်တပ်ဆင်ထားသည့်ကွန်ပျူတာစနစ်ကိုသင်ကိုယ်တိုင်တပ်ဆင်ထားမည်။

ဘယ်မှာစတင်ရမလဲ ဤစာအုပ်ကိုကျော်သွားပါကဤစာအုပ်ကိုကျော်သွားပါကသင်လိုအပ်သည့်ကုဒ်အတိအကျကိုကျော်သွားသည်။ သင်ကုဒ်ရေးရန်အတွေ့အကြုံမရှိပါကဤစာအုပ်ကိုဖတ်ရန်သင့်အားကျွန်ုပ်အထူးအကြံပြုလိုသည်။ ဤစာအုပ်သည်သင့်အတွက်မှန်ကန်ရန်သေချာစေရန်ယခင်အပိုင်းများကိုဖတ်ရန်, ဤစာအုပ်သည်သင့်အတွက်မသင့်တော်ပါက၎င်းသည် Web Developments နှင့် ပတ်သက်. လေ့လာသင်ယူရန်စိတ်ဝင်စားဖွယ်ကောင်းသောမိတ်ဆွေတစ် ဦး သို့မဟုတ်ဆွေမျိုးတစ် ဦး အားလက်ဆောင်ပေးရန်စဉ်းစားပါ။ သင်မည်သည့်နေရာ၌မဆိုသင်အသုံးဝင်သောအက်ပ်ကိုတည်ဆောက်ရန်ရည်ရွယ်ထားပါကဤစာအုပ်၏အစိတ်အပိုင်းတိုင်းကိုအသုံးဝင်ပါကအသုံးဝင်လိမ့်မည်။ ယခုသင်ငါ့ကိုသိပြီ, ဤစာအုပ်ကိုသင်သိပြီးသင်စတင်ရန်အဆင်သင့်ဖြစ်သည်။ စတင်ရန်ကွန်ပျူတာကိုဖမ်းရန် (သေတ္တာစတိုးဆိုင်, အမေဇုန်သို့မဟုတ် desktop မှစျေးအသက်သာဆုံးလက်ပ်တော့ပ်ပင်လျှင်,

ဒီစာအုပ်ကိုဘယ်လိုဖတ်ရမလဲ စာသားသည်စာသားသည် command prompt ထဲတွင်ပိုင်ဆိုင်သည်, သင် run သောကုဒ်ကိုရေးလိမ့်မည်။ Command Prompt သည် keyboard ကိုအာရုံစိုက်ခြင်းနှင့်သင်၏အသွားအလာကိုအရှိန်မြှင့်ခြင်း,

စတင်အသုံးပြုခြင်း: ငုပ်ကြပါစို့။ ကျွန်ုပ်တို့သည်ဒေသတွင်းစက်ပေါ်တွင်ကုဒ်နံပါတ်တစ်ခုကိုတည်ဆောက်ပြီးအင်တာနက်နှင့်ချိတ်ဆက်ထားသော 0 ဘ်ဆိုဒ်တစ်ခုတည်ဆောက်ခြင်းမရှိဘဲစတင်ပါလိမ့်မည်။ ဤသည်ကိုစတင်ရန်အတွက်ပိုမိုလုံခြုံသည်, မည်သည့်အရာမျှကုန်ကျသည်, သင့်အတွက်လွယ်ကူသည်။ သင်၏ operating system ပေါ် မူတည်. bash shell ထဲသို့ 0 င်ရောက်ခြင်းသည်အနည်းငယ်ကွဲပြားသည်။ Mac OS အတွက်ကျွန်ုပ်သည် virtual machine တစ်ခုနှင့်လိုက်ဖက်နိုင်သည့်အတိုင်းဤအချိန်တွင် virtual machine တစ်ခုကို install လုပ်ရန်အကြံပြုလိုပါသည်။ VirtualBox နှင့် Firlls ကဲ့သို့သောအမျိုးမျိုးသောပံ့ပိုးသူများသည်သင့်အတွက် virtual machine ကိုဖွင့်နိုင်သည်။ သို့သော် Ubuntu ကိုစက်ပေါ်တွင်တိုက်ရိုက်တပ်ဆင်ရန်သင်အစာရှောင်ခြင်း, အကယ်. သင်သည် Linux သို့မဟုတ် Windows ကိုအသုံးပြုနေပါကကျွန်ုပ်အကြံပြုသည်မှာစီမံကိန်းတစ်ခုဖန်တီးရန်အလွန်လွယ်ကူသင့်သည်။ သင်၏ terminal ကိုဖွင့်ပါ, သင်မထိုက်မတန်ကိုမြင်တွေ့ရပါ။ အဆင့် 2 ကိုစတင်ပါ။ သင် Windows ကိုအသုံးပြုနေပါကအဆင့် 1 ကိုသုံးပါ။

အဆင့် 1: - Windows အသုံးပြုသူများသာ Windows တွင် command prompt ကိုဖွင့်ပြီးပါ wsl -install

အဆင့် 2: - ဒီမှာဆက်သွားပါ, ဒါမှမဟုတ် Windows ကိုမသုံးပါကအဆင့် 1 ကိုဒီနရောကိုကျော်လိုက်ပါ ပွင့်လင်းသော terminal တစ်ခုတွင် Ubuntu တွင် Ubuntu ဟုခေါ်သော Ubuntu ဟုခေါ်သော Mac သို့မဟုတ် Linux တွင် terminal သို့မဟုတ်အလားတူအမည်ရှိ ubuntin သို့မဟုတ်အလားတူနာမည်ကိုစတင်ခြင်းဖြင့်စတင်သည်။ ကျွန်ုပ်တို့သည် mkdir command ဖြင့်ပြုလုပ်သည်။ ၎င်းသည်လမ်းညွှန်တစ်ခုဖန်တီးပေးသည်။ သင်၏စီမံကိန်းကိုရှာဖွေရန်လမ်းညွှန်တစ်ခုဖန်တီးရန်လိုအပ်ပါကလမ်းညွှန်သို့ပြောင်းရန် CD command ကိုသုံးပါ

CD / Path / Directory - သင်၏ destination directory before pathere folders (ဖိုင်များ) သည် folders များ (ဖိုင်များ) သည် ~ သို့မဟုတ် / home / username (username username) ။ ပုံမှန်လမ်းညွှန်တစ်ခုသို့ပြောင်းလဲရန် CD သို့မဟုတ် CD ကိုရိုက်ပါ MKDIR ဥပမာ - "ဥပမာ" ကို directory ၏အမည်နှင့်အစားထိုးပါ

ယခုတွင်သင်သည်သင်၏စီမံကိန်းအတွက်အလုပ်လုပ်သော directory ရှိသည်။ ကွဲပြားခြားနားသောစက်သို့ပြောင်းရန်သို့မဟုတ်သင်ရေးထားသောကုဒ်ကိုဖြန့်ရန်လိုအပ်ပါကဤလမ်းညွှန်ချက်ကိုသိမ်းဆည်းရန်အလွန်အရေးကြီးသည်မှာ 0 က်ဘ်အတွက်အဆင်သင့်ဖြစ်နေပါပြီ, နောက်အဆင့်အနည်းငယ်တွင်သင်၏လမ်းညွှန်ကိုအရန်ကူးရန် script တစ်ခုတည်ဆောက်လိမ့်မည်။ သို့သော် script တစ်ခုတည်ဆောက်ခြင်းသည်ကုဒ်အနည်းငယ်ကိုတည်ဆောက်ခြင်းနှင့်ကုဒ်ကိုတတ်နိုင်သမျှအသုံးဝင်သောနေရာချထားရန်အလိုအလျောက်ပြုလုပ်ရန်လိုအပ်သည်။ ဒီတော့ scripts တွေကိုအရင်တည်ဆောက်ဖို့ script ကိုတည်ဆောက်ကြပါစို့။ ဇာတ်ညွှန်းကိုဖန်တီးပြီး၎င်းကို executable လုပ်ပါ။ ဒီ sudo, chmod ကိုသုံးပြီးဒီဟာကိုသုံးမယ်, ပြီးတော့ script ကို "ascrippt" လို့ခေါ်ပါ။

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

ယခုကျွန်ုပ်တို့သည် script ကိုဖန်တီးခဲ့ကြပြီး၎င်းကို executable လုပ်ထားပြီးတည်းဖြတ်ရန်အဆင်သင့်ရှိသည်။ Nano သည်စာသားတည်းဖြတ်သူတစ် ဦး ဖြစ်ပြီး၎င်းကိုနှိပ်ခြင်းမရှိဘဲစာသားကိုတည်းဖြတ်ခွင့်ပြုလိမ့်မည်။ ၎င်းသည် Graphical user interface ကိုအသုံးပြုခြင်းထက်ပိုမိုလွယ်ကူသည်။ nano နှင့်ဖိုင်တစ်ခုတည်းဖြတ်ရန်, nano နှင့်ဖိုင်သို့လမ်းကြောင်းကိုသုံးပါ။ script တစ်ခုပြုလုပ်သော script တစ်ခုပြုလုပ်ရန်၎င်းသည်ကျွန်ုပ်တို့၏ script ကိုပထမနေရာတွင်မျှအောင်ပြုခြင်းနှင့်ဆင်တူသည်။ အထက်တွင်ဖော်ပြထားသောကုဒ်နံပါတ်ကို အသုံးပြု. script ၏အမည်ကိုအငြင်းပွားဖွယ် parameter ဖြင့်အစားထိုးခြင်း, ၎င်းသည် sudo ascrots ascrots ကိုရိုက်ခြင်းဖြင့် script ကိုစာရိုက်ခြင်းဖြင့်ကျွန်ုပ်တို့အား script ကိုခေါ်ဆိုခြင်းဖြင့်ကျွန်ုပ်တို့အား "Never Clption" ကိုအစားထိုးခြင်းဖြင့်မည်သည့် script အသစ်ကိုဖန်တီးနိုင်မည်နည်း။ Nano ရှိကုဒ်သည်ကြည့်သင့်သည်။

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

Nano ကိုပိတ်ဖို့အတွက် Control key ကိုကိုင်ပြီး x ကိုနှိပ်ပြီး y ကို denote saving လုပ်ပြီးပြန်လာတာကိုဆိုလိုတာ။ Script ကိုတည်းဖြတ်ရန်ဤ command သုံးခုကိုရိုက်မည့်အစားယခုကျွန်ုပ်တို့သည် sudo ascrots ကိုရိုက်ထည့်နိုင်လိမ့်မည်။ ဒီအလုပ်ဖြစ်တယ် မည်သည့် script အသစ်မဆို၎င်းကို shell ကိုခေါ်ဆိုခြင်းဖြင့်အလွယ်တကူလည်ပတ်နိုင်သည်။ ကျွန်ုပ်တို့၏အလုပ်ကိုယခုသိမ်းထားကြပါစို့။ ကျွန်ုပ်တို့၏ script အသစ်ကိုသိမ်းဆည်းရန် Backup script ကိုရေးကြပါစို့။

sudo ascript backup

NONON တွင်ယခု -

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

Mkdir နှင့်သင်ဖန်တီးထားသောစီမံကိန်းကိုမည်သည့်နေရာတွင် / လမ်းကြောင်း / လမ်းညွှန်ဖြစ်သည်။ နောက်ပိုင်းတွင်ဤကဲ့သို့သောထပ်ခါတလဲလဲလမ်းကြောင်းများကိုကွင်းဆက်နှင့်စာရင်းတစ်ခုဖြင့်မည်သို့ကူးယူရမည်, ဤ script ကို run ရန်နှင့်သင်၏ကုဒ်ကိုအရန်ကူးရန် Nano ရှိဖိုင်ကို control + x, y နှင့်ပြန်သွားပါ။ အောက်တွင်သင်၏ shell ကိုရိုက်ထည့်ပါ

backup

အကယ်. သင်သည်ဤစာအုပ်ကိုဖတ်နေစဉ်စကားဝှက်တစ်ခုအတွက်သင့်အားတောင်းခံပါကသင်၏သုံးစွဲသူစကားဝှက်ကိုမှန်ကန်စွာဖြည့်စွက်ပါ။ Rerun command များသို့တက်။ အောက်မြားများကို သုံး. တည်းဖြတ်နိုင်သည်။ လက်ျာဘက်မြှားများနှင့် key ကိုပယ်ဖျက်ခြင်းနှင့် key ကိုဖျက်ခြင်းနှင့်သော့ကိုပယ်ဖျက်ခြင်းမပြုမီ command ကိုရွေးချယ်ရန် command ကိုရွေးပါ။

ဂုဏ်ယူပါတယ်! သင်၏လုပ်ငန်းလမ်းညွှန်တွင်အရေးကြီးသော shell ကို sclieds နှစ်ခုကိုထောက်ခံသည့်ကြောက်စရာကောင်းသောအရန်ကူးခြင်း script တစ်ခုဖန်တီးနိုင်ခဲ့သည်။ စီမံကိန်းကပိုကြီးလာတာနဲ့အမျှအရာရာကိုနောက်ပိုင်းမှာရွှေ့ပြောင်းနိုင်တယ်, Cloud ၌အရန်ကူးရန်သွားကြကုန်အံ့, အထူးသဖြင့်ကုဒ်မအောင်မြင်သည့်အခါတိုင်းဖြတ်တောက်ခြင်းသည်တခါတရံပျက်စီးသွားသော Linux ဖြစ်ရပ်များကိုကျွန်ုပ်တို့ပြောင်းရွှေ့လာသည့်အတွက်လုံခြုံစိတ်ချရသော Linux ဖြစ်ရပ်များသို့ပြောင်းရွှေ့ခြင်းဖြင့်သင့်အားသော့ခတ်ထားခြင်းမခံရပါကသင်၏ code ကိုအရံသိမ်းဆည်းထားပါကအရန်ကူးခြင်းမပြုနိုင်ပါ။

အကယ်. သင်သည် Ubuntu virtual machine ကိုအသုံးမပြုပါက Ubuntu virtual machine ကို အသုံးပြု. Ubuntu virtual machine ကို အသုံးပြု. အလုပ်လုပ်သော 0 ဘ်ဆိုဒ်တစ်ခုတည်ဆောက်ရန်နှင့်သင့်ကွန်ပျူတာပေါ်တွင်နက်နက်ရှိုင်းရှိုင်းသင်ယူမှုစစ်ဆင်ရေးများကိုနှစ်သက်သောအခါသင်၏ဘဝကိုပိုမိုလွယ်ကူစေသည်။ ကျွန်ုပ်တို့သည်ကုဒ်နံပါတ်ကိုမဝေးတော့သောအနာဂတ်ကာလအတွင်းဝက်ဘ်ဆာဗာတစ်ခုသို့ရွှေ့ပါမည်။ Mac OS ကိုသင်အသုံးပြုလိုပါကလိုအပ်သော package များကိုအွန်လိုင်းတွင်ရှာဖွေရန်နှင့်တပ်ဆင်ရန်ဖိတ်ခေါ်ပါသည်, သို့သော်ဤစာအုပ်သို့မဟုတ်စီးရီးများအဖုံးတိုင်းအတွက်အခြားရွေးချယ်စရာများမရှိပါ။

Command Sodo ascroup backup ကို run ခြင်းဖြင့်ကျွန်ုပ်တို့၏အလုပ်ကို backup script ဖြင့်ပြုလုပ်ရန် command အနည်းငယ်ကိုထည့်သွင်းရန်ပညတ်တော်အနည်းငယ်ကိုထည့်သွင်းရန်။

# ...

နောက်တဖန်ကယ်ရန် X ကိုကယ်တင်ရန်။

ယခုကျွန်ုပ်တို့သည်ဤစီမံကိန်းအတွက်အချိန်သတ်မှတ်ချက်အချို့ပြုလုပ်ရန်လိုအပ်သည်။ ဘာဖြစ်လို့လဲဆိုတော့မကြာခင်မှာပဲ Git Project တစ်ခုဖြစ်လာမည့် Git Repository မှချထားသည့်အခါတိုင်း command တိုင်းကိုရေးရန်မလိုအပ်ပါ။ စတင်ရန်ကျွန်ုပ်တို့သည်မှန်ကန်သောလမ်းညွှန်တွင်ရှိနေပြီး Git repository ကိုစတင်ရန်နှင့် ssh keys ကို generate လုပ်ပါ။

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

SSH-keygen ကိုရိုက်ပြီးနောက်တွင် SSH-Keygen ကိုရိုက်ကူးပြီးသော folder တစ်ခုတွင်သော့ဖိုင်တွဲတွင်သိမ်းဆည်းထားသင့်သည် .SSH ဟုခေါ်သည်။ ၎င်းကို id_rsa.pub ဟုခေါ်သည်။ ဒီသော့ကိုရှာပြီးကူးယူကြစို့။ ကြည့်ဖို့,

cd ~
cat .ssh/id_rsa.pub

သင်၏အကောင့်သို့ SSH ခလုတ်ကိုမထည့်သွင်းမီနောက်ဆုံး command ဖြင့်ပြန်ပို့သောစာသားကိုကူးယူပါ။ သင့်တွင်အကောင့်တစ်ခုရှိပြီးတစ်ချိန်ကမီနူးတွင် 0 င်ရောက်နိုင်သည့် SSH သော့ကိုမထည့်သွင်းမီ SHG key ကိုမထည့်သွင်းမီ SHG key ကိုမထည့်သွင်းမီ Six ခလုတ်ကိုထည့်သွင်းခြင်းမပြုမီ Settings ကိုရိုက်ထည့်ပါ။ SSH ခလုတ်ကို select လုပ်ပါ။ Repository အသစ်တစ်ခုကိုဖန်တီးရန်နှင့် Github သို့မပို့မီ၎င်းကိုကူးယူခြင်းဖြင့်၎င်းကိုထည့်သွင်းခြင်းဖြင့်၎င်းကိုထည့်သွင်းခြင်းဖြင့်သင်ထည့်ပါ။ ၎င်းသည်အခြား Git ပံ့ပိုးသူများနှင့်ဆင်တူသည်, သူတို့၏စာရွက်စာတမ်းများကိုဖတ်ရန်လိုအပ်လိမ့်မည်။ Repository configuration အသစ်တွင်သင်၏ repository အမည်ရှိအမည်ကိုဖော်ပြရန်နှင့်သင်ထုတ်ဝေလိုမလားဆိုတာကိုဆုံးဖြတ်ပါ, repository ကိုဖန်တီးပြီးသည်နှင့် SSH URL နှင့်ပ cl ိပက်ခကိုကူးယူပြီးအောက်ပါ command ထဲသို့ကူးထည့်ပါ။

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

ယခုသင်သည် CD နှင့် Repository ကိုပြန်သွားနိုင်သည်, သင်ဤနှင့်အကျွမ်းတဝင်ရှိလိမ့်မည်။ သင်၏ backup script ကို Backup လုပ်ပါ

ကောင်းတယ် အခုငါတို့က coding ရနိုင်တယ်။ Django ကို Bash နှင့် Git တို့အပေါ်ကောင်းကောင်းဆုပ်ကိုင်ထားကြပါစို့။ Django သည်ကျွန်ုပ်တို့၏ဆော့ဖ်ဝဲကိုအလိုအလျောက်အရန်ကူးယူခွင့်ပြုလိမ့်မည်။ Bash သည်ဤသို့ပြုလုပ်နိုင်သည်။

Ubuntu တွင်ဆော့ဖ်ဝဲကိုတပ်ဆင်ရန် Sudo Apt-Get Command ကိုအသုံးပြုမည်။ ပထမ ဦး စွာကျွန်ုပ်တို့ပြီးသားရှိတဲ့ဆော့ (ဖ်) ဝဲကို update လုပ်ပြီးအဆင့်မြှင့်တင်ကြပါစို့။ ဤသည် sudo apt-get update ကို update နှင့် sudo apt-get အဆင့်မြှင့်တင်ခြင်းနှင့်အတူလုပ်နိုင်ပါတယ်။ နောက်, Python နှင့်ကျွန်ုပ်တို့၏ virtual envirther ပတ်ဝန်းကျင်ကိုအောက်ပါ command ဖြင့် install လုပ်ကြရအောင်။

Ubuntu ဥပမာအားဖြင့်ဆော့ဖ်ဝဲလ်ထည့်သွင်းမှုအရ Django နှင့်အတူ Django နှင့်သွားရန်သင်လိုအပ်သည်။ Windows နှင့် Linux အတွက်ဤသည်မျှမျှတတရိုးရှင်းစွာဖြစ်သင့်သည်, သို့သော် Mac အတွက်သင် virtual box နှင့် virtualbox ကို virtualbox သို့မဟုတ် first virtual environments ကို သုံး. လေသည် virtual enverse န်းကျင်ကို အသုံးပြု. OUTS ကို အသုံးပြု. OUSTERS ကို အသုံးပြု. OUBUNDUS envire enception ကိုအသုံးပြုလိုသည်။ Ubuntu သည်ဤကိစ္စတွင်အရေးပါသည်, ဘာကြောင့်လဲဆိုတော့၎င်းသည် 0 က်ဘ်ဆိုက်များဖွင့်ထားသော software သည် 0 က်ဘ်ဆိုက်များကိုလက်ခံထားသော software အားလုံးနှင့်အတူဝက်ဘ်ဆိုက်များကိုလက်ခံရန်ခွင့်ပြုသည်။

Django သို့တူးကြပါစို့။

ကျွန်ုပ်တို့၏လမ်းညွှန်တွင် CD နှင့်အတူ,

python -m venv venv # ကုဒ်သိုလှောင်ထားသည့် virtual ပတ်ဝန်းကျင်ကိုဖန်တီးသည်
source venv/bin/activate # virtual ပတ်ဝန်းကျင်ကိုသက်ဝင်သည်
django-admin startproject mysite . # Mysite သည်ကျွန်ုပ်၏လက်ရှိလမ်းညွှန်တွင်စတင်နေပြီဖြစ်သည်။

Django ကကျွန်တော်တို့ကိုစလုပ်တာပါ, ဘာကြောင့်လဲဆိုတော့ Django က Web server ကိုလက်ခံနေတဲ့အတွက်, ယခုကျွန်ုပ်တို့ Django တပ်ဆင်ထားသည့်အတွက်ယခုအခါကျွန်ုပ်တို့လိုအပ်ကြောင်းအလုပ်လုပ်ရန် Settings ကိုအနည်းငယ်သာတည်းဖြတ်ကြပါစို့။ ပထမ ဦး စွာအက်ပလီကေးရှင်းအသစ်တစ်ခုဖန်တီးကြပါစို့

python manage.py startapp feed

ပထမအက်ပလီကေးရှင်းကို Feed ဟုခေါ်သည်ကိုသင်သတိပြုမိလိမ့်မည်။ app ကိုသင်ကြိုက်နှစ်သက်သည့်အတိုင်းခေါ်ယူသင့်သည်, အက်ပလီကေးရှင်းအသစ်များဖန်တီးလိမ့်မည်။ အက်ပလီကေးရှင်းအသစ်တစ်ခုထည့်ရန် Settings.py ကိုအမြဲတမ်းဖြည့်စွက်ပါလိမ့်မည်။ nano ကိုအသုံးပြုခြင်း,

nano app/settings.py

ချိန်ညှိချက်များတွင် installed_apps များကိုရှာပြီး [] ကို 3 ခုထဲသို့ခွဲခြားပါ။ အချည်းနှီးသောစင်တာလိုင်းတွင်ကွက်လပ်လေးခုကိုအသုံးပြုခြင်း, 'Feed' သို့မဟုတ်သင်၏အက်ပ်၏အမည်ကိုထည့်ပါ။ Settings.py ၏ဤအပိုင်းကိုကြည့်သင့်သည် -

INSTALLED_APPS = [
    'feed',
]

ငါတို့မမေ့ခင်ခင်ခင်မတိုင်ခင် Django အလုပ်လုပ်နေတယ်ဆိုတာကိုစမ်းကြည့်ရအောင်။ Command Python Manage.py Runserver 0.0.0.0:8000 ကို အသုံးပြု. Code ကို အသုံးပြု. Code ကိုဖွင့ ်. ကွန်ပျူတာပေါ်တွင် 0 က်ဘ်ဆိုက်ဘရောက်ဇာကို http: server ကို Control C ကိုကြည့်ပါ။

ယခု Python Code အချို့ရေးသားခြင်းသို့တူးကြပါစို့။ Django တွင်အဓိကအစိတ်အပိုင်းသုံးခုရှိပြီး၎င်းတို့အားလုံးသည် code ဖြင့်ဖွင့်သည်။ အစိတ်အပိုင်းများကို Model, View and Template ဟုခေါ်သည်။ ဝက်ဘ်ဆိုက်သည်အသုံးပြုသူထံသို့မပို့မီတစ်ခုချင်းစီသည်ပိုမိုမြင့်မား။ နိမ့်ကျသောအဆင့်တွင်ရှိသည်။

စံပြသည်ပြန်လည်ရယူခြင်း, ခွဲထုတ်ခြင်းနှင့်ပြန်ဆိုခြင်းအတွက်ဒေတာဘေ့စ်တွင်အချက်အလက်များကိုသိုလှောင်ထားသောကုဒ်ဖြစ်သည်။

ထိုအမြင်သည်မော်ဒယ်ကိုမည်သို့ပြန်ဆိုခြင်း,

Template သည် HTML code ဖြစ်ပြီး Template Language ဟုခေါ်သောအပိုခေါင်းလောင်းများနှင့်တီးတိုးအချို့ပါသော HTML code ဖြစ်သည်။ Template ကို Python Code နှင့်သတင်းအချက်အလက် (USUALS ကြိုးနှင့်ကိန်းဂဏန်းများ) နှင့်ပြည့်စုံသောရှုထောင့်နှင့်ဆက်စပ်သောအခြေအနေနှင့်ပြည့်နေသောရှုထောင့်ဖြင့်ဖြည့်ထားသည်။

Django တွင်အခြားအစိတ်အပိုင်းများလည်းပါ 0 င်သည်။

Settings, ကျွန်ုပ်တို့ဆွေးနွေးခဲ့သည့်အတိုင်း app ကို configures-configries ။

အသုံးပြုသူသည် 0 က်ဘ်အက်ပလီကေးရှင်း၏သီးခြားအစိတ်အပိုင်းများကိုရရှိရန်အောက်ပါပုံစံများဖြစ်သော URLs များ။

ဆာဗာသို့ပို့လွှတ်သည့်သတင်းအချက်အလက်များကိုသတ်မှတ်ပြီးဒေတာဘေ့စ်သို့နှင့်ဒေတာဘေ့စ်သို့ပေးပို့သောပုံစံများကိုသတ်မှတ်သည်။ ဤရွေ့ကားဆာဗာဘက်မှသတင်းအချက်အလက်များကိုထုတ်ယူခြင်း၏အခြေခံအုတ်မြစ်ဖြစ်သည်။ ကွန်ပျူတာစတိုးဆိုင်များ, အထူးသဖြင့်စာသား strings များ, နံပါတ်များနှင့်စစ်မှန်တဲ့ / မှားယွင်းသော booleans (များသောအားဖြင့် checkboxes)

HTML code နှင့် template language နှင့် Python နှင့် HTML တို့အကြားကွာဟချက်ဖြစ်သော Python နှင့် HTML တို့အကြားကွာဟချက်ဖြစ်သော Templates သည် Python နှင့် HTML တို့အကြားကွာဟချက်များအဖြစ် python အချက်အလက်များနှင့် 0 က်ဘ်ဆိုက်တစ်ခုသို့ 0 င်ရောက်နိုင်ရန်အတွက် 0 က်ဘ်ဆိုက်တစ်ခုသို့ 0 င်ရောက်နိုင်သည့် HTML code များအဖြစ်သတ်မှတ်နိုင်သည်။

များသောအားဖြင့် patic files များသည်ဆာဗာ 0 င်ရောက်သောစာကြည့်တိုက်များနှင့် template နှင့်ချိတ်ဆက်ထားသည့်စာကြည့်တိုက်များဖြစ်သည်။

ဆာဗာသည်ပြင်ပတွင်တည်မြဲသောသို့မဟုတ်ပြင်ပတွင်တည်မြဲသောမီဒီယာဖိုင်များသို့မဟုတ်ဆာဗာသို့အခြားဆာဗာ (ရေပုံးတစ်ပုံး) သို့တင်ခြင်းမပြုမီရေးသားထားသောသို့မဟုတ်ဆာဗာသို့စာဖြင့်ရေးသားခဲ့သည်။

အမြင်တိုင်းနှင့်တစ်ချိန်တည်းတွင်လည်ပတ်ပြီး "ပါ 0 င်သော" ဟုယူဆရသောအချိန်တိုင်းကုဒ်အပိုင်းအစများဖြစ်သည်။

အကြောင်းအရာတစ်ခုစီ၏အခြေအနေကိုလုပ်ဆောင်ရန်နှင့်အပိုအခြေအနေကိုထည့်ရန်အသုံးပြုသည်။

အသုံးပြုသူ (သို့) တောင်းဆိုမှုသည်အမြင်ကိုမပြန်မီလိုအပ်သောလိုအပ်ချက်များကိုအတည်ပြုသည်။

ဆက်သွယ်ရေးကိုမည်သည့် websceskets ကိုကိုင်တွယ်ဖြေရှင်းသည်ကိုဆိုလိုသည်။

admin ကိုမော်ဒယ်များကိုမှတ်ပုံတင်ရန်အသုံးပြုသောကြောင့် Django admin စာမျက်နှာအတွင်း၌အသေးစိတ်ကိုအသေးစိတ်ဖော်ပြနိုင်ပြီးဒေတာဘေ့စ်ကိုဂရပ်ဖစ် interface တွင်စီမံနိုင်သည်။

Django ကုဒ်၏ပြတ်တောင်းပြတ်တောင်းသောအလုပ်များကိုသတ်မှတ်သည့်ဆလစ်စသည် Django Code ၏အစိတ်အပိုင်းများကို သတ်မှတ်. နောက်လာမည့်အလုပ်သို့မဟုတ်ကုဒ်နံပါတ်သို့မသွားမီစတင်လည်ပတ်နိုင်သည်။

Django တွင်အခြားအစိတ်အပိုင်းများစွာရှိနိုင်သည်။ Django ကိုပိုမိုအလုပ်လုပ်ရန်အတွက်နည်းလမ်းများစွာရှိပြီး Code အများစုကိုအကောင်အထည်ဖော်ရန်အတွက်အထူးသဖြင့် Django အားအကောင်အထည်ဖော်ရန်အတွက်အခြားဆော့ဖ်ဝဲများကိုတိုးချဲ့ရန်အခြားဆော့ဖ်ဝဲများနှင့်အခြားဆော့ဖ်ဝဲများကိုတိုးချဲ့ရန်အတွက်နည်းလမ်းများစွာရှိသည်။ View functions များသည်အဓိကသော့ချက်ဖြစ်သောကြောင့်၎င်းတို့သည်သော့ချက်ဖြစ်သည်။

ပထမ ဦး စွာကြည့်ရှုခြင်းလုပ်ဆောင်ချက်များကိုလေ့လာကြည့်ရအောင်။ View Functions များသည်တင်သွင်းမှုကုဒ်နံပါတ်များဖြင့်စတင်ခြင်းဖြင့်အကြည့်အရှု၌အသုံးပြုသောကုဒ်နံပါတ်များကိုစတင်ပြီးပုံမှန်လုပ်ဆောင်ချက်များသို့မဟုတ်အတန်းများကို အသုံးပြု. သတ်မှတ်သည်။ အရိုးရှင်းဆုံးအမြင်များကို function def de de de de de de de de de de de de de de de de de de de de de de def မှသတ်မှတ်သည်။ "Hello World" ကိုပြန်ပို့ရန်အခြေခံအမြင်ကိုသတ်မှတ်ခြင်းဖြင့်စတင်ကြပါစို့။ Def ကဲ့သို့သောကြေညာချက်အပြီးတွင်သင်၏ function တစ်ခုစီအတွက်သင်လျှောက်ထားလိုသည့်အောက်ဖော်ပြပါအဓိပ္ပာယ်ဖွင့်ဆိုချက်တစ်ခုစီအတွက်နေရာ 4 ခုကိုထည့်သွင်းရန်လိုအပ်လိမ့်မည်ဟုမှတ်ထားပါ။ ဒီဟာကဒီဟာကိုမကြာခင်မှာပဲရရှိနိုင်ပါတယ်။

ကျွန်ုပ်တို့၏ site ၏ directory မှ feed / views.py ဖိုင်ကို nano ကို သုံး. ဖိုင်၏အဆုံးသို့အောက်ပါလိုင်းများကိုထည့်ပါ။

from django.http import HttpResponse

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

Django ၏ Httportons သည်စာသား string ကိုအဖွင့်အပိတ်နှင့်ပိတ်ခြင်းဖြင့်ဖော်ပြသည်။ သင်သတင်းအချက်အလက်များကို function တစ်ခု (သို့) စာသင်ခန်းတစ်ခုသို့ပို့သည့်အခါတိုင်းတောင်းဆိုမှုသို့မဟုတ် string တစ်ခုကဲ့သို့ပင်ကွင်း (အဖွင့်အဖွင့်ခြင်းနှင့်ပိတ်ခြင်း) ကိုသုံးရန်လိုအပ်လိမ့်မည်။

ဒါကငါတို့အမြင်ကိုကြည့်ဖို့မလိုအပ်ပါဘူး။ ဟုတ်ပါတယ်, အမြင်အတိအကျရှိသည့်ဆာဗာကိုကျွန်ုပ်တို့မပြောခဲ့ပါ, ကျွန်ုပ်တို့မြင်ကွင်းကိုပြန်လည်ပေးပို့သင့်သည့်လမ်းကြောင်းတစ်ခုကိုသတ်မှတ်ရန်လိုအပ်သည်။ အက်ပလီကေးရှင်း / URLS.py တွင်အခြေခံလမ်းကြောင်းကိုသတ်မှတ်ခြင်းဖြင့်စတင်ကြပါစို့။

App / URLS.py.py.py.py, ငါတို့ဖန်တီးထားတဲ့မြင်ကွင်းကိုအစပြုပြီးအစအ ဦး အပြီးတင်သွင်းပြီးနောက်သွင်းကုန်ထုတ်ပြန်ချက်များပြီးနောက်လိုင်းထည့်ပါ။

from feed import views as feed_views

ယခုကြည့်ရှုရန်ပုံစံကိုသတ်မှတ်ကြပါစို့။ View ပုံစံများတွင်အစိတ်အပိုင်းသုံးခုပါ 0 င်သည့်လမ်းကြောင်းအစိတ်အပိုင်းသုံးခုရှိသည်။ ဤနည်းအတိုင်းပြုလုပ်ရန်နှင့်ပြောင်းလွယ်ပြင်လွယ်ဖြစ်ရန်နှင့်ပြောင်းလွယ်ပြင်လွယ်ရှိရန်အဓိပ္ပာယ်ရှိသည်။ ဤတွင်သင်၏အမြင်သည်မည်သို့ပုံစံမျိုးဖြစ်လိမ့်မည်, ဤအရာကို urlpatens = [app / urls.py မှဤထည့်နိုင်သည်။ View ပုံစံကိုအထက်တွင်ဖော်ပြထားသောအစိတ်အပိုင်းသုံးခုနှင့်လမ်းကြောင်းဟုခေါ်သောလုပ်ဆောင်ချက်ဖြစ်သည်။ သင်၏ URL ပုံစံများသည်စာရင်းတစ်ခုဖြစ်သောစာရင်းတစ်ခုဖြစ်သည်။ item တစ်ခုချင်းစီကို Settings.py ရှိအက်ပလီကေးရှင်းကဲ့သို့၎င်းနှင့်အတူလေးထောင့်ကွက်နှင့်အတူတစ်ဖန်လိုင်းအသစ်တစ်ခုကိုတစ်ဖန်သွားသင့်သည်။ ဝက်ဘ်ဆာဗာ၏ root directory တွင် run သောအမြင်တစ်ခုကိုဖန်တီးရန်ကျွန်ုပ်တို့သည်ပထမအစိတ်အပိုင်းကိုအချည်းနှီးသော string function တစ်ခုဖြင့်ဖော်ပြရန်ဖြစ်သည်။ သင်၏ URLS.py ယခုဤသို့ဖြစ်သင့်သည်။

from feed import views as feed_views

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

၎င်းသည် Django နှင့် 0 က်ဘ်ဆိုက်တစ်ခုဖန်တီးရန်ဖြစ်သည်။ ပိုမိုပြောင်းလဲနေသော 0 က်ဘ်ဆိုက်တစ်ခုပြုလုပ်နိုင်ရန်အတွက်ရုပ်ပုံများ, ဗွီဒီယိုများ, အသံများနှင့်အခြားအရာများကဲ့သို့ကျွန်ုပ်တို့စတင် cache ကိုစကူသီးကိုစတင်နိုင်ရန်အတွက်ကျွန်ုပ်တို့သည်နောက်ထပ်စူးစမ်းလေ့လာမည့်မော်ဒယ်များကိုအသုံးပြုရန်လိုအပ်သည်။ ယခုအချိန်တွင်ကျွန်ုပ်တို့၏ကုဒ်ကိုစစ်ဆေးပြီးဆာဗာကိုဖွင့်ကြပါစို့။ အမှားအယွင်းများအတွက်ကုဒ်ကိုစစ်ဆေးရန်, run:

python manage.py check

အမှားမက်ဆေ့ခ်ျများရှိပါကသင်၏အက်ပလီကေးရှင်းသို့သင်လုပ်သောအပြောင်းအလဲများကိုဂရုတစိုက်ပြန်လည်သုံးသပ်သင့်သည်။ အပိုပစ္စည်း, အမှားမက်ဆေ့ခ်ျကိုဖတ်ရှုခြင်း (သင့်တွင်ရှိလျှင်) သင်ဖန်တီးထားသောဖိုင်တစ်ခုသို့သင်ဖန်တီးထားသောသို့မဟုတ်လိုင်းနံပါတ်တစ်ခုနှင့်အတူတည်းဖြတ်သည်သို့မဟုတ်လိုင်းနံပါတ်နှင့်အတူတည်းဖြတ်ခြင်းကိုကြည့်ရှုခြင်း, အကယ်. သင်သည်ထိုပြ issue နာကိုသင်သတ်မှတ်ခဲ့ပါကအထက်ပါ command ကိုထပ်မံဖွင့်ပါ။ သင်၏ဆော့ (ဖ်) ဝဲသည်အလုပ်လုပ်ရန်အဆင်သင့်ဖြစ်နေချိန်တွင် output ကိုပြ issues နာမရှိပါ " အခုသင်သွားဖို့အဆင်သင့်ပဲ။ ဆာဗာကိုသုံးပါ

python manage.py runserver 0.0.0.0:8000

ယခုဝက်ဘ်ဘရောက်ဇာကိုဖွင့်ပြီး HTTP: // localhost: 8000 ။ စာသားကိုကွင်းအတွင်းသို့ပြန်ပို့လိုက်သောစာသားကိုသင်၏မြင်ကွင်းတွင် HTTPResPonse function ၏ကိုးကားချက်များကိုပြန်ပို့သည်ကိုသင်တွေ့သင့်သည်။ ၎င်းသည်အခြေခံဥပမာတစ်ခုမျှသာဖြစ်သော်လည်းယခုအချိန်အထိ၎င်းကိုသင်ပြုလုပ်ခဲ့လျှင်, ဤဝေးလံခေါင်ဖျားသည်။ အချို့ဒေတာဘေ့စ်၏ပုံစံမျိုးကိုတူးဖော်ကြည့်ကြပါစို့။ သတင်းအချက်အလက်သိုလှောင်ရာတွင် Python အတန်းအစား၏စွမ်းအားကိုစူးစမ်းကြပါစို့။ ထို့နောက်ကျွန်ုပ်တို့သည်ကျွန်ုပ်တို့၏ site ကိုအပြည့်အဝ flexiript နှင့်စက်ခြင်းကိုအသုံးပြုခြင်းကိုအပြည့်အဝပြောင်းလွယ်ပြင်လွယ်။ လုံခြုံမှုကိုမပြုလုပ်မီ HTML နှင့် CSS ကိုချုပ်ကိုင်ထားလိမ့်မည်။

အတန်းများကိုသင်၏အက်ပလီကေးရှင်း၏ပုံစံများတွင်သိမ်းဆည်းထားသည်။ nano ကိုအသုံးပြုခြင်း, app / models များကိုတည်းဖြတ်ပါ။ အတန်းကိုအတန်းအစားအဓိပ္ပာယ်ဖွင့်ဆိုချက်နှင့်အဓိပ္ပါယ်ဖွင့်ဆိုပြီးဤကိစ္စတွင်မော်ဒယ်လ်များ၌၎င်းမှအမွေဆက်ခံသော superclass ကိုဖြတ်သန်းသွားသည်။ အတန်းအစားအဓိပ္ပါယ်ဖွင့်ဆိုချက်အပြီးအတန်းအစားအဓိပ္ပာယ်ဖွင့်ဆိုချက်အပြီးအတန်းအစား၏အမည်လာသည်။ အတန်းအစားနှင့်ဆက်စပ်သော attribute များနှင့် function အဓိပ္ပာယ်ဖွင့်ဆိုခြင်းမပြုမီ, ကျွန်ုပ်တို့၏အတန်းသည်၎င်းကိုပြန်လည်ရယူရန်နှင့်၎င်းကိုထူးခြားစေရန်နှင့်၎င်းကိုထူးခြားစွာသိမ်းဆည်းရန်ကျွန်ုပ်တို့အသုံးပြုနိုင်သည်။ ၎င်းသည်အချို့သောအချက်အလက်များကိုသိမ်းဆည်းရန်စာသားအကွက်တစ်ခုလိုအပ်သည်။ နောက်ပိုင်းတွင်ကျွန်ုပ်တို့သည် timestamp, files, booleans (မှန်ကန်သောသို့မဟုတ်မှားယွင်းသောအဓိပ္ပါယ်ဖွင့်ဆိုချက်များ) ကိုထည့်သွင်းနိုင်သည်။ အောက်ပါကုဒ်ကိုဖြည်ကြပါစို့။

from django.db import models # ကျွန်ုပ်တို့၏အတန်းကိုသတ်မှတ်ရန်အသုံးပြုသောသွင်းကုန်ကိုနှင့်၎င်းသည် attribute များဖြစ်သည်
class Post(models.Model): # ကျွန်တော်တို့ရဲ့အတန်းကိုယ်နှိုက်၏အဓိပ္ပါယ်
    id = models.AutoField(primary_key=True) # ကျွန်ုပ်တို့၏မော်ဒယ်ကိုအလိုအလျောက်ထုတ်လွှတ်သောသော့ချက်တစ်ခုမှာကျွန်ုပ်တို့အားမော်ဒယ်ကိုရှာဖွေရန်အလိုအလျောက်ထုတ်ပေးသောသော့ချက်တစ်ခုဖြစ်ပြီး၎င်းကိုဖန်တီးနိုင်ပြီး၎င်းကိုဖန်တီးပြီးသည့်အခါစံနမူနာနှင့်အပြန်အလှန်ဆက်သွယ်ရန်လိုအပ်သည့်အခါအသုံးဝင်သည်။
    text = models.TextField(default='') # ကျွန်ုပ်တို့၏အတန်းစတိုးဆိုင်များ, ဤကိစ္စတွင်, ဤကိစ္စတွင်အချို့သောစာသား, အချည်းနှီးသော string ကိုမှ defaulting ။

ဖိုင်ကိုအနီးကပ်ပြီးစီးပါကမပြီးစီးအောင်လုပ်ပါ။

ဤအတန်းကိုကျွန်ုပ်တို့၏ app ကိုပြောင်းလဲစေသည့်အခါအခြားကွင်းဆင်းများနှင့်ရွေးချယ်စရာများစွာရှိပါသည်။ ဤအတန်းကိုကျွန်ုပ်တို့၏ app တဖြည်းဖြည်းပြောင်းလဲလာသည်နှင့်အမျှဤအရာသည်စာသားအချို့ကိုတင်ရန်အက်ပလီကေးရှင်းတစ်ခုဖန်တီးခြင်း၏အခြေခံလိုအပ်ချက်များဖြစ်သည်။ သို့သော်ဤပုံစံသည်တစ်ယောက်တည်းအလုပ်လုပ်မည်မဟုတ်ပါ။ အရင်ကဖော်ပြထားသည့်အတိုင်းကျွန်ုပ်တို့သည်ဤစံပြလုပ်ငန်းကိုပြုလုပ်ရန်စိတ်ကြိုက်မြင်ကွင်းနှင့် url ပုံစံတစ်ခုလိုအပ်လိမ့်မည်။ ပထမ ဦး ဆုံးပုံစံကိုစူးစမ်းကြပါစို့။

ပုံစံတစ်ခုကိုသတ်မှတ်ရန်အက်ပလီကေးရှင်း / forms.py ကို Edich ကို Nano နှင့် Edit လုပ်ရန်နှင့်အောက်ပါလိုင်းများကိုထည့်ပါ။ တင်သွင်းမှုနှစ်ခု, ကျွန်ုပ်တို့၏ပုံစံများအတန်းအစားနှင့်ပုံစံများကိုလိုအပ်လိမ့်မည် (feeds.models.post), မော်ဒယ်နှင့်ဆင်တူသည့်အတန်းအစားအဓိပ္ပါယ်နှင့်ကွင်းဆက်တစ်ခုနှင့်အတူတစ် ဦး နှင့်အတူတစ် ဦး နှင့်အတူတစ် ဦး နှင့်အတူတစ် ဦး နှင့်အတူတစ် ဦး နှင့်အတူတစ် ဦး နှင့်အတူလယ်ကွင်း၏ subclass နှင့်အတူ။ ပုံစံတွင်တောင်းဆိုမှု, မော်ဒယ် (သို့) မဟုတ်ရင်သတင်းအချက်အလက်များကို အခြေခံ. ၎င်းကိုဖွင့်ထားသည့် Initialization function လည်းရှိနိုင်သည်။

မော်ဒယ်ပုံစံများသည်အလွန်အသုံး 0 င်သည်, အောက်မှာဖော်ပြထားတဲ့ပုံစံများကိုသတ်မှတ်ကြပါစို့။

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',)

ဤသည်ပုံစံနှင့်မော်ဒယ်တူသောအရာ၏အခြေခံ၏အခြေခံဖြစ်ပါတယ်။ ဤစံပြပုံစံကို post ကို intutate သို့မဟုတ်တည်းဖြတ်ခြင်း, ၎င်းတွင်ပါရှိသောစာသားကိုပြောင်းလဲခြင်းနှင့်တည်းဖြတ်ရန်အသုံးပြုနိုင်သည်။ ဒီပုံစံကိုနောက်တစ်ခုကိုကြည့်ပြီးကြည့်ရှုမယ်။ ပထမ ဦး စွာပြောင်းရွှေ့မှုကိုပြုလုပ်ပြီးဒေတာဘေ့စ်ကိုရွှေ့ပြောင်းယူကြပါစို့။ ဒီလိုလုပ်ဖို့အောက်ပါ command တွေကို run ပါ။

python manage.py makemigrations
python manage.py migrate

၎င်းသည်တစ်မိနစ်ခန့်ကြာလိမ့်မည်, သို့သော်၎င်းသည်ပြုလုပ်သည်နှင့်တပြိုင်နက်, ၎င်းသည်သင့်အားအမြင်များ, အသံ, ကျွန်ုပ်တို့၏မော်ဒယ်ကိုကျွန်ုပ်တို့မြင်နိုင်သည့်နေရာတစ်ခုပြုလုပ်ခြင်းဖြင့်ဆက်သွားကြပါစို့။ Feed / Views.py.py ကို Edited နှင့် NEDED အဖြစ်အောက်ပါကုဒ်ကိုထည့်ပါ။ # နိမိတ်လက်ခဏာကိုသင်ထည့်ရန်မလိုအပ်ပါ။ ထိုကုဒ်သည်ကုဒ်နှင့်ပတ်သက်သောသတင်းအချက်အလက်များကိုဖော်ပြရန်အသုံးပြုသောမှတ်ချက်များဖြစ်သည်။ ကျွန်ုပ်တို့၏မော်ဒယ်တွင်ကျွန်ုပ်တို့၏မော်ဒယ်ကိုအမြင်များတွင်တင်သွင်းခြင်းဖြင့်စတင်ပါလိမ့်မည်။ ၎င်းကို display အတွက်စာရင်းတစ်ခုအနေဖြင့်၎င်း template တစ်ခုတွင်ထည့်သွင်းနိုင်သည့်အခြေအနေတွင်ထည့်သွင်းပါလိမ့်မည်။ ထို့နောက်ကျွန်ုပ်တို့သည်မော်ဒယ်အပေါ် အခြေခံ. အရာဝတ်ထုအသစ်တစ်ခုကိုဖန်တီးရန်နှင့်ဆာဗာကိုတင်ရန်ပုံစံနှင့်ပုံစံကိုခလုတ်တစ်ခုဖြင့်ဖြည့်ဆည်းပေးနိုင်သည့် template ကိုထည့်သွင်းနိုင်သည်။ ဒီဟာကရှုပ်ထွေးတယ်, ဒါကြောင့်တစ်ဆင့်ပြီးအောင်လုပ်ကြည့်ရအောင်။ အမြင်ကိုမပြီးမီမော်ဒယ်လ်ကိုပြန်ဆိုရုံသာမကဘဲအခွံ၌တင်ထားသောပို့စ်အသစ်တစ်ခုဖန်တီးရန်ကျွန်ုပ်တို့မြင်တွေ့နိုင်ကြောင်းသေချာစေရန် template တစ်ခုကိုဖန်တီးကြပါစို့။ ဒီအမြင်ဘယ်လိုကြည့်သင့်တယ်ဆိုတာဒီမှာပါ။

    posts = Post.objects.all() # ယခုအချိန်အထိဒေတာဘေ့စ်ရှိပို့စ်များအားလုံးကိုမေးမြန်းပါ

ဤအရာအားလုံးသည်အောက်ခြေသို့ရောက်သည်အထိတော်တော်လေးရိုးရှင်းပါသည်။ Render, HTTP တုံ့ပြန်မှုအစား http response တွင်ထည့်ထားသော function မှပြန်လာသောတန်ဖိုးသည်၎င်း၏ပထမဆုံးထည့်သွင်းမှုအဖြစ်အမြဲတမ်းတောင်းဆိုမှုကိုလက်ခံသည်, Template သည် Pyja2 ဟုခေါ်သော Jinja2 ဟုခေါ်သော Jinja2 ဟုခေါ်သော Jinja2 ဟုခေါ်သော HTML document တစ်ခုဖြစ်လိမ့်မည်။

တင်းပလိတ်များကိုစတင်ဖန်တီးရန်, အစာကျွေးသောလမ်းညွှန်နှစ်ခုပါ။

mkdir feed/templates
mkdir feed/templates/feed

ထို့နောက်အထက်ပါလမ်းညွှန်တွင် directory ထဲတွင် template ကိုတည်းဖြတ်ပါ။ ဒီဥပမာအတွက် template ကိုကြည့်ကြစို့။

ဤသည်အလွန်ရိုးရှင်းသော template တစ်ခုဖြစ်သည်။ ၎င်းသည် HTML tags များ, docpe type tag တစ်ခု, screen tag တစ်ခုပါသည့် Legend tag တစ်ခုပါသည့် break tag တစ်ခုဖြစ်ပြီးမျက်နှာပြင်တစ်ခုစီကို ကပ်. ပို့စ်တစ်ခုစီကိုထည့်သွင်းထားသောကွင်းဆက်တစ်ခုနှင့်တစ်ခုချင်းစီကိုပို့စ်တစ်ခုစီထည့်သည့် Loop အတွက်သတ်မှတ်ထားသည်။ ဤသည်မှာစာမူများကိုဆပ်ရန်လိုအပ်သည်။ သို့သော်ဒေတာဘေ့စ်တွင်မရှိပါ။ အခွံနှင့်အတူအချို့ဖန်တီးကြပါစို့။ ကျနော်တို့ manage.py နှင့်အတူ shell ကို run နိုင်ပါတယ်

python manage.py shell

ယခုကျွန်ုပ်တို့၏ Post Model ကိုတင်သွင်းကြပါစို့

from feed.models import Post

ထို့နောက်ကျွန်ုပ်တို့သည်ရိုးရှင်းသောပို့စ်တစ်ခုကို string တစ်ခုဖြင့်ဖန်တီးပြီး shell ကိုမှထွက်ပါမည်။ string သည်သက်တမ်းရှိစာသားကိုမှန်ကန်သောစာသားအဖြစ်ဖြစ်နိုင်သည်။

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

နောက်ဆုံးအနေနဲ့ကျွန်တော်တို့ရဲ့အစာကျွေးဖို့ URL ပုံစံကိုထည့်သွင်းဖို့လိုလိမ့်မယ်။ ကျွန်ုပ်တို့၏ Feed app သည် URL များကို သုံး. ဖိုင်အရွယ်အစားများကိုသေးငယ်စေလိုသောကြောင့်ကျွန်ုပ်တို့သည်ဖိုင်အရွယ်အစားကိုသေးငယ်စေလိုသည်။ ကျွန်ုပ်တို့၏ Feed app တွင်ဒေသခံ urls.py ကိုဖန်တီးကြပါစို့။

from django.urls import path
from . import views

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

URLS.py.py.py.py.py.py ကို အခြေခံ. ကျွန်ုပ်တို့အားခေါ်ရန်ဆုံးဖြတ်ရန်ကျွန်ုပ်တို့ခေါ်ဆိုခဲ့သည့်အရာသည်ပထမဆုံးဖန်တီးထားသော directory ဖြစ်သည်။ အက်ပလီကေးရှင်း / app.py ကို Edit နှင့် URL ပုံစံများကိုထည့်ပါ

from django.urls import include # ထိပ်မှာ
    # ... ဒီမှာကုဒ်

ယခုတွင် Python Manage.py Runage.py Runserver နှင့်အတူဆာဗာကို run သောအခါ, ကျွန်ုပ်တို့တွင်စံနမူနာ, မြင်ကွင်းနှင့် template အပြင် url များနှင့်အတူဒေတာဘေ့စ်တွင်ပါ 0 င်သောကြောင့်ကျွန်ုပ်တို့ဖန်တီးထားသည်။ ထို့နောက်ကျွန်ုပ်တို့ဖန်တီးထားသောပုံစံကိုအကောင်အထည်ဖော်ကြပါစို့။ ကျွန်ုပ်တို့၏ကိုယ်ပိုင်ပို့စ်များကိုစတင်ဖန်တီးရန်။ သို့သော်ကုဒ်များလွန်းခြင်းမပြုမီ, အစောပိုင်းကကျွန်ုပ်တို့ရေးသားခဲ့သော script ကို အသုံးပြု. အရန်ကူးယူကြစို့။ ဤ script ကို shell ကိုဖွင့်ပါ, အချိန်အနည်းငယ်စောင့်ပါ, code အားလုံးကိုကျွန်ုပ်တို့၏ git repository ကိုအရန်ကူးယူလိမ့်မည်။

backup

ပုံစံကိုအကောင်အထည်ဖော်ခြင်းအတော်လေးရိုးရှင်းပါသည်။ ကျွန်ုပ်တို့၏ပုံစံကိုကျွန်ုပ်တို့တင်သွင်းမည်, View သို့ post တောင်းဆိုမှု handler ကိုထည့်ပြီးတူညီသောအမြင်သို့ပြန်မသွားမီဒေတာဘေ့စ်တွင်သိမ်းဆည်းပါမည်။ ကျွန်ုပ်တို့တင်သွင်းပြီးပါပြီ။ ကျွန်ုပ်တို့တင်သွင်းသော redirect function ကိုသုံးနိုင်သည်။ ဤအရာဝတ်ထု၏ namespace သည်အစာကျွေးသောကြောင့်၎င်းကို string 'feed: feed' ဖြင့်ဤအရာကိုကျွန်ုပ်တို့မေးမြန်းမည်ဖြစ်ပြီး,

    posts = Post.objects.all() # ယခုအချိန်အထိဒေတာဘေ့စ်ရှိပို့စ်များအားလုံးကိုမေးမြန်းပါ
    if request.method == 'POST': # post ကိုတောင်းဆိုမှုကိုကိုင်တွယ်
        form = PostForm(request.POST) # ပုံစံ၏ဥပမာတစ်ခုဖန်တီးပြီးဒေတာများကိုသိမ်းဆည်းပါ
        if form.is_valid(): # ပုံစံကိုအတည်ပြုပါ
            form.save() # အရာဝတ်ထုအသစ်ကိုသိမ်းပါ
        return redirect(reverse('feed:feed')) # တောင်းဆိုမှုတစ်ခုနှင့်အတူတူပင် url ကို redirect
        'form': PostForm(), # ပုံစံကိုအခြေအနေကိုသေချာအောင်သေချာအောင်လုပ်ပါ။

ယခုကျွန်ုပ်တို့သည်ပုံစံအသစ်အတွက်အကောင့်သို့ template ကို update လုပ်ရန်လိုအပ်လိမ့်မည်။ ကျနော်တို့ကိုအသုံးပြု။ ဒါလုပ်နိုင်ပါတယ်

HTML တွင် tag နှင့်ပုံစံကိုတင်ထားသောခလုတ်ဖြင့် HTML template တွင်ပုံစံကိုပြန်ဆိုပါ။ ကျွန်ုပ်တို့သည် CSRF တိုကင်တစ်ခုဖြစ်ပြီး Form ကိုစာမျက်နှာတစ်ခုမတင်ဘဲပုံစံသို့မပို့ဘဲပုံစံသို့တင်ခြင်းမှတားဆီးသောအမှတ်အသားတစ်ခု,

ဒီကိုဖြိုဖျက်ကြစို့။ ပုံစံစာသင်ခန်း, တိုကင်, ပုံစံသူ့ဟာသူနှင့်တင်ထားသောခလုတ်အသစ်တစ်ခုရှိသည်။ တော်တော်ရိုးရှင်းပါတယ်, ဒါပေမယ့်ငါတို့ကြည့်လိုက်ရင်ငါတို့ကပိုကောင်းအောင်လုပ်ချင်တယ်။ ဒါဟာအလုပ်ဖြစ်တယ်, ကျွန်ုပ်တို့သည်စာမူအသစ်များကိုပုံစံဖြင့်တင်နိုင်ပြီးယခုအခါဒေတာဘေ့စ်တွင်သိမ်းဆည်းထားပါသည်။ ဒီနေရာမှာသွားနေတဲ့အရာအနည်းငယ်ရှိပါတယ်။ စာရွက်စာတမ်းသည် HTML document တစ်ခုဖြစ်ကြောင်းကြေငြာရန် HTML tags များကိုကျွန်ုပ်တို့အသုံးပြုသည်။ အခြားပုံစံအတွက်အမှတ်အသားကိုပေးရန် template tag ({% ... %}}}}}}}}}}}}} {% ... %}}}}}} {% ... %}}}} {%}}}} {% ... }}} {}) ကိုပုံစံဖြင့်သုံးသည်။ ကျွန်ုပ်တို့သည်စာသားကို block tags များနှင့် template tag ကို အသုံးပြု. စာသားကိုပြန်ဆိုရန် loop တစ်ခုရှိသည်။ Block tags များသည်အလွန်အရေးကြီးသည်,

အခုငါတို့အက်ပလီကေးရှင်းကိုပိုကောင်းအောင်လုပ်ဖို့လိုတယ်, စာရွက်စာတမ်းတစ်ခုချင်းစီနှင့်သက်ဆိုင်သော CSS, Inline သို့မဟုတ်အတန်းများတွင် CSS, Inline သို့မဟုတ်အတန်းများတွင် အသုံးပြု. ပြုလုပ်နိုင်သည်။ CSS သည်အမှန်ပင်ကောင်းသည်, အကြောင်းမှာ၎င်းသည်စာမျက်နှာပေါ်ရှိအရာအားလုံးကိုမည်သို့ကြည့်သင့်သည်ကိုပြောပြသည်, ၎င်းသည်အမှန်တကယ်ကြည့်ရှုနိုင်အောင်ပြုလုပ်နိုင်သည်။ ဤသို့ပြုလုပ်နိုင်သည့်စာကြည့်တိုက်အနည်းငယ်ရှိသော်လည်းကျွန်ုပ်၏ကိုယ်ရေးကိုယ်တာသွားခြင်းသည် bootstrap ဖြစ်သည်။

Bootstrap ကို၎င်းတို့၏ 0 ဘ်ဆိုဒ်မှဒေါင်းလုပ်ဆွဲနိုင်သည်။getbootstrap.com/။ အဲဒီမှာပြီးတာနဲ့ installation docs တွေကိုဖတ်ဖို့ခလုတ်ကိုနှိပ်ပြီး CDN ​​အပိုင်းကတဆင့်ထည့်သွင်းပါ။ သင်၏ HTML Document ၏ထိပ်တွင်ခေါင်းကိုခေါ်သည့် tag တွင်ဤကုဒ်ကိုလိုအပ်လိမ့်မည်။ ဒါ့အပြင်ရှေ့ဆက်သွားကြကုန်အံ့,

Mkdir တင်းပလိတ်များနှင့်အတူတင်းပလိတ်များနှင့်အတူ directory အသစ်တစ်ခုကိုလုပ်နှင့်ထို့နောက်တင်းပလိတ် / base.html တည်းဖြတ်။

ဒီဟာကကြည့်သင့်တယ်

CSS နှင့် JavaScript, CSTSCOSS နှင့် .JS ဖိုင်များကိုကူးယူပါ။ ဘာဖြစ်လို့လဲဆိုတော့အနာဂတ်မှာကျွန်တော်တို့ရဲ့ site ကိုပိုမိုအလုပ်လုပ်တဲ့အတွက် JavaScript ကိုလိုအပ်လိမ့်မယ်။

အခု bash shell ကိုပြန်သွားကြရအောင်။ သင် virtual environment ကိုရယူရန်လိုအပ်ပါက Source Venv / Bin / Activate ကိုရိုက်ပါ။ ၎င်းသည် Python package များကိုဒေသတွင်းရှိ Python package များကို Django ကို 0 င်ရောက်နိုင်စေရန်သင်တပ်ဆင်ခွင့်ပြုလိမ့်မည်။ Django Bootstrap အတန်းမှထုတ်လုပ်သောကျွန်ုပ်တို့၏ပုံစံများကိုပေးရန်ကျွန်ုပ်တို့သည် crispy ပုံစံများဟုခေါ်သော python package ကိုသုံးပါမည်။ ကျနော်တို့အောက်ပါ command ကိုနှင့်အတူဤ download လုပ်နိုင်ပါတယ်

pip install django-crispy-forms

၎င်းကိုထည့်သွင်းပြီးသည်နှင့်၎င်းကို Settings.py သို့ထည့်ပါ

    # ... ဒီမှာကုဒ်

ယခုကျွန်ုပ်တို့၏ Feed template ကိုပြန်သွားပါ, အချို့အရာများကိုဖယ်ရှားနိုင်သည်။ မှတ်တမ်း၏အစနှင့်အဆုံးကိုဖယ်ရှားပြီး၎င်းကိုကျွန်ုပ်တို့၏အခြေစိုက်စခန်း template ကိုအမွေဆက်ဖြင့်အစားထိုးကြပါစို့။ ထို့အပြင်ကျွန်ုပ်တို့သည် load နှင့် template filter ဖြင့် template filter တင်သွင်းမှုကိုဖြည့်စွက်ပါမည်။ နောက်ဆုံးအနေနဲ့ bootstrap class ကို form ပေါ်ရှိခလုတ်ကိုထည့်ရန်ခလုတ်တစ်ခုနှင့် ပို. ကြည့်ရှုရန်ပုံစံပေါ်ရှိခလုတ်ကိုထည့်ကြစို့။ ဒါကဒီလိုမျိုးကြည့်သင့်တယ်

လှပသော! ဒါကအတော်လေးကုဒ်ပြီးသားဖြစ်ပါတယ်။ နောက်တစ်ခုကငါတို့အဲဒါကိုစမ်းသပ်သင့်တယ်, အရာရာတိုင်းဟာကောင်းမွန်တဲ့အသွင်အပြင်ကိုတွေ့နိုင်တယ်, ဆာဗာကိုယခင်ညွှန်ကြားချက်များအနေဖြင့် အသုံးပြု. site ကိုကြည့်ပြီးကောင်းမွန်စွာအလုပ်လုပ်ပါ။ ကြီးစွာသောအလုပ်! သင်အလားတူ URLs များ, views များနှင့်တင်းပလိတ်များကို အသုံးပြု. အသုံးပြုသူ login function ကိုထည့်ရန်သင်အဆင်သင့်ဖြစ်နေပြီ။ အခြေစိုက်စခန်းတင်းပလိတ်သည်အရေးကြီးသည်။ ၎င်းကိုကျွန်ုပ်တို့ဆက်လက်ပြုပြင်ရန်နှင့်လိုအပ်သလိုပြောင်းလဲမှုများပြုလုပ်သွားမည်ဖြစ်သော်လည်းယခုအချိန်တွင်သင်၏ site ကိုပိုမိုလုံခြုံအောင်ပြုလုပ်ခြင်းနှင့်သင်၏အက်ပလီကေးရှင်းကိုလုံခြုံစွာထားရှိရန်နှင့်သင်၏ကိုယ်ပိုင်အကောင့်ကိုသင်သာလက်လှမ်းမီစေရန်ကူညီပေးပါမည်။

ဒီလိုလုပ်ဖို့ Django မှာတည်ဆောက်ထားတဲ့အသုံးပြုသူပုံစံကိုသုံးဖို့လိုပါတယ်။ အသုံးပြုသူမော်ဒယ်သည်ကျွန်ုပ်တို့၏ပို့စ်ကဲ့သို့ဒေတာဘေ့စ်၏ပုံစံဖြစ်သည်။ ၎င်းသည်အသုံးပြုသူတစ် ဦး ကို 0 က်ဘ်ဆိုက်သို့ 0 င်ရောက်ရန်ပြန်ဆိုနိုင်သည်။ အနာဂတ်တွင်ကျွန်ုပ်တို့သည်ဆိုဒ်ကိုအင်တာနက်မချမီဤပုံစံကိုအခြားမော်ဒယ်များဖြင့်ချဲ့ထွင်မည်ဖြစ်ပြီး phishing ကိုခံနိုင်ရည်ရှိသည့် login အတွက်နောက်ထပ်လုံခြုံရေးအစီအမံများကိုတိုးချဲ့မည်။ Django ပေးထားသော login ပုံစံများဖြင့်တည်ဆောက်ထားသောအချို့ကို အသုံးပြု. ကျွန်ုပ်တို့စတင်မည်ဖြစ်သည်။ ပထမ ဦး စွာအခြေခံ login စာမျက်နှာအတွက်တင်းပလိတ်များနှင့်အမြင်များကိုပေးရန်ကျွန်ုပ်တို့အသုံးပြုမည့် app အသစ်တစ်ခုကိုဖန်တီးကြပါစို့။ Pincode, Facial Communication, Field Communication အနီးရှိပစ္စည်းများကိုနှင့်လက်ဗွေအသိအမှတ်ပြုခြင်းနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့် fingerprint အသိအမှတ်ပြုခြင်းနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုနှင့်လက်ဗွေအသိအမှတ်ပြုမှုအပါအ 0 င် app ကို seedited app ကိုလုံခြုံစေရန်အတွက်အခြားအက်ပလီကေးရှင်းများကိုလည်းကိုယ်စားပြုသည်။

အက်ပလီကေးရှင်းတစ်ခုစတင်ရန်ကျွန်ုပ်တို့ပြောပြီးပြီ။ ကျွန်ုပ်တို့၏လမ်းညွှန်မှ virtual environment အတွင်းရှိ manage.py ဤအငြင်းပွားမှုများကို Pass

python manage.py startapp users

ယခုတွင်ကျွန်ုပ်တို့သည်အက်ပလီကေးရှင်းအသစ်အတွက်လမ်းညွှန်တစ်ခုရှိသင့်သည်။ အသုံးပြုသူလော့ဂ်အင်နှင့်ကိုက်ညီသောလမ်းညွှန်တွင်ကြည့်ရှုခြင်းဖြင့်စတင်ကြပါစို့။ Django သည်အသုံးပြုသူ logins များအတွက်အမြင်များကိုတည်ဆောက်ခဲ့သည်။

ဤအမြင်တွင်ကျွန်ုပ်တို့သည် Post တောင်းဆိုမှုတစ်ခုအတွက်စစ်ဆေးမှုကိုစစ်ဆေးရန်အတွက်စတင်ရန်တောင်းဆိုခြင်းအားဖြင့် Django မှတင်သွင်းထားသော loginform တစ်ခုသို့စတင်ပါ။ အသုံးပြုသူအကောင့်ကို authenticate လုပ်ပါ။

အသုံးပြုသူများ / Views.py တွင်, အောက်ပါကုဒ်ကိုထည့်ပါ

        username = request.POST['username'] # post တောင်းဆိုမှုမှအသုံးပြုသူအမည်နှင့်စကားဝှက်ကိုရယူပါ
        password = request.POST['password'] # အသုံးပြုသူကို authenticate

ဤသည်သင်အခြေခံ login မြင်ကွင်းတစ်ခုအတွက်သင်လိုအပ်သမျှသည်။ ယခုအခါအခြေစိုက်စခန်း template ကိုတိုးချဲ့ခြင်းအားဖြင့်အမြင်အတွက်ပုံစံတစ်ခုဖန်တီးကြပါစို့။ အသုံးပြုသူများဖိုလ်ဒါရှိတင်းပလိတ်များအတွက်လမ်းညွှန်အသစ်တစ်ခုကိုဖန်တီးခြင်းဖြင့်ကျွန်ုပ်တို့စတင်ပါမည်။

mkdir users/templates
mkdir users/templates/users

ယခုတွင်ကျွန်ုပ်တို့သည်အသုံးပြုသူများ / တင်းပလိတ်များ / အသုံးပြုသူများ / login.html ကိုတည်းဖြတ်နိုင်သင့်သည်။ ငါတို့ကရောက်နေတုန်းကအသုံးပြုသူကို 0 င်ရောက်အောင်လုပ်ဖို့ template တစ်ခုကိုဖန်တီးလိမ့်မယ်။

nano users/templates/users/login.html

ယခု template တွင်,

ဤသည် login template ၏အခြေခံဖြစ်ပါတယ်။ ဒါဟာတကယ်ကိုဖွဲ့စည်းပုံမှာကတခြား template ကိုလိုပဲ, ဒါပေမယ့်အဲဒါကိုပြန်ဆိုတဲ့အခါနည်းနည်းကွဲပြားခြားနားတယ်။ ကျွန်ုပ်တို့သည်ဤကုဒ်ကို Register.html ဟုခေါ်သောနောက်ထပ်အလွန်အလားတူ template ကိုတည်ဆောက်ရန်ကျွန်ုပ်တို့သည်ဤကုဒ်ကိုကူးယူနိုင်ပါသည်။ template ကိုအရင်လုပ်ကြည့်ရအောင်။ အသုံးပြုသူများ / တင်းပလိတ်များ / အသုံးပြုသူများ / register.html ကိုတည်းဖြတ်ပြီးအောက်ပါကုဒ်ကိုထည့်ပါ။

ယခုတွင်ကျွန်ုပ်တို့၏အသုံးပြုသူမှတ်ပုံတင်ခြင်းအတွက်ပုံစံတစ်ခုတည်ဆောက်ရန်နှင့်ကျွန်ုပ်တို့၏သုံးစွဲသူ login များကိုမော်ဒယ်ဖြင့်မမြှင့်မီရှုထောင့်များကိုပြန်ဖွင့်ကြပါစို့။ ဤပုံစံကိုအခြေခံအားဖြင့်စတင်ရန်အခြေခံအားဖြင့်စတင်မည်ဖြစ်သော်လည်းအနာဂတ်တွင်သဘောတူညီချက်များနှင့် CAPTCHA ကဲ့သို့သောအသေးစိတ်အချက်အလက်များနှင့်လုံခြုံရေးအင်္ဂါရပ်များကိုထည့်သွင်းပါလိမ့်မည်။ ပုံစံများကို nano အသုံးပြုသူများ / forms.py နှင့်တည်းဖြတ်ပါ။ အောက်ပါကုဒ်ကိုထည့်ပါ။

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']

ဒါကြောင့်ငါတို့ဒီမှာနောက်ထပ်ပုံစံတစ်ခုရှိတယ်။ အသုံးပြုသူအမည်, အီးမေးလ်နှင့်စကားဝှက်နှင့်စကားဝှက်ကိုအတည်ပြုထားသောစကားဝှက်နေရာတစ်ခုပါ 0 င်သောအသုံးပြုသူမှတ်ပုံတင်ပုံစံဖြစ်သည်။ ဤပုံစံသည်ပုံမှန်ပုံစံများကိုမတိုးနိုင်ကြောင်းသတိပြုပါ။ ၎င်းသည် META ရှိသည်ဟုဆိုလိုသည်။ ကွက်လပ်တစ်ခုမှာအတူတူပင်ဖြစ်သည်။ အတန်းအစား Meta သည်ပုံစံကိုပုံစံဖြင့်ရေးထားသည့်အချက်အလက်များနှင့်ကိုက်ညီသည့်ပုံစံကိုသတ်မှတ်သည်။ ဤအရာသည်အများစုမှာ Django ၏ usercreationform တွင်တည်ဆောက်ထားသည့် Django ၏ built တွင်တည်ဆောက်ထားပြီး,

ထို့နောက်ကျွန်ုပ်တို့တွင်ပုံစံနှင့်တင်းပလိတ်တစ်ခုရှိသည်ဟူသောအသုံးပြုသူကိုမှတ်ပုံတင်ရန်ကျွန်ုပ်တို့မြင်ကွင်းကိုလေ့လာပါမည်။ ၎င်းသည် post view အသစ်တွင်တစ်ခုကဲ့သို့မော်ဒယ်လ်တစ်ခုဖြစ်သည်။ အသုံးပြုသူများ / views.py.py ကိုတည်းဖြတ်ပါ။ အောက်ပါကုဒ်ကိုထည့်ပါ။

# ... သွင်းကုန်

အသုံးပြုသူတစ် ဦး ကိုမှတ်ပုံတင်ထားရန်ကျွန်ုပ်တို့လိုအပ်သမျှမှာအချက်အလက်များရရန်လိုအပ်သည်။ အသုံးပြုသူမှတ်ပုံတင်သည့်အချိန်ကိုကျွန်ုပ်တို့သိလိုပါက၎င်းတို့သည်မည်သည့်အချိန်၌သူတို့နှင့်ပတ်သက်သောအချိန်, အချိန်အတန်ငယ်, Timezone စသည်ဖြင့်ကျွန်ုပ်တို့နှင့်ပတ်သက်သောအချက်အလက်များ, သုံးစွဲသူမော်ဒယ်လ်အတွက် attribute posts များအတွက်အကောင့်သို့ထည့်သွင်းရန်လိုအပ်သည်။ ထိုသို့ပြုလုပ်ရန်ကျွန်ုပ်တို့သည်မော်ဒယ်လ်များကို app နှစ်ခုလုံးတွင်မွမ်းမံပါမည်။ Feed Model ကိုတည်းဖြတ်ခြင်းဖြင့်စတင်ကြပါစို့။ အခုဒီဟာကကြည့်သင့်တယ်။

from django.db import models # ... သွင်းကုန်
    author = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True, related_name='posts') # ဒီလိုင်းထဲမှာထည့်ပါ

ဖိုင်တွင်ထည့်သွင်းခဲ့သည့်ဒုတိယလိုင်းကိုဂရုပြုပါ။ ဤသည်မှာ post တစ်ခုချင်းစီကို post တစ်ခုချင်းစီကိုအသုံးပြုသူတစ် ဦး အားအသုံးပြုသူတစ် ဦး အားအသုံးပြုသူတစ် ဦး အားအသုံးပြုသူတစ် ဦး အား post တစ်ခုအဖြစ်သတ်မှတ်လိမ့်မည် ကျွန်ုပ်တို့သည်ဤနိုင်ငံခြားသော့ကိုအတန်းအစားနှင့်အတူသတ်မှတ်သည်, အသုံးပြုသူများကိုအသုံးပြုသူများကိုဖယ်ရှားနိုင်ရန်အတွက်ကျွန်ုပ်တို့အသုံးပြုသောရေးသားချက်များကိုကျွန်ုပ်တို့ဖယ်ရှားပေးရန်အတွက်အသုံးပြုရန်နှင့်မည်သည့်ပို့စ်များကိုမဆိုပယ်ဖျက်နိုင်ရန်နှင့်သက်ဆိုင်သောအငြင်းပွားမှုများကိုသေချာစေရန်နှင့်အသုံးပြုသူဖန်တီးမှုကိုရည်ညွှန်းရန်သေချာစေရန်နှင့်ဆက်စပ်သောအမည်နှင့်သက်ဆိုင်သည်။ ဤသက်ဆိုင်ရာအမည်, post.author နှင့်မတူဘဲပို့စ်၏ရေးသားသူသည်အသုံးပြုသူကိုသူ့ဟာသူတင်ခဲ့သည်။ Posts.Posts.Alls.Alls.All (), Orlor.posts.All) ကိုဖွင့်ထားသည့်အသုံးပြုသူတစ် ဦး ကိုယခုကျွန်ုပ်တို့ရယူနိုင်ပါပြီ။

အခုငါတို့ရဲ့ login တွေကိုပိုပြီးခံနိုင်ရည်ရှိအောင်လုပ်ကြရအောင်။ ကျွန်ုပ်တို့၏ဆိုဒ်ကို phishing လုပ်ရန်ကျွန်ုပ်တို့၏ 0 က်ဘ်ဆိုက်ကိုဖိအားပေးနိုင်ပြီး 0 င်ငွေကို 0 င်ရန်ခွင့်ပြုသည့်အချိန်ကိုကန့်သတ်ထားသည့်အကြိမ်အရေအတွက်ကိုသာလျှော့ချနိုင်သည်။ ကျွန်ုပ်တို့၏အက်ပလီကေးရှင်းကိုဆက်လက်ရှင်သန်နေစဉ်အသုံးပြုသူတစ် ဦး ချင်းစီနှင့်ပတ်သက်သောအချက်အလက်အချို့ကိုစတိုးဆိုင်များစတင်ကြပါစို့။ အသုံးပြုသူများ / models.py ကိုတည်းဖြတ်ခြင်း, အောက်ပါကုဒ်ကိုထည့်ပါ။

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='')

ဒီမော်ဒယ် post မော်ဒယ်နှင့်ဆင်တူကြောင်းသတိပြုပါ။ ကျွန်ုပ်တို့တွင် Datetime Fields တွင် default များကိုသတ်မှတ်ရန်ခွင့်ပြုမည့်နောက်ထပ်သွင်းကုန်, အချိန်ဇယားများရှိသည်။ ဤအချိန် timestamps များအားလုံးကိုအသုံးပြုခြင်းသည်ဆိုဒ်ကိုလုံခြုံအောင်ပြုလုပ်ခြင်းနှင့်၎င်း၏အသုံးပြုမှုကိုနားလည်ရန်နှင့်၎င်း၏အသုံးပြုမှုကိုနားလည်ရန်နှင့်စာသားအကွက်များသည် 0 ဘ်ဆိုဒ်တွင်အသုံးပြုသူတစ် ဦး စီသို့မဟုတ်စာရေးသူနှင့်ပတ်သက်သည့်သတင်းအချက်အလက်များကိုပေးကြသည်။ Onetoonefield သည်တစ်ခုတည်းသောအသေးစားထည့်သွင်းစဉ်းစားသင့်သည်။ ဤနည်းအားဖြင့်အသုံးပြုသူသည်စာမူများစွာရှိနိုင်ပါသည်။

ယခုတွင်ကျွန်ုပ်တို့၏ login ကိုတိုးတက်အောင်လုပ်ပြီးပရိုဖိုင်းအတွက်အကောင့်သို့ကြည့်ရှုပါ။ ပထမ ဦး စွာအသုံးပြုသူများ / views.py.py.py.py နှင့်မှတ်ပုံတင်ကြည့်ရန်အတွက်အာရုံစူးစိုက်:

# ... သွင်းကုန်
            Profile.objects.create(user=user) # အသုံးပြုသူအတွက်ပရိုဖိုင်းတစ်ခုကိုဖန်တီးရန်ဤမျဉ်းကိုထည့်ရန်သေချာပါစေ

၎င်းသည်သတင်းအချက်အလက်မဖြည့်ဘဲအသုံးပြုသူအတွက်ပရိုဖိုင်းကိုဖန်တီးနိုင်သည်။ ယခုတွင်ကျွန်ုပ်တို့သည်သုံးစွဲသူအကောင့်ကိုမကြာခဏ 0 င်ရောက်ခြင်းမပြုနိုင်ပါ, သို့မဟုတ်အနည်းဆုံးစကားဝှက်များကိုမကြာခဏမကြိုးစားနိုင်အောင်သေချာအောင်လုပ်လိုသည်။

# ... သွင်းကုန်
        if user and user.profile.can_login < timezone.now(): # အသုံးပြုသူ log in လုပ်နိုင်မလားဆိုတာကိုကျွန်ုပ်တို့စစ်ဆေးပါ
        else: # login မအောင်မြင်ပါက,
            user = User.objects.filter(username=username).first() # ဤသည်ကျွန်ုပ်တို့အသုံးပြုသူများပရိုဖိုင်းကို update လုပ်သည့်အပိုင်းဖြစ်သည်
                profile.can_login = timezone.now() + datetime.timedelta(seconds=15) # ဒါကြောင့်သူတို့ကစက္ကန့်အနည်းငယ်အဘို့အနောက်တဖန် log in မဝင်ရောက်နိုင်ပါ

ဤသည်လုံခြုံရေးအခြေခံအခြေခံဖြစ်သည်။ ဖြစ်နိုင်ချေရှိသောစကားဝှက်ပေါင်းစပ်မှုတိုင်းသို့မဟုတ်တစ်ချိန်တည်းတွင်၎င်းတို့ထဲမှအနည်းငယ်ပင်လျှင် site သည်တစ်စုံတစ် ဦး ကိုမထိခိုက်စေရန်သေချာစေပါ။ ၎င်းသည်သူတို့၏ passcode ကိုသိသောသာမန်သုံးစွဲသူကိုစိတ်ပျက်စရာကောင်းလိမ့်မည်မဟုတ်သော်လည်းကိရိယာအနည်းငယ်တွင် log in လုပ်ထားသော်လည်း၎င်းသည် phishing စက်ရုပ်များကိုအက်ပလီကေးရှင်းများမှထွက်ပေါ်လာလိမ့်မည်။ အတိတ်ကာလ၌အချိန်ဖြစ်သင့်သည့် variable variable _login နှင့်ဖော်ပြထားသော variable ကိုကြေငြာချက်ရှိလျှင်, ဤနည်းအားဖြင့်အန္တရာယ်ရှိသောအသုံးပြုသူသည်လျင်မြန်စွာအနီးအနားရှိမည်သည့်နေရာတွင်မဆိုစကားဝှက်ကိုခန့်မှန်းနိုင်မည်မဟုတ်ပါ။ datetime.timedelta () တွင်စက္ကန့်အရေအတွက်အရေအတွက်ကိုလည်းအဆင့်မြှင့်တင်နိုင်ပြီး 0 က်ဘ်ဆိုက်သည် ပို. ခံနိုင်ရည် ရှိ. စက္ကန့်ပိုင်းအနည်းငယ်မျှသာနည်းပါးသည်။ ငါနှင့်အတူစတင်ရန် 15 အကြံပြုပါသည်။

ငါတို့အလုပ်ကိုကယ်တင်ဖို့ Backup script ကိုတည်ဆောက်ထားတာကိုသတိရပါ, command ကို run

sudo backup

နောက်တစ်ကြိမ်, ဤသည်ယခုအချိန်အထိသင်၏အလုပ်ကိုကယ်တင်လိမ့်မည်။ သင်၏အလုပ်ကိုကယ်တင်ရန်မကြာခဏအရံသိမ်းဆည်းမှုများလည်ပတ်ရန်အကြံပြုပါသည်။ Cron လို့ခေါ်တဲ့ Unix utility ကိုသုံးပြီးသင်လုပ်နိုင်ပါတယ်။ ဤ utility ကိုသက်ဝင်စေရန်, အောက်ပါ command ကိုဖွင့်ပြီးသင်၏စကားဝှက်ကိုရိုက်ထည့်ပါ။

sudo crontab -e

အကယ်. သင်သည် Nano အတွက်ရွေးစရာ 1 ကိုရွေးချယ်ပြီးမရှိသေးပါကသင်နှင့်အကျွမ်းတဝင်ရှိသင့်ပြီး arrow keys ကို အသုံးပြု. ဖိုင်၏အောက်ခြေသို့ scroll လုပ်ပါ။ အောက်ပါလိုင်းကိုထည့်ပါ။

0 * * * * sudo backup

CROR သည်အမိန့်ကိုဖွင့်သည့်အခါတစ်နာရီ, လ, လ, လ, လ, လ, လ, လ, လ, တစ်မိနစ်အတွက် 0 ကိုတစ်မိနစ်နှင့် * ရွေးစရာများအပေါ်သုံးပြီးတစ်မိနစ်၏ပထမမိနစ်တွင်ပထမမိနစ်တွင် command ကို run နိုင်သည်။ ဒါကငါတို့ကို Code ကိုအလိုအလျောက်အပြီးသတ်ပေးနိုင်ပါတယ်။ Sudo နှင့်အတူကွပ်မျက်ခံရသည့်အခါ cron ၏အလုပ်အားလုံး root အဖြစ်ကွပ်မျက်ခံရသည့်အခါတိုင်းနာရီတိုင်းစကားဝှက်ကိုရေးရန်မလိုအပ်ပါ။

စကားဝှက်ကိုအသုံးမပြုဘဲကျွန်ုပ်တို့၏ကုဒ်ကိုအရန်ကူးရန်ပိုမိုလွယ်ကူစေရန်ကျွန်ုပ်တို့၏ backup command အတွက်စကားဝှက်ကိုပိတ်ပါ။ အောက်ပါ command ကိုကွပ်မျက်ခြင်းဖြင့်ကျွန်ုပ်တို့ဤသို့ပြုမည်။

sudo visudo

ယခုဖိုင်၏အောက်ခြေသို့ scroll လုပ်ပြီးအခြားလိုင်းထည့်ပါ။

ALL ALL=NOPASSWD: /bin/backup

၎င်းသည်ကျွန်ုပ်တို့အားစကားဝှက်မရှိဘဲအသုံးပြုသူအနေဖြင့် "backup" ကိုအသုံးပြုသည်။ ဤပုံစံသည် "အားလုံး = Nopasswd: / Nopasswd: / bin /" နှင့်မျဉ်းကြောင်းနှင့်မျဉ်းကြောင်းနှင့်အတူမျဉ်းကြောင်းနှင့်အတူမျဉ်းကြောင်းနှင့်အတူအဆုံးသတ်, ဥပမာ / usr / bin / bin / backup အတွက်။

ယခုအီးမေးလ်ဖြင့်စတင်လုပ်ဆောင်ကြပါစို့။ ဝက်ဘ်ဆိုက်များအတွက်အီးမေးလ်ကတကယ်ကိုအရေးကြီးတယ်, အင်တာနက်ကိုမကြာခဏဆိုသလိုအင်တာနက်ကိုမကြာခဏစစ်ဆေးပြီးသူတို့စိတ်ဝင်စားသောထုတ်ကုန်များနှင့် 0 န်ဆောင်မှုများအကြောင်းစျေးကွက်ရှာဖွေရေးအီးမေးလ်အမျိုးမျိုးကိုလက်ခံရရှိသည်။ Django ဝက်ဘ်ဆိုက်တွင်အီးမေးလ်ကိုအီးမေးလ်ဖွင့်ရန်ရွေးချယ်စရာအနည်းငယ်ရှိသည်။

ပထမ ဦး စွာသင်၏ဒိုမိန်းမှအီးမေးလ်ပို့ရန်နှင့်အနည်းဆုံးကုဒ်လိုအပ်သည့်အီးမေးလ် 0 န်ဆောင်မှုအတွက်သင်ငွေပေးချေနိုင်သည်။ Google Workspace, sendinblue, mailgun နှင့်အခြားအရာများကဲ့သို့သော 0 န်ဆောင်မှုများစွာရှိသည်။

ဒီလိုမှမဟုတ်ရင်သင့်ရဲ့ဆာဗာအတွင်းရှိကိုယ်ပိုင်အီးမေးလ်ဝန်ဆောင်မှုကိုခြစ်ရာကနေတည်ဆောက်နေသည်။ ငါက code ပိုများပေမယ့်အထူး hosting လိုအပ်ပေမည်သော်လည်း, ဒီ option ကိုအကြံပြုပါသည်။ သင်၏အိမ်ကွန်ပျူတာမှမေးလ်ဆာဗာတစ်ခုကိုသင်မစနိုင်ပါ။ ထို့ကြောင့် server ထဲသို့ဆာဗာတစ်ခုအတွင်း server ကိုမဖွင့်မီအီးမေးလ်ပို့ရန် configuration နှင့် code ကိုရှေ့ဆက်သွားကြည့်ရအောင်။

ပထမ ဦး စွာ Settings.py ကိုအောက်ပါ command ဖြင့်တည်းဖြတ်ပါ။

nano app/settings.py

App သည်သင် startapp ဖြင့်ဖန်တီးထားသောအက်ပလီကေးရှင်း၏အမည်ဖြစ်သည်။

အောက်ပါလိုင်းများကိုထည့်ပါ

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)

သင်၏အက်ပလီကေးရှင်းကိုဖြန့်ရန်အဆင်သင့်ဖြစ်သည့်အခါ၎င်းကိုပြောင်းလဲရန်သေချာစေပါ, နောက်မှကျွန်ုပ်တို့ပြန်လည်လည်ပတ်လိမ့်မည်။ Email_address Setting သည်သင်ပို့လိုသောအီးမေးလ်ဖြစ်သင့်သည်။ စကားဝှက် (Email_Host_password) ကိုသင် server အတွက်သင်ထုတ်လုပ်သောစကားဝှက်ကိုသတ်မှတ်သင့်သည်။ Settings.py တွင်ဤလိုင်းများအထက်တွင်ဖော်ပြထားသောအောက်ပါယုတ္တိဗေဒကို အသုံးပြု. ကုဒ်နံပါတ်မှ 0 င်ရောက်ရန် config file တစ်ခုမှစကားဝှက်ကိုကျွန်ုပ်တင်ပါမည်။

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

ထို့နောက်ကျွန်ုပ်သည် Nano ကို အသုံးပြု. /etc/config.json တွင် config configs ဖြင့် JSO ဖိုင်ဖိုင်ကိုဖွင့်လှစ်ထားသည်။

ဖိုင်ကိုတည်းဖြတ်ရန်:

sudo nano /etc/config.json

အောက်ပါလိုင်းများကိုထည့်ပါ

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

CONFIG ဖိုင်ကိုဆက်လက်တည်းဖြတ်ပြီးအက်ပလီကေးရှင်းတွင်ကျွန်ုပ်တို့အသုံးပြုမည့်စကားဝှက်များနှင့်သော့များအားလုံးကိုထည့်ပါမည်။ ယခုအချိန်တွင် Python ကိုအသုံးပြုပြီးအီးမေးလ်ပို့ရမည်ကိုလျင်မြန်စွာဆန်းစစ်ကြည့်ရအောင်။ ပထမ ဦး စွာကျွန်ုပ်တို့၏အသုံးပြုသူများထံပေးပို့နိုင်သည့်စိစစ်ရေးအီးမေးလ်အတွက် template တစ်ခုကိုဖန်တီးပြီးအသုံးပြုသူများကို အသုံးပြု. အသုံးပြုသူ templates directory တွင်ထည့်ပါ။ ဒီ template ကို HTML မှာရေးထားလိမ့်မယ်။

nano users/templates/users/verification_email.html

ဒီအီးမေးလ်ကတော်တော်လေးရိုးရှင်းပါတယ် အသုံးပြုသူ, Site အတွက်အသုံးပြုသူ, အခြေစိုက်စခန်း URL ၏အခြေအနေနှင့်အသုံးပြုသူအီးမေးလ်ကိုစစ်ဆေးရန်အသုံးပြုသောအသုံးပြုသူ ID နှင့် Token ကိုအသုံးပြုသည်။ Settings.pings.py.py ကို Settings.py တွင်သေချာစွာသတ်မှတ်ရန်သေချာအောင်လုပ်ပါ။ ရှေ့ဆက်သွားနှင့်အစအ ဦး အနီး, app / settings.py သို့အောက်ပါလိုင်းများကိုထည့်ပါ။

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

BASE_URL = PROTOCOL + '://' + DOMAIN

နောက်ဆုံးတွင်သင်၏ဆိုဒ်သည်အင်တာနက်အတွက်အဆင်သင့်ဖြစ်နေချိန်တွင်သင်ဖြန့်ဖြူးချထားသည့်အခါသင် site ကိုကိုယ်စားပြုရန်သင် 0 ယ်ယူသောဒိုမိန်းအမည်အဖြစ်သင်၏ဒိုမိန်းကိုသတ်မှတ်လိုသည်။ သင်၏ site ကိုဝင်ရောက်ရန် Navbar တွင်သင် navbar ကိုရိုက်ပါလိမ့်မည်ဟူသောအမည်ဖြစ်သည်။ ယခုအချိန်တွင်သင်သည်ဒိုမိန်းကွက်လပ်ကိုကွက်လပ်ချန်ထားနိုင်သည်သို့မဟုတ် placeholder ကိုသုံးနိုင်သည်။ သင်၏ site ကိုသင်ရွေးချယ်လိုသော site_name ကိုသင်ရွေးချယ်လိုသောအမည်ကိုပြောင်းလဲလိုသည်။

အီးမေးလ်မပို့ခင်ကနင်မီးစက်ကိုဖန်တီးကြပါစို့။ အောက်ဖော်ပြပါနှင့်တူသောအကောင့်ဖွင့်ခြင်းနှင့်တင်သွင်းခြင်းကိုတည်ဆောက်ခြင်းနှင့်တင်သွင်းခြင်းဖြင့်ပြုလုပ်နိုင်သည်။ ဖိုင်ကိုတည်းဖြတ်ပါ။

nano users/tokens.py

အောက်ပါကုဒ်ကိုထည့်ပါ။

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()

ဤအခြေခံ Token Generat သည် Token ကိုထုတ်ပေးသည်။ အသုံးပြုသူအား URL တစ်ခုတွင်ပို့နိုင်ပြီးအသုံးပြုသူသည် 4 င်းတို့၏အီးမေးလ်ကိုအတည်ပြုရန်နှင့်အကောင့်ကိုသက်ဝင်စေရန်အသုံးပြုနိုင်သည်။

ထို့နောက်အီးမေးလ်တစ်စောင်မည်သို့ပို့ရမည်ကိုကြည့်ရအောင်။ nano ကိုအသုံးပြုခြင်း, အသုံးပြုသူများ / email.py ကိုတည်းဖြတ်ပါ။

nano users/email.py

စိစစ်အတည်ပြု HTML အီးမေးလ်ကိုပို့ခြင်းကဤကဲ့သို့ကြည့်ရှုလိမ့်မည်။

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)

ဒါကမျှမျှတတရိုးရှင်းပါတယ်။ ကျွန်ုပ်တို့အီးမေးလ်ပို့ရန်လိုအပ်သည့်လုပ်ဆောင်ချက်များကိုကျွန်ုပ်တို့တင်သွင်းသည်, တင်းပလိတ်များနှင့်ကျွန်ုပ်တို့၏ချိန်ညှိချက်များနှင့်အီးမေးလ်ကိုပြန်ဆိုပါ။ ထို့နောက်ကျွန်ုပ်တို့သည် template name မှအီးမေးလ်ကိုသတ်မှတ်ပြီးအသုံးပြုသူအား function ကို အသုံးပြု. အသုံးပြုသူထံသို့ပို့ပေးပါ။ Mail Send_Htmml_Email ကိုပို့ရန် function ကိုကျွန်ုပ်တို့မသတ်မှတ်ရသေးပါကကျွန်ုပ်တို့သတိပြုမိပါလိမ့်မည်။

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()

ဒါကနည်းနည်းပိုပြီးရှုပ်ထွေးတယ်, ငါတို့ဒီကုဒ်အားလုံးကို run ဖို့အဆင်သင့်မဖြစ်သေးဘူး။ ကျွန်ုပ်တို့သည် unsub_link ကိုသတ်မှတ်နေကြောင်းသတိပြုပါ။ အသုံးပြုသူသည်ကျွန်ုပ်တို့၏အီးမေးလ်များမှပယ်ဖျက်ရန်အသုံးပြုသူ link ကိုသုံးနိုင်သည်။ ဘာဖြစ်လို့လဲဆိုတော့သုံးစွဲသူများသည်၎င်းတို့ကိုမကြည့်လိုပါကကျွန်ုပ်တို့၏အီးမေးလ်များကိုရွေးချယ်ရန်လိုအပ်လိမ့်မည်။ ကျွန်ုပ်တို့၏မက်ဆေ့ခ်ျအတွက်စာသားရွေးချယ်စရာအခြားနည်းလမ်းများလည်း HTML tags များကို HTML tags များပိတ်ထားသည်။ နောက်ဆုံးအနေဖြင့်ကျွန်ုပ်တို့သည်အီးမေးလ်ပို့ခြင်းရှိမရှိစစ်ဆေးသည်။ မဖြစ်လျှင်၎င်းတို့၏အီးမေးလ်သည်မမှန်ကန်ကြောင်းကိုကျွန်ုပ်တို့စစ်ဆေးသည်။

အသုံးပြုသူမော်ဒယ်များကိုပြန်သွားကြပါစို့။ UNSUBRIBIBIBIBIBIBIBIBIBIVE သို့လင့်ခ်တစ်ခုပြုလုပ်ရန်လုပ်ဆောင်မှုတစ်ခုကိုကျွန်ုပ်တို့သတ်မှတ်ရန်လိုအပ်သည်။

ပထမ ဦး စွာတင်သွင်းသောတင်သွင်းမှုကိုအသုံးပြုသူများ / မော်ဒယ်လ်များ၏ထိပ်တွင်ထည့်ပါ

nano users/models.py
# ...

ထို့နောက် Token ကိုဖွင့်ရန်နှင့်အီးမေးလ်ကိုသက်ဝင်စေနိုင်သည့်အီးမေးလ်ကိုဖွင့်ရန်အသုံးပြုသော Token ကိုစစ်ဆေးရန်အသုံးပြုသူမော်ဒယ်သို့လုပ်ဆောင်ရန်လုပ်ဆောင်နေကြစို့။ အသုံးပြုသူများ / models.py တွင် ထပ်မံ. အောက်ပါကုဒ်ကိုမော်ဒယ်အဆုံးသို့ထည့်ပါ (indented code)

# ...
            TimestampSigner().unsign(key, max_age=60 * 60 * 24 * 30) # ရက်ပေါင်း 30 သက်တမ်းရှိ

၎င်းသည်မျှမျှတတရိုးရိုးရှင်းရှင်းရိုးရှင်းပါသည်, ကျွန်ုပ်တို့သည်အခြေခံ cryptography tool ကို အသုံးပြု. အချိန်အတန်ကြာကုန်ဆုံးမည့်အမှတ်အသားကိုဖန်တီးရန် Timestampsigner ကိုအသုံးပြုသည်။ ကျွန်ုပ်တို့သည်ဤတိုကင်များကိုနှစ်ကြိမ်အသုံးပြုသည်။ အီးမေးလ်ကိုအတည်ပြုရန်နှင့်တစ်ကြိမ်တည်းဖြတ်ခြင်း link တစ်ခုအတွက်တစ်ကြိမ်တည်း။

ယခုကျွန်ုပ်တို့ရရှိထားသည့်အတိုင်းကျွန်ုပ်တို့ပြုလုပ်ရန်လိုအပ်သည့်အလုပ်၏နောက်ဆုံးမှာအမြင်များတွင်ဖြစ်သည်။ အသုံးပြုသူများ / views.py.py.py, အီးမေးလ်လိပ်စာကိုအတည်ပြုရန်နှင့်စာရင်းမသွင်းရန်ကြည့်ရှုကြပါစို့။

nano users/views.py

ပထမ ဦး စွာအောက်ပါသွင်းကုန်များထည့်ပါ။ ငါအနည်းငယ်အပိုရိုက်ကူးရန်အတွက်နောက်ထပ်ပစ္စည်းများထပ်မံတင်သွင်းရန်မလိုအပ်ပါ။

from .email import send_verification_email # စိစစ်အတည်ပြုအီးမေးလ်ပို့ခြင်း function ကိုတင်သွင်းရန်သေချာပါစေ

သငျသညျဤသွင်းကုန်အချို့ရှိလိမ့်မည်ဖြစ်သော်လည်းသူတို့ကိုထပ်ခါတလဲလဲမထိခိုက်စေပါ။ သင်သည်အခြားသွင်းကုန်များအနက် user.tokens မှ Accounts.tokens မှ Account_activation_tokens accountractivation_tokenoked ကိုတင်သွင်းရန်လိုအပ်လိမ့်မည်။

ယခုဖိုင်၏အောက်ခြေတွင်အောက်ပါကုဒ်ကိုထည့်ပါ။

        # သူတို့ကိုပယ်ဖျက်
    # မဟုတ်ရင် login စာမျက်နှာသို့ redirect
# Sendwelileemail (တောင်းဆိုမှု, အသုံးပြုသူ)

ဒါကကုဒ်တွေအများကြီးပါ။ ဒါကိုဖြိုဖျက်ကြစို့။ ပထမ ဦး ဆုံး function, သန့်ရှင်းပြီးရိုးရှင်းပြီးအသုံးပြုသူကိုစာပို့စာရင်းမှစာရင်းမသွင်းပါ။ ဒုတိယလုပ်ဆောင်ချက်သည်သူတို့၏အီးမေးလ်ကိုသက်ဝင်စေပြီး sendwelileemailemail ကိုကျွန်ုပ်ထည့်သွင်းစဉ်းစားပါလိမ့်မည်။ အီးမေးလ်တက္ကသိုလ်တစ်ခုနှင့် function different ကိုကြိုဆိုရန်ဖိတ်ခေါ်ပါသည်။ ငါပစ်ချလိုက်တဲ့နောက်ဆုံး function ကအရေးကြီးတယ်, ဘာဖြစ်လို့လဲဆိုတော့ activation အီးမေးလ်တွေကုန်ဆုံးလို့ပါ။ ထို့ကြောင့်ကျွန်ုပ်တို့သည်အချိန်အကြာတွင် activation အီးမေးလ်ကိုပြန်လည်ပေးပို့ရန်လိုအပ်လိမ့်မည်။ ကျွန်ုပ်တို့သည်ဤအတွက်အခြေခံပုံစံကို သုံး. စိစစ်အတည်ပြုအီးမေးလ်ပို့ရန် function ကိုခေါ်ဆိုနိုင်သည်။ ဒီလိုမလုပ်ခင်မှတ်ပုံတင်ကြည့်ရှုရန် function ခေါ်ဆိုမှုတစ်ခုထည့်ခြင်းအားဖြင့်၎င်းကိုပထမနေရာ၌ပေးပို့ရန်သေချာအောင်လုပ်ကြရအောင်။ Relister View ထဲမှ Redirect ကို redirect လုပ်ခြင်းမပြုမီဤမျဉ်းကိုထည့်ပါ, သုံးစွဲသူများ / Views.py တွင် Def Register ။

nano users/views.py
# ... (ပြီးနောက်) def မှတ်ပုံတင် (တောင်းဆိုမှု):
# ... (မတိုင်မီ) redirect (

သင်သည်ထို code snippet တွင်ပထမနှင့်နောက်ဆုံးလိုင်းများကိုထည့်သွင်းရန်မလိုအပ်ပါ။ မှတ်ပုံတင်ကြည့်ပါ။ မှတ်ပုံတင်ကြည့်ပါ။ ဒီဟာကကြည့်သင့်တယ်

# ... သွင်းကုန်
            send_verification_email(user) # ဒီလိုင်းကိုထည့်ရန်သေချာပါစေ။

ယခုတွင်ကျွန်ုပ်တို့သည် activation အီးမေးလ်ကိုပြန်လည်ရယူရန်ပုံစံကိုထည့်ရန်လိုအပ်သည်။ အသုံးပြုသူများ / forms.py.py တွင်, အောက်ပါပုံစံကိုထည့်ပါ:

# ... (သွင်းကုန်)

ကျွန်ုပ်တို့သည်ဤပြန်လည်ပေးပို့ထားသောအီးမေးလ် Activation ပုံစံနှင့်သက်ဆိုင်သော template တစ်ခုလည်းလိုအပ်သည်။ ဒီ template ထဲထည့်ရအောင်။ ဖိုင်ကိုတည်းဖြတ်ပါ။

nano users/templates/users/resend_activation.html

ထို့နောက်အောက်ပါကုဒ်ကိုဖိုင်ထဲသို့ထည့်ပါ။

Whew, ဒါကအများကြီး! ယခုကျွန်ုပ်တို့သည်ကျွန်ုပ်တို့၏ဆာဗာသို့ကုဒ်များကိုဖြန့်ချိသောအခါ HTML အီးမေးလ်ကိုအီးမေးလ်ဖြင့် နှိပ်. အသုံးပြုသူအကောင့်များကိုအီးမေးလ်တွင်နှိပ်ပါ။ ကျွန်ုပ်တို့လည်းရိုးရှင်းသောဖိတ်စာအီးမေးလ်ပို့လိုသောကြောင့်မည်သို့ပြုလုပ်ရမည်ကိုကြည့်ရအောင်။ အသုံးပြုသူများ / email.py သို့ပြန်သွားပါ, အောက်ပါကုဒ်ကိုထည့်ပါ။

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)

ဒါ့အပြင်ဒီအချက်အလက်အားလုံးကိုပေးဖို့တင်းပလိတ်တစ်ခုလိုအပ်လိမ့်မယ်။ ကျွန်ုပ်၏ 0 က်ဘ်ဆိုက်တွင် template သည်အောက်ပါအတိုင်းဖြစ်သည်။ သို့သော်သင်ကြိုက်နှစ်သက်သည်။

ကျွန်ုပ်တို့တွင်အပိတ်နှင့်ခန္ဓာကိုယ်သို့မဟုတ် HTML tags များမရှိကြောင်းသတိပြုပါ။ ဒါတွေကအရေးကြီးတယ်, ဒါပေမယ့်သူတို့ကသူတို့ကိုနှစ်ကြိမ်သတ်မှတ်ချင်ကြဘူး။

ဒါဆိုနောက်ထပ်ဘာလဲ ကျနော်တို့ရှည်လျားသောလမ်းလာကြပါပြီ။ တကယ်တော့ site ကိုဆာဗာတစ်ခုတင်ရန်အဆင်သင့်ဖြစ်သင့်သည်။ @Login_requirired အလှဆင်ပစ္စည်းများကိုကျွန်ုပ်တို့ထည့်သွင်းပြီးကျွန်ုပ်တို့၏အမြင်များကိုလုံခြုံအောင်ပြုလုပ်နိုင်သည်, သုံးစွဲသူလက်မှတ်များယူပါ။ 0 က်ဘ်ဆိုက်တစ်ခု၏မည်သည့် 0 က်ဘ်ဆိုက်တစ်ခု၏အခြေခံအချက်အလက်များကိုအခြေခံသည့်အရာ၏အခြေခံဖြစ်သော Ensigres Enitups နှင့် cache information များကိုပေးပို့ပါ။ ကျွန်ုပ်တို့သည်ပိုမိုအသုံး 0 င်သော features အနည်းငယ်ကိုကျွန်ုပ်တို့ထည့်သွင်းပါမည်။

Password Reset View ကိုလည်းလိုအပ်လိမ့်မယ်, ဒါကြောင့်တကယ်မြန်မြန်ဆန်ဆန်ထပ်ထည့်ကြစို့။ Django ၏ Password Reset View သည်အချို့သောလုပ်ဆောင်ချက်များတွင်ဖြိုခွဲထားသော်လည်းကျွန်ုပ်တို့၏ကိုယ်ပိုင်ရှုထောင့်, အီးမေးလ်တင်းပလိတ်, ပုံစံများနှင့် URL ပုံစံများကိုမည်သို့ရေးရမည်ကိုကျွန်ုပ်တို့ကြည့်ရှုမည်။ အသုံးပြုသူများ / views.py တွင်အမြင်သည်ကြည့်ရှုခြင်းနှင့်တူသည်

# ... သွင်းကုန်

ဤပုံစံကို Django သို့တည်ဆောက်သည်။ သို့သော် Password Reset / Templates / users / users / password_reset_confirm.html

အသုံးပြုသူများ / တင်းပလိတ်များ / အသုံးပြုသူများ / password_reset.html တွင်စကားဝှက်ကိုမှန်ကန်သောအီးမေးလ်ဖြင့်စကားဝှက်ပြန်လည်တပ်ဆင်ရန်စာရွက်တစ်ရွက်ပို့ရန်အတွက်စာရွက်များရှိသည်

အီးမေးလ်ကိုယ်တိုင်အတွက် template သည်ရိုးရှင်းပါသည်။ ၎င်းသည်အသုံးပြုသူများ / တင်းပလိတ်များ / အသုံးပြုသူများ / password_Reset_Email.html တွင်စကားဝှက်ကိုပြန်လည်သတ်မှတ်ရန် link တစ်ခုဟုခေါ်သောအခြေခံ HTML ဖိုင်တစ်ခုဖြစ်ပြီးအခြေခံ HTML ဖိုင်တစ်ခုဖြစ်ပါတယ်။ Django သည်ဤဖိုင်ကိုအလိုအလျောက်အနက်ဖွင့်လိမ့်မည်။

နောက်ထပ်တင်းပလိတ်နှစ်ခုကိုလည်းလိုအပ်လိမ့်မယ်။ ပထမတစ်ခုကအီးမေးလ်ကိုပို့လိုက်ပြီဆိုတာကိုအတည်ပြုဖို့ပါ။ ဤအရာများအတွက်အမြင်များသည် Django တွင်ရှိပြီးဖြစ်သည်, ဒါကြောင့်သူတို့ကို URLS.py ။ ဤ template ကိုအသုံးပြုသူများ / တင်းပလိတ်များ / အသုံးပြုသူများ / password_reset_done.html တွင်တည်ရှိသည်

နောက်ဆုံးတွင်စကားဝှက်ကိုပြန်လည်သတ်မှတ်ခြင်းသည်ပြီးပြည့်စုံကြောင်းအတည်ပြုရန်အသုံးပြုသူများ / တင်းပလိတ်များ / အသုံးပြုသူများ / password_reset_completes.html

ယခုကျွန်ုပ်တို့သည်ဤအမြင်များအတွက် URL ပုံစံများလိုအပ်သည်။ အသုံးပြုသူများ / urls.py တွင်, အောက်ပါ URL ပုံစံများကိုထည့်ပါ။

    # ... ဒီမှာ URLs

လေးတင်းပလိတ်လေးခု, ဒါကအများကြီး! ယခုတွင်ကျွန်ုပ်တို့သည်သုံးစွဲသူ၏စကားဝှက်ကိုကျွန်ုပ်တို့အချိန်မရွေး 0 က်ဘ်ဘရောက်ဇာမှကျွန်ုပ်တို့လိုအပ်သောမည်သည့်အချိန်တွင်မဆိုပြန်လည်စတင်နိုင်မည်ဖြစ်သည်။

ဒီဟာကဒီကုဒ်တွေအများကြီးရှိတယ်ဆိုတာငါနားလည်တယ်။ အကယ်. သင်၏ ဦး ခေါင်းကိုအနည်းငယ်သာပုံရသည်ဆိုလျှင်၎င်းသည်အဆင်ပြေပါသည်။ သင်တိုးတက်လာလိမ့်မည်, သင်၏နားလည်မှုတိုးတက်လာလိမ့်မည်, သင်မကြာမီကုဒ်နှင့်အတူအများကြီးပိုမိုအရည်အချင်းပြည့်မီလိမ့်မည်။ အကယ်. သင်သည်လုံးဝပျောက်ဆုံးသွားပါကကျွန်ုပ်သည်ဤဆော့ဖ်ဝဲကိုနောက်ပိုင်းတွင်ဤဆော့ဖ်ဝဲသို့ပြန်လည်ရောက်ရှိလာပြီး, ဤရွေ့ကားများသောအားဖြင့်စတင်ရန်အခမဲ့ဖြစ်ကြပြီးသင်ဤစီမံကိန်းသို့ပြန်လာသောအခါသင်အောင်မြင်ရန်လိုအပ်သမျှကိုလမ်းပြပေးလိမ့်မည်။ သင်ဆက်လက်လုပ်ဆောင်ရန်အဆင်သင့်ဖြစ်နေသည်ဟုသင်ခံစားရပါကသင်၏ code ကို Remote server သို့ပို့ပြီးစာဝှက်ဖြည့်စွက်ခြင်းအပြင်သင်၏ဖြန့်ကျက်မှုကို bash များတပ်ဆင်ထားပါ။

ဝေးလံခေါင်သီသောဆာဗာသို့မပို့မီကျွန်ုပ်တို့ပြုလုပ်ရန်လိုအပ်သည့်နောက်ဆုံးအရာမှာကျွန်ုပ်တို့၏ site ကိုအနည်းငယ်ပိုမိုလုံခြုံအောင်ပြုလုပ်ပါ။ Login View သည်အသုံးပြုသူအမည်နှင့်စကားဝှက်ကိုသာယူကြောင်းသတိပြုမိလိမ့်မည်။ ၎င်းသည်လွယ်ကူသောပြင်ဆင်ချက်တစ်ခုဖြစ်ပြီးတူညီသောကုဒ်နံပါတ်နှင့်အတူကျွန်ုပ်တို့၏ site ကိုစာသားမက်ဆေ့ခ်ျများပို့ပေးနိုင်ပြီးဆာဗာသို့ပို့သောစာသားမက်ဆေ့ခ်ျများကိုပင်တုန့်ပြန်နိုင်သည်။ စတင်ရန်ကျွန်ုပ်တို့သည်အသုံးပြုသူမော်ဒယ်များကိုပြန်သွားပြီး login တစ်ခုချင်းစီကိုကိုယ်စားပြုမည့် timestamp signer ကိုထည့်ပါလိမ့်မည်။ ကျွန်ုပ်တို့၏ login အတွက်အပိုလုံခြုံရေးကိုထည့်ရန်အသုံးပြုမည့်အသုံးပြုသူမော်ဒယ်အတွက်ထူးခြားသော, အသုံးပြုသူမော်ဒယ်များ, အသုံးပြုသူများ / models.py ကိုတည်းဖြတ်ခြင်း, အောက်ပါကုဒ်ကိုထည့်ပါ။

# UUID, Timestamp Signer နှင့် URL Generator ကိုတင်သွင်းရန်သေချာစေပါ။
    # ဒီကုဒ်ကိုဒီမှာထည့်ပါ
    # နှင့်ဒီ function ကိုထည့်ပါ
            TimestampSigner().unsign(key, max_age=60 * settings.AUTH_VALID_MINUTES) # 3 မိနစ်သက်တမ်းရှိ

သင်၏အသုံးပြုသူများ / models.py.py သည်မှတ်ချက်များအပြင်မှတ်ချက်များအပြင်မှတ်ချက်များအပြင်, ဒီဟာကိုဖြိုခွဲလိုက်ရင်ရိုးရှင်းပါတယ် လုံခြုံစိတ်ချရသောကုဒ်ကိုထုတ်ပေးနိုင်ရန်နှင့်၎င်းကိုသေချာအောင်လုပ်နိုင်ရန်အတွက်တစ်ကြိမ်သာသေချာစေရန်အတွက် cryptographic utility တစ်ခုဖြစ်သည့် timestampsigner တစ်ခုဖြစ်သည့် timestampsigner တစ်ခုရှိသည်။ UUID ကိုကျွန်ုပ်တို့အသုံးပြုသော UUID ကိုအသုံးပြုသည်။ ၎င်းသည်ကျွန်ုပ်တို့၏အသုံးပြုသူအားအမှတ်အသားလက်မှတ်ထိုးခြင်းနှင့်အသုံးပြုသူထံသို့ပို့သည့် URL တွင်အသုံးပြုသောထူးခြားသောအမှတ်အသားဖြစ်သည်။ ကျွန်ုပ်တို့သည်ဤအခြေခံ cryptography ကိုအချက်နှစ်ချက်စစ်မှန်ကြောင်းအတည်ပြုခြင်းအမြင်တည်ဆောက်ရန်အသုံးပြုပါမည်။ အခြားမည်သည့်အရာကိုမဆိုကျွန်ုပ်တို့မလုပ်မီကျွန်ုပ်တို့၏အသုံးပြုသူမော်ဒယ်များကိုအသစ်ပြုပြင်မွမ်းမံရန်ပြောင်းရွှေ့သွားကြကုန်အံ့။ manage.py.py နှင့်အတူ directory ၌တည်၏, ရွှေ့ပြောင်းလုပ်ဆောင်ရေးကိုလုပ်ဖို့အောက်ပါ command များကို run ပါ။

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

ဒီဟာကအရေးကြီးတယ်, ဘာလို့လဲဆိုတော့ငါတို့မော်ဒယ်တွေကိုပြောင်းလဲတိုင်းအချိန်တိုင်းမှာဇယားတွေကိုဖန်တီးဖို့နဲ့ Database ကိုတကယ်မသုံးခင် Defaults နဲ့ defaults ကို update လုပ်ဖို့လိုလိမ့်မယ်။

နောက်ဒုတိယမြောက် authentication ကို redirect လုပ်ရန်ကျွန်ုပ်တို့၏ login မြင်ကွင်းကိုကြံဆကြစို့။ အသုံးပြုသူများ / views.py.py.py တွင်ပါ 0 င်သော login function ကိုဖယ်ရှားပြီးအသုံးပြုသူမော်ဒယ်များတွင်ကျွန်ုပ်တို့ရရှိသော URL သို့ redirect ။

# ... သွင်းကုန်
        if user and user.profile.can_login < timezone.now(): # အသုံးပြုသူ log in လုပ်နိုင်မလားဆိုတာကိုကျွန်ုပ်တို့စစ်ဆေးပါ
            # ဒီမှာရှိခဲ့ auth_login function ကိုဖယ်ရှားပါ
                return redirect(user.profile.create_auth_url()) # ဒီမှာ URL အသစ်တစ်ခုကို redirect
            else: # အသုံးပြုသူသည် Multi-factor authentication ကိုအသုံးမပြုပါက၎င်းတို့ကို log in လုပ်ပါ။
        else: # login မအောင်မြင်ပါက,
            user = User.objects.filter(username=username).first() # ဤသည်ကျွန်ုပ်တို့အသုံးပြုသူများပရိုဖိုင်းကို update လုပ်သည့်အပိုင်းဖြစ်သည်
                profile.can_login = timezone.now() + datetime.timedelta(seconds=15) # ဒါကြောင့်သူတို့ကစက္ကန့်အနည်းငယ်အဘို့အနောက်တဖန် log in မဝင်ရောက်နိုင်ပါ

ဒီတော့ဒါကတော်တော်ရိုးရှင်းပါတယ်, ငါတို့ဖန်တီးတဲ့အခါမှာအချက်နှစ်ချက်စစ်မှန်ကြောင်းအထောက်အထားပြသခြင်းအမြင်ကိုပြန်ညွှန်းပေးဖို့နည်းလမ်းရှိတယ်။ အသုံးပြုသူသည်ဖုန်းနံပါတ်မထည့်သွင်းပါကကျွန်ုပ်တို့တွင်လည်းအမှိုက်များရှိသည်။ ကျွန်ုပ်တို့သည်မကြာမီဖုန်းနံပါတ်တစ်ခုထည့်သွင်းရန်နှင့်မကြာမီစာသားမက်ဆေ့ခ်ျဖြင့်ဝင်ရောက်ရန်အခြေခံအမြင်တစ်ခုထည့်ပါလိမ့်မည်။

ပထမ ဦး စွာကျွန်ုပ်တို့၏ကုဒ်မှစာသားမက်ဆေ့ခ်ျပို့ရန်လွယ်ကူသောနည်းလမ်းတစ်ခုလိုအပ်သည်။ ဒီလိုလုပ်ဖို့ APIs အတော်များများကနေရွေးချယ်နိုင်တယ်, ဒါပေမယ့်ကျနော့်အမြင်မှာအလွယ်ကူဆုံးတစ်ယောက်က Twilio ဖြစ်တယ်။ ၎င်းတို့သည်သေးငယ်သောစီမံကိန်းများအတွက်စျေးနှုန်းချိုသာစွာဖြင့်စျေးနှုန်းချိုသာစွာဖြင့်လည်းကောင်း 0 န်ဆောင်မှုပေးသည်။ Twilio.com တွင်အကောင့်တစ်ခုဖွင့်ပါ, သင်၏စီမံကိန်းနှင့် ပတ်သက်. အသေးစိတ်အချက်အလက်များကိုဖြည့်ပါ, ဖုန်းနံပါတ်ဝယ်ပြီးသင်၏ API ခလုတ်များကိုသင်၏ Settings.py သို့ကူးယူပါ။ ထို့နောက်ဖိုင်အသစ်, အသုံးပြုသူများ / sms.py အသစ်အောက်တွင်ဤကုဒ်ကိုထည့်ပါ။

nano users/sms.py
# လိုအပ်သော packages များအားလုံးကိုတင်သွင်းပါ
# ဒီကုဒ်က twilio နဲ့စာသားကိုပို့လိုက်တယ်
# ဤမျှလောက်များစွာသောဂဏန်းများနှင့်အတူနံပါတ်ရရန်တစ် ဦး ကအထောက်အမန်း function ကို
# အသုံးပြုသူကိုစစ်ဆေးရန်စာသားကိုပို့ပါ
# အသုံးပြုသူတစ် ဦး ကိုဤ function ပါသောစာသားကိုပို့ပါ
# ဒီ function ကိုနှင့်အတူကုဒ်အတည်ပြုပါ
# အချိန်ကိုအတည်ပြုပါ

သင်၏ settings ကိုသင့်လျော်စွာပြောင်းလဲရန်သေချာပါစေ, ဤလိုင်းများကိုသင်၏သော့များဖြင့်ထည့်သွင်းပါ။

# ဤအရာများကိုသင်၏ Twilio Dashboard မှကူးယူပါ
AUTH_VALID_MINUTES = 3 # TFA စာမျက်နှာ၏နံပါတ်အရေအတွက်သည်ချက်ချင်းလုပ်ဆောင်သည်

ပထမ ဦး စွာကျွန်ုပ်တို့၏အချက်နှစ်ချက်စစ်မှန်ကြောင်းအထောက်အထားပြသခြင်းအမြင်များအတွက်ပုံစံများလိုအပ်သည်။ အသုံးပြုသူများ / forms.py ကိုတည်းဖြတ်ခြင်း, အောက်ပါကုဒ်ကိုထည့်ပါ။

# ... သွင်းကုန်
# ကျွန်ုပ်တို့၏ဖုန်းနံပါတ်ကိုထည့်သွင်းရန်ပုံစံ
# authenticating များအတွက်ပုံစံ

ထို့နောက်အသုံးပြုသူများ / views.py တွင်အမြင်များကိုဖန်တီးကြပါစို့

# ... သွင်းကုန်

ဤအမြင်နှစ်ခုလုံးအတွက်တင်းပလိတ်များကိုလည်းလိုအပ်သည်။ MFA Template ကိုအရင်ထည့်ကြစို့။

nano users/templates/users/mfa.html

ဒီ HTML code ကို template ကိုထည့်ပါ

ဒါကတော်တော်လေးကိုရှင်းပြပါ။ ပုံစံသည်ကုဒ်နံပါတ်တစ်ခုသို့မဟုတ်အချည်းနှီးသောကုဒ်တစ်ခုဖြစ်စေပို့သည်။ ဗလာကုဒ်များကိုလက်ခံရရှိပါက Code ကိုကျွန်ုပ်တို့ပေးပို့သည့်အမြင်တွင်သင်သတိပြုမိလိမ့်မည်။ ထို့နောက်ကျွန်ုပ်တို့တွင် submit ခလုတ်နှစ်ခုသာရှိသည်။ ဤနည်းဖြင့်ကျွန်ုပ်တို့သည်ကုဒ်ကိုခလုတ်ကိုနှိပ်နိုင်သည်။ ထို့နောက်ကျွန်ုပ်တို့သည်ဖုန်းနံပါတ်ထည့်ရန်ရိုးရှင်းသောပုံစံကိုထည့်ပါလိမ့်မည်။

nano users/templates/users/mfa_onboarding.html

အောက်ပါ HTML ကိုထည့်ပါ။

ဤပုံစံသည်ပိုမိုလွယ်ကူသည်။ ကျွန်ုပ်တို့ဖန်တီးထားသောဖုန်းနံပါတ်ပုံစံကိုသာရောင်းချပြီးအသုံးပြုသူကိုဖုန်းနံပါတ်ထည့်ရန်ခွင့်ပြုသည်။

ဒါကတကယ်ကိုကြည့်ကောင်းပါတယ် အရာရာကိုစနစ်တကျတည်ဆောက်ထားသရွေ့ကျွန်ုပ်တို့သည်စာများကိုမက်ဆေ့ခ်ျများပို့နိုင်ပြီး URL ပုံစံများကိုထည့်သွင်းပါ။ ကျွန်ုပ်တို့တည်ဆောက်ရန်နောက်ဆုံးအသင်းသည်ပရိုဖိုင်းအမြင်ဖြစ်သည်။ ထို့ကြောင့်အသုံးပြုသူသည် log in ဝင်ခြင်းမရှိဘဲသူတို့၏ဖုန်းနံပါတ်ကိုပြောင်းလဲနိုင်အောင်သေချာအောင်လုပ်နိုင်သည်။ ဒါ့အပြင်နောက်ဆုံးမှာတော့ "ရပ်နားရန်" option ကိုထည့်သွင်းနိုင်လိမ့်မယ်။

အသုံးပြုသူများ / views.py သို့ပရိုဖိုင်းကိုကြည့်ကြစို့။ ဤမြင်ကွင်းသည်အသုံးပြုသူ၏ဇီဝ, အီးမေးလ်, အသုံးပြုသူအမည်နှင့်ဖုန်းနံပါတ်များကိုအသစ်ပြောင်းလိမ့်မည်။ ပထမ ဦး စွာကျွန်ုပ်တို့သည်အသုံးပြုသူများ / forms များ၌နောက်ထပ်ပုံစံနှစ်ခုလိုအပ်လိမ့်မည်

# ... သွင်းကုန်

ထို့နောက်ကျွန်ုပ်တို့သည်ဤပုံစံနှစ်ခုလုံးကိုအသုံးပြုရန်မြင်ကွင်းတစ်ခုဖန်တီးနိုင်သည်။ အသုံးပြုသူများ / views.py.py ကိုတည်းဖြတ်ပါ။

# ဤသွင်းကုန်ကိုထည့်ပါ

ဒီအမြင်အတွက်တင်းပလိတ်တစ်ခုလိုအပ်လိမ့်မယ်။

nano users/templates/users/profile.html

ဤအရာသည်မျှမျှတတရိုးရှင်းသောပုံစံတစ်ခုဖြစ်ကြောင်းသင်သတိပြုမိလိမ့်မည်။ ၎င်းသည်လိုအပ်သည်မှာသေချာသည်, ထို့ကြောင့်သင်ကတင်သွင်းရန်မလိုအပ်ဘဲသင်တည်းဖြတ်မှုများကိုပြုလုပ်နိုင်သည်။

ထို့နောက် URL Patters တွင်ဤအမြင်များကိုကိုယ်စားပြုသော URLs များလိုအပ်သည်။ အသုံးပြုသူများ / urls.py ကိုတည်းဖြတ်ပါ။ ဤကုဒ်ကိုထည့်ပါ။

# ... ယခင်ကုဒ်, သွင်းကုန်
# ... URL ပုံစံများကိုအရင် 0 င်ခဲ့သည့်ပုံစံများ, နောက်လိုင်းသုံးခုကိုထည့်ပါ

ယခုကျွန်ုပ်တို့၏စီမံကိန်းကိုစမ်းသပ်ရန်အချိန်ကောင်းဖြစ်သည်။ ဒါပေမယ့်ပထမ ဦး စွာနောက်ထပ်အရန်ကူးယူကြစို့။

backup

နှင့်ဆာဗာကို run ပါ။ Linux server သို့မပို့မီ, အကောင့်နှစ်ခုရှိအချက်နှစ်ချက်ကို authentication နှစ်ခုကိုဖွင့်ရန်ကောင်းသည်။ ကျွန်ုပ်တို့၏ပရိုဖိုင်း URL / အသုံးပြုသူများ / ပရိုဖိုင်း / ပရိုဖိုင်းကိုကျွန်ုပ်တို့သွားမည်ဖြစ်လိမ့်မည်။

python manage.py runserver localhost:8000

သင်၏ဝဘ်ဘရောက်ဇာကိုသွားခြင်းဖြင့်ဝက်ဘ်စာမျက်နှာကိုသွားပါ, ကျွန်ုပ်သည် Google HTTPS ကို အသုံးပြု. URL https: // localhost: accounts / profile / profile

သင်လိုအပ်ပါကသင်ဝင်ရောက်နိုင်ပါလိမ့်မည်။

ဤစီမံကိန်းသည် Run ရန်ဆာဗာတစ်ခုလိုအပ်သည်။ ထို့ကြောင့်၎င်းသည်စာတစ်စောင်ပို့နိုင်သည်။ သို့သော် ဦး စွာ, အမှားများကိုကျွန်ုပ်တို့တွေ့မြင်ရန်နည်းလမ်းတစ်ခုလိုအပ်သည်။ အကယ်. သင်သည် server ကို debug mode တွင် run မည်ဆိုလျှင် settings.debug မှန်ကန်စွာနှင့်အတူဆာဗာသည်အမှားအယွင်းများကိုအလိုအလျောက်ဖော်ပြသည်။ Debug Mode ကိုအသုံးမပြုဘဲအမှားအယွင်းများကိုပြသရန်ထုတ်လုပ်မှုဆာဗာတစ်ခုတွင်မလုံခြုံသောအရာသည်၎င်းကိုကြည့်ရှုသင့်သည်။ ကျွန်ုပ်တို့ကိုင်တွယ်ရမည့်အရေးအကြီးဆုံးအမှားများမှာ -

အမှား 500 - ကျွန်ုပ်တို့၏ကုဒ်နှင့်ပြ a နာတစ်ခု အမှား 404 - ရှာမတွေ့သောစာမျက်နှာ (ကျိုးပဲ့သော URL) အမှား 403 - ခွင့်ပြုချက်အမှားကိုငြင်းပယ်ခဲ့သည်

အမှားအယွင်းများဟုခေါ်သောဤအမှားအယွင်းများကိုကိုင်တွယ်ရန် app အသစ်တစ်ခုထည့်ကြပါစို့။

python manage.py startapp errors

Settings.py.py ကိုထည့်သွင်းပါ။ installed_apps setting တွင်ကျွန်ုပ်တို့လုပ်ခဲ့သည့်အတိုင်း Add add / urls.py တွင်အချို့သောအမြင်များကိုထည့်သွင်းခြင်းဖြင့်စတင်ပါ။

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

ဤအရာသည်မှားယွင်းသောအမြင်များ, တင်းပလိတ်များနှင့်အချင်းချင်းရေနစ်မြုပ်သည့်အပြင်ကျွန်ုပ်တို့လိုအပ်သမျှဖြစ်သည်။ အဲဒီလိုလုပ်တာကိုသတ်မှတ်ကြပါစို့။

# ဤနေရာတွင်သင်၏အမြင်များကိုဖန်တီးပါ။

ထို့နောက်ဤအမှားများကိုကိုင်တွယ်ရန် Middleware ကိုသတ်မှတ်ကြပါစို့။ Settings.py_ inwarewarewes.py andward.py မှပထမ ဦး ဆုံးဖြည့်စွက်ခြင်းဖြင့်ဤသို့ပြုလုပ်ပါလိမ့်မည်။

    # ... အရင်အဟုင်း

နောက်တော့ 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.')

ကျွန်ုပ်တို့သည် threading ဒေသခံတစ် ဦး ကိုအသုံးပြုခြင်းအားဖြင့်လက်ရှိခြွင်းချက်ကိုရရှိရန် function တစ်ခုထည့်ရန်ကျွန်ုပ်တို့၏ကုဒ်အတွင်းရှိအမှားအယွင်းများကိုခြေရာခံရန်ကူညီသည်။ တင်းပလိတ်များအရကျွန်ုပ်တို့သာတစ် ဦး တည်းသာလိုအပ်ပါသည်, Template သည်ခေါင်းစဉ်နှင့် "ခြေရာကောက်" ကိုပြန်ဆိုရန်လိုအပ်သည်။

nano errors/templates/errors/error.html

ဒါကငါတို့ရဲ့အရိုးရှင်းဆုံးပုံစံတွေပဲ။ ဒါပေမယ့်ငါတို့စီမံကိန်းရဲ့အမှားတွေကိုကြည့်ဖို့ဘယ်လောက်လွယ်ကူတယ်။ နောက်ပြီး Debug ကိုချိန်ညှိချက်များတွင်ပိတ်ထားကြပါစို့။

nano app/settings.py

ဒီမျဉ်းကြောင်းကိုစစ်မှန်တဲ့နေရာကိုရှာပြီးမှားဖို့ပြောင်းပါ

DEBUG = False

ရှေ့ဆက်သွားနှင့်ယခု app ကိုအရန်ကူး။ ကျွန်ုပ်တို့သည်ဝေးလံသော Linux server သို့နေရာချထားရန်အဆင်သင့်ဖြစ်နေပြီးထိုနေရာမှအင်္ဂါရပ်များကိုဆက်ထားရန်အဆင်သင့်ရှိသည်။

sudo backup

ဤကုဒ်ကိုဆာဗာတစ်ခုသို့မတင်မီကုဒ်နှင့်အတူအချို့သောပြ issues နာများရှိနိုင်သည်ကိုကျွန်ုပ်တို့စဉ်းစားသင့်သည်။ အမှုအပေါ် မူတည်. ၎င်းတို့အားတင်ထားသောသတင်းအချက်အလက်များကိုလက်ခံသောဆိုဒ်များသည် spam များနှင့်ပြ issues နာများရှိပြီး spam များကိုဖယ်ရှားရန်အခက်အခဲရှိလိမ့်မည်။ ဤသည်ချက်ချင်းမဖြစ်သင့်သော်လည်း၎င်းတို့သည်မည်သည့်နေရာတွင်ရှိနေသည်ဆိုပါကမည်သည့်နေရာတွင် 0 င်ရောက်ခြင်းကိုမည်ကဲ့သို့အလိုအလျောက်ဖြည့်ဆည်းပေးနိုင်ပြီးအသုံးပြုသူအကောင့်များကိုမည်သို့ပိတ်ထားရမည်,

ကျွန်ုပ်တို့ဆန်းစစ်လေ့လာခဲ့သောအချက်များ Multi Multo Multor authentication စံနမူနာကိုကြည့်ခြင်း, ကျွန်ုပ်တို့သည် Loginess Loginal Limitins နှုန်းနှင့်တိုကင်သက်တမ်းကုန်ဆုံးပုံကိုသတိပြုပါ။ စက်ရုပ်များသည် site တစ်ခုကို 0 င်ရောက်နေပါကအသုံးပြုသူသည်တစ်ချိန်တည်းတွင် Codes များ 0 င်ရောက်နိုင်ရန်အတွက်အချက်နှစ်ချက်စစ်မှန်ကြောင်းအတည်ပြုချက်နှစ်ခုကို ပို. ခက်ခဲနိုင်သည်။ ၎င်းကိုတိုက်ဖျက်ရန်အသုံးပြုသူမော်ဒယ်များကို အသုံးပြု. ဖုန်းနံပါတ်နှင့်အတူ Multi Factor authentication ကို သုံး. ကျွန်ုပ်တို့အတည်ပြုသည့်အခါ site နှင့်အပြန်အလှန်ဆက်သွယ်မှုကိုကြေငြာကြပါစို့။ အီးမေးလ်ဖြင့်စစ်မှန်ကြောင်းအထောက်အထားရန်လည်း option တစ်ခုကိုလည်းထည့်ပါလိမ့်မည်။ Nano နှင့်အတူအသုံးပြုသူမော်ဒယ်များကိုတည်းဖြတ်ခြင်းဖြင့်စတင်ပါ။

nano users/models.py

ဒါကငါတို့ထည့်ထားတဲ့မော်ဒယ်နဲ့တူသင့်တယ်။ ID တစ်ခု, အသုံးပြုသူ, timorations, သက်တမ်းကုန်ဆုံးခြင်း, သက်တမ်းကုန်ဆုံးခြင်း,

# ဝက်ဘ်ဆိုက်သို့ဝင်ရောက်ရန်အသုံးပြုသောအခြေခံတိုကင်

ကျွန်ုပ်တို့၏သုံးစွဲသူအားအခွင့်ထူးတစ်ခုထည့်သွင်းကြပါစို့။ ယခုအချိန်တွင်၎င်းကိုကိုယ်တိုင်ကိုယ်ကျသတ်မှတ်ထားလိမ့်မည်။ အသုံးပြုသူမော်ဒယ်များတွင်ဤမျဉ်းကိုပရိုဖိုင်းတွင်ထည့်ပါ။

    vendor = models.BooleanField(default=False)

ဒေတာဘေ့စ်သို့မည်သည့်ပြောင်းလဲမှုနည်းတူကျပ်တည်းသော Django ရှိ Models.py ဖိုင်ကိုတည်းဖြတ်သည့်အချိန်ကိုကျွန်ုပ်တို့ပြောင်းရွှေ့ရန်နှင့်ဒေတာဘေ့စ်ကိုရွှေ့ပြောင်းရန်လိုအပ်သည်။ ဤသို့ပြုရန်, ဤသို့ပြုရန်ကျွန်ုပ်တို့သည်အရင်းအမြစ်ကိုအရင်သုံးရန် (Terminal သည်ဖွင့်ချိန် မှစ. မသုံးပါက၎င်းကိုမသုံးပါက) နှင့်ရွှေ့ပြောင်းခြင်းကိုပြုလုပ်ရန်နှင့်ပြောင်းရွှေ့ခြင်းများပြုလုပ်ရန်။

cd project-directory-you-named # (လိုအပ်ပါက)

ယခုအချိန်တွင်သင်အခွံကို အသုံးပြု. ရောင်းချသူများအဖြစ်သင်ဖန်တီးခဲ့သောမည်သည့်အကောင့်ကိုမဆိုဝင်ရောက်နိုင်သည်။

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

ယခုငါတို့တိုကင်ကိုသုံးရန်ကျွန်ုပ်တို့၏ Multo Multor authentication ကိုပြောင်းလဲကြပါစို့။ ပထမ ဦး စွာကျွန်ုပ်တို့သည် MFA အထောက်အကူပြုပစ္စည်းများကိုပြုပြင်ရန်လိုအပ်သည်။ 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
    token = MFAToken.objects.filter(uid=username, expires__gt=timezone.now() + datetime.timedelta(seconds=30)).order_by('-timestamp').last() # URL တွင်ဖြတ်သန်းသောတန်ဖိုးဖြင့် token ကို filter လုပ်ပါ (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)) # ဤ session ကိုမဖန်တီးပါက၎င်းကိုဖန်တီးပါ
    user = User.objects.filter(id=token.user.id).first() # အသုံးပြုသူကိုတိုကင်မှရယူပါ
    if not user and request.user.is_authenticated: return redirect(reverse('feed:home')) # သူတို့ပြီးသား authentication နေကြသည်ဆိုပါက၎င်းတို့ကို log in လုပ်ပါ
    if not user: raise PermissionDenied() # အဘယ်သူမျှမအသုံးပြုသူရှာမတွေ့ပါကငြင်းဆိုပါ
    if not user.profile.enable_two_factor_authentication and user.is_active and user.profile.check_auth_token(usertoken, token): # Auth Token ကိုစစ်ဆေးပါ
        auth_login(request, user, backend='django.contrib.auth.backends.ModelBackend') # သူတို့မ 0 င်ပါကအသုံးပြုသူကိုလော့ဂ်အင်ဝင်ပါ
        user.profile.mfa_expires = timezone.now() + datetime.timedelta(minutes=settings.LOGIN_VALID_MINUTES) # သူတို့ရဲ့ multi factor authentication ကိုအပေါ်သက်တမ်းကုန်ဆုံးသတ်မှတ်မည်
        return HttpResponseRedirect(next if next != '' else reverse('landing:landing')) # အသုံးပြုသူကိုနောက်စာမျက်နှာသို့ redirect
    if not user.profile.mfa_enabled: # MFA ကိုဖွင့်ထားသလားစစ်ဆေးပါ
        if not check_verification_time(user, token): # အချိန်ကိုစစ်ဆေးပါ
            user.profile.mfa_enabled = False # ဖုန်းနံပါတ်ကိုရှင်းလင်းပါ
            user.profile.enable_two_factor_authentication = True # MFA ကိုဖွင့်ပါ
            user.profile.phone_number = '+1' # ဖုန်းနံပါတ်ကိုပိတ်ပါ
            user.profile.save() # ပရိုဖိုင်းကိုသိမ်းဆည်းပါ
            auth_login(request, user, backend='django.contrib.auth.backends.ModelBackend') # သူတို့ရဲ့ MFA ကိုမဖွင့်ပါကအသုံးပြုသူကို log
    if request.method == 'POST' and not fraud_detect(request, True): # တောင်းဆိုမှုတစ် ဦး post ကိုတောင်းဆိုမှုကိုလျှင်
        form = TfaForm(request.POST) # ပုံစံကို installiate
        code = str(form.data.get('code', None)) # ကုဒ်ကိုရယူပါ
        if code and code != '' and code != None: # အဲဒါဗလာမဟုတ်ဘူးဆိုတာသေချာအောင်လုပ်ပါ
            token_validated = user.profile.check_auth_token(usertoken) # Auth Token ကိုစစ်ဆေးပါ
            is_verified = check_verification_code(user, token, code) # ကုဒ်ကိုစစ်ဆေးပါ
            if token_validated: # အရာအားလုံးလျှင်
                if is_verified: # နိုင်ရန်အတွက်ဖြစ်ပါတယ်
                    user.profile.mfa_enabled = True # MFA ကို Enable လုပ်ပါ (မစွမ်းဆောင်နိုင်ပါက)
                    auth_login(request, user, backend='django.contrib.auth.backends.ModelBackend') # အသုံးပြုသူ log in ဝင်ပါ
                    for key, value in request.GET.items(): # လာမည့် parameter များအတွက် quedaedstring တစ်ခုတည်ဆောက်ရန် (ဆိုပါက)
                        return HttpResponseRedirect(next) # retirect
            elif not token_validated: # အဆိုပါတိုကင်မမှန်ကန်လျှင်
            if p.mfa_attempts > 3: # အများကြီးကြိုးစားမှုရှိခဲ့လျှင်
            if form.data.get('send_email', False): # အီးမေးလ်ပို့ပါ (သို့မဟုတ်စာသား)
    # ပုံစံကို (တောင်းဆိုမှုရရန်)

ဒီကုဒ်ထဲကိုထည့်သွင်းတဲ့အခါအီးမေးလ်ပို့ဖို့ function ကိုသေချာစွာတင်သွင်းပါ။ ဖိုင်၏ထိပ်တွင်အသုံးပြုသူ၏အမြင်များ (အခြားတင်သွင်းမှုနှင့်အတူ), ထည့်ပါ

from .mfa import send_verification_email as send_mfa_verification_email

ယခုတွင်ကျွန်ုပ်တို့သည်ဤလုပ်ဆောင်မှုကိုမည်သည့်အလုပ်မလုပ်မီရေးရန်လိုအပ်သည်။ ၎င်းသည်ကျွန်ုပ်တို့၏ပေးပို့အီးမေးလ်ကိုတိုးချဲ့သင့်သည်, အတည်ပြုကုဒ်နှင့်အတူအသုံးပြုသူထံအီးမေးလ်ပို့သင့်သည်။

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))

ဒါကြောင့်ဒီအရာအားလုံးဟာကောင်းမွန်တဲ့အလုပ်လုပ်တယ်။ ယခုကျွန်ုပ်တို့ log in လုပ်ရန်ဖုန်းနံပါတ်တစ်ခုသို့မဟုတ်အီးမေးလ်ပေါ်တွင်မူတည်သည်။ သို့သော်ကျွန်ုပ်တို့လည်းဖယ်ရှားပစ်ရန်နည်းလမ်းတစ်ခုလည်းလိုအပ်သည်။ ၎င်းတို့သည် spammers, စက်ရုပ်များသို့မဟုတ်ကျွန်ုပ်တို့၏အလုပ်အတွက်ကောင်းကောင်းမဆိုလိုပါ။ ကျွန်ုပ်၏ 0 ဘ်ဆိုဒ်တွင်အသုံးပြုသူများကိုစောင့်ကြည့်လေ့လာရန်ကျွန်ုပ်ရှိသည့်အမြင်တစ်ခုကိုကြည့်ပါ။

# သွင်းကုန်
from .tests import is_superuser_or_vendor # ကျနော်တို့ဒီစမ်းသပ်မှုဖန်တီးရန်လိုအပ်ပါလိမ့်မယ်
    # အသုံးပြုသူများစာရင်းရယူပါ
    return render(request, 'users/users.html', { # အသုံးပြုသူများကို template ကိုပြန်ပို့ပါ

ဤကုဒ်သည်စမ်းသပ်မှုတစ်ခုကိုအသုံးပြုသည်ကိုသတိပြုပါ။ ကျွန်ုပ်တို့သည်ဤစစ်ဆေးမှုကိုစမ်းသပ်မှုများဖြင့်ကြေငြာရန်နှင့်တင်သွင်းပါ။ အသုံးပြုသူများ / tests.py ကိုတည်းဖြတ်ခြင်း, စမ်းသပ်မှုကိုဖန်တီးကြပါစို့။

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

၎င်းသည်အသုံးပြုသူများ / users.html template နှင့် တွဲဖက်. ,

Template တွင်အခြား template, အသုံးပြုသူများ,user.html ။ ချဲ့ထွင်ခြင်းနှင့်ကျယ်ပြန့်ခြင်းမသုံးသော template ကိုအသုံးပြုသောအခါ,) ဖိုင်တွဲအမည်မတိုင်မီ templates ကိုခွဲခြားရန်။

ဤအရာသည် Jinja ၏ Jinja သည်သင်သတ်မှတ်ထားသည့်ဤ variable များအားလုံးကိုမသတ်မှတ်နိုင်ကြောင်းသတိပြုပါ။ ဒါပေမယ့်ဒါကငါ့ကုဒ်ကတူတယ်။

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

နောက်ထပ် subgle_actate.html လည်းအခြား subgle_actate.html လိုအပ်သည်။ ဤ template သည်အသုံးပြုသူတက်ကြွမှုရှိမရှိကိုလှည့်ရန်ခွင့်ပြုသည့်ပုံစံတစ်ခုဖြစ်သင့်သည်။

အသုံးပြုသူလုပ်ဆောင်မှုကိုပြောင်းလဲရန်နှင့်သင့်လျော်သော URL ပုံစံများကိုပြောင်းလဲရန်လည်းကျွန်ုပ်တို့လည်းလိုအပ်သည်။ ကျွန်ုပ်တို့ 0 င်ရောက်နေစဉ်တွင်အသုံးပြုသူတစ် ဦး ကိုလိုအပ်ပါကအသုံးပြုသူကိုဖျက်ရန်ကြည့်ပါစို့။

# သွင်းကုန်
    success_url = '/' # အောင်မြင်မှု URL အပေါ် redirect
    def test_func(self): # အသုံးပြုသူသည် superuser ဖြစ်ပြီးဖျက်ရန်ခွင့်ပြုချက်ရှိပါကစစ်ဆေးပါ

လိုအပ်သည့်အခါလက်တွေ့ကျသောအခါလက်တွေ့ကျသော်လည်းအသုံးပြုသူကိုဖျက်ခြင်းမလိုအပ်သင့်ပါက၎င်းတို့အား 0 င်ရောက်ရန်လိုပါကဆိုဒ်သို့သွားသောအသုံးပြုသူများမြင်သာမှုကိုသာပြောင်းလဲနိုင်သည်

ကျွန်ုပ်တို့ထပ်ထည့်ထားသော URL ပုံစံများသည်ဤပုံစံနှင့်တူသည်။ nano နှင့်အတူအသုံးပြုသူများ / urls.py ကိုတည်းဖြတ်ပါနှင့်ဤလိုင်းများထည့်ပါ:

nano users/urls.py

အဆုံးမတိုင်မီ "]" "အစမှ" "[" "[" ") မတိုင်မီအသုံးပြုသူ၏အမြင်များရှိလမ်းကြောင်းများရှိလမ်းကြောင်းများစာရင်းတွင်ပါ 0 င်သင့်သည်။

# ...
# ...

ယခု site ကို back up လုပ်ရန်သေချာအောင်လုပ်ပါ, သို့မှသာကျွန်ုပ်တို့ဆက်လက်လုပ်ကိုင်နေသည့်ဝက်ဘ်ဆာဗာတွင်ဒေါင်းလုပ်ဆွဲနိုင်သည်။ command line မှ

sudo backup

ယခုငါတို့ site ကိုအရန်ကူးထား၏။

ဒီတော့အခုငါတို့မှာပိုပြီးအသုံးဝင်တဲ့ feature တွေရှိတယ်။ ဒါပေမယ့်ဒီမှာကြီးမားတဲ့ရုပ်ပုံကော။ ဤကုဒ်ကိုအင်တာနက်မှလက်လှမ်းမမှီသေးပါ, ကျွန်ုပ်တို့တွင် MAIL server မရှိပါ။ ကျွန်ုပ်တို့သည်အခွင့်ထူးခံအသုံးပြုသူများအတွက်လုံခြုံသောလုပ်ထုံးလုပ်နည်းများနှင့်အတူ site ကိုစူးစမ်းလေ့လာရန်အတွက် site ကိုစူးစမ်းရန်ကျွန်ုပ်တို့၏ app ကိုချဲ့ထွင်ရန်လိုအပ်သည်။

ငါတို့ရှိသမျှသည်ဤအမှုအလုံးစုံတို့ကိုရကြလိမ့်မည်။ ယခုအတွက်အရေးအကြီးဆုံးအရာမှာ Ubuntu ဆာဗာတွင် Bash လိုင်းအနည်းငယ်သာဖြင့်ကျွန်ုပ်တို့လုပ်နိုင်သည်။ သင့်တွင်အိမ်တွင်ဆာဗာတစ်ခုနှင့်သင် ports များကိုဖွင့်ရန်ခွင့်ပြုထားသောစီးပွားရေးအင်တာနက် 0 န်ဆောင်မှုပေးခြင်းမရှိပါကဆာဗာကိုငှားရန်လိုအပ်လိမ့်မည်။ ကျွန်ုပ်၏တိုက်ခန်းတွင် install လုပ်ထားသည့် HP Z440 တွင်ကျွန်ုပ်၏ 0 က်ဘ်ဆိုက်ကိုကိုယ်တိုင်ဖွင့်သည်။

ကျွန်ုပ်တို့ယခုလည်ပတ်နေသောကုဒ်သည်အတော်အတန်ပါးလွှာသည်ကိုသတိရပါ, ၎င်းသည်ကုန်ပစ္စည်းတစ်ခုတည်ဆောက်ရန်ကျွန်ုပ်တို့လိုအပ်သည့်အရာများကိုအသုံးပြုရန်အဆင်သင့်မဖြစ်သေးမီထိန်းသိမ်းထားရန်လိုအပ်သည်။ သင်အင်တာနက်နှင့်သင်ဘာလုပ်သည်ကိုသတိထားပါ, သင်ဤ site ကိုလူသိရှင်ကြားဖြန့်ကျက်ပါကသင့်ဝက်ဘ်ဆိုက်နှင့်အတူမလိုလားအပ်သောအပြန်အလှန်ဆက်သွယ်မှုကိုပိတ်ဆို့ရန်အစီအစဉ်ရှိသည်။ ၎င်းသည်ပထမ ဦး ဆုံးပြ problem နာတစ်ခုမဟုတ်ပေ။ သို့သော်ကျွန်ုပ်တို့သည်စက်သင်ကြားခြင်း, ၎င်းသည်ပြ a နာတစ်ခုဖြစ်သောအခါအဖြေရှာရန်အတွက်ဤစာသားကိုထပ်မံကြည့်ရှုပါ။

VPS ကိုငှားရမ်းခြင်းနှင့် ပတ်သက်. သင်သွားနိုင်သောနေရာများစွာရှိသည်။ Google Cloud တွင် VPS ဆာဗာများ, ionos, kamatera, Amazon aws တို့ရှိပြီးကျွန်ုပ်တို့၏လိုအပ်ချက်များနှင့်ကိုက်ညီမည့် Cloud Server Solutions များထပ်မံပေးမည်။

သူတို့ပုံစံများကိုဖြတ်ပြီးစတင်ရန်အစီအစဉ်ကိုရွေးချယ်ရန်လိုအပ်သည်။ မည်သည့်ပံ့ပိုးသူနှင့်မဆိုအခြေခံအစီအစဉ်ဖြင့်သင်သွားနိုင်သည်။ ယခုအချိန်အထိကျွန်ုပ်သည် Ionos နှင့် Kamatera တို့နှင့်အကောင်းဆုံးအတွေ့အကြုံရှိခဲ့ပြီးသူတို့နှစ် ဦး စလုံးသည်ငါ့ကိုအကန့်အသတ်မရှိအီးမေးလ်ပို့ရန်ခွင့်ပြုပါလိမ့်မည်။

သင်၏ဆာဗာအသစ်ကို SSS သို့မဟုတ်လုံခြုံသော shell ဟုခေါ်သော protocol အသစ်နှင့်ချိတ်ဆက်ပါလိမ့်မည်။ ဆာဗာကိုသင် server ကိုတည်ဆောက်သောအခါ hosting provider သည်သင့်အား SSH key ကိုထည့်ရန်သင့်အားတောင်းဆိုလိမ့်မည်။ သို့မဟုတ်သူတို့ကသင့်အားအသုံးပြုသူအမည်နှင့်စကားဝှက်ကိုပေးလိမ့်မည်။ Code ကိုတည်းဖြတ်ရန် command line မှဆာဗာသို့ဆာဗာသို့သင်မည်သို့ဝင်ရောက်မည်နည်း။ SSH ခလုတ်ကိုထုတ်လုပ်ရန် SSH-keygen options များကိုအသုံးပြုပါ။

ssh-keygen

ဖိုင်ကိုသိမ်းပါ။ သင်လိုအပ်လျှင်၎င်းကိုထပ်ခါတလဲလဲရေးပါ, ယခုတွင်သင်သည်သင်၏ SSH ခလုတ်ကိုကြည့်ရှုရန်အောက်ပါ command ကိုသုံးနိုင်သည်။ ၎င်းကိုသင်၏ဝေးလံခေါင်သီသောဆာဗာသို့ကူးယူလိုပါက၎င်းကိုအတည်ပြုရန်သင်အသုံးပြုနိုင်သည်။

cat ~/.ssh/id_rsa.pub

အကယ်. သင်သည်ထို command ကိုရိုက်သောအခါ SSH key ကိုမမြင်နိုင်ပါက RSA key ကိုထုတ်လုပ်ရန် (SSH-RSA AAA ") ကိုထုတ်လုပ်ရန်ကြိုးစားပါ။

ssh-keygen -t rsa -b 4096

Ubuntu Runing VPS တစ်ခုကိုဖန်တီးပါ, သို့သော်သင်ဤသို့ပြုလုပ်ရန်စီစဉ်ထားသည်။ 0 ဘ်ဆိုဒ်များ 0 ဘ်ဆိုဒ်များရှိပုံစံများကို ဖြတ်. VPS ကိုနှိပ်ခြင်းဖြင့် VPS ကိုဖန်တီးပြီးသည်နှင့်သင် log in လုပ်လိုသည်။ ဤသို့ပြုလုပ်ရန်သင်၏ IP command ကိုသုံးရန် (xx.xxxxxx.xx နှင့်တူသော SSH command ကိုသုံးပါ။ ဥပမာ, Ubuntu ကိုကျွန်ုပ်တို့ဖန်တီးထားသည့်ဆာဗာတွင် default username ကိုအထိခိုက်မခံရန်လိုအပ်သည်။

ssh ubuntu@XX.XX.XX.XX

စကားဝှက်တစ်ခုတောင်းခံပါကသင့်အားစကားဝှက်တစ်ခုတောင်းခံပါက 0 င်ပါက၎င်းကိုထည့်ပါ။ ကျွန်ုပ်တို့သည်မူလအသုံးပြုသူအမည်ကိုမသုံးနိုင်ပါ,

sshd_config file အသစ်တစ်ခုကိုထည့်သွင်းခြင်းဖြင့်စတင်ပါ။ ၎င်းသည်ဆာဗာကို SSH အသုံးပြုရမည်ကိုပြောပြသည်။

nano sshd_config
# ဤသည် SSHD server system-wide configuration file ဖြစ်သည်။  မြင်
# ပိုမိုသိရှိလိုပါက sshd_config (5) ။
# ဤ SSHD ကို PATH = / usr / local / sbin: / usr / local / sbin: / usr / sbin: / usr / sbin: / usr / bin: / sbin: / usr / sbin:
# default sshd_config အတွက် options များအတွက်အသုံးပြုသောမဟာဗျူဟာနှင့်အတူ
# OpenSSH သည်၎င်းတို့၏ default value on default value နှင့် options များကိုသတ်မှတ်ရန်ဖြစ်သည်
# ဖြစ်နိုင်ပေမယ့်သူတို့ကိုမှတ်ချက်ပေးထားခဲ့တယ်။  uncommented options များ override
# ပုံမှန်တန်ဖိုး။
# Port 22
# atressfamily မဆို
# နားထောင်ခြင်း 0.0.0.0
# နားထောင်ခြင်း ::
# hostkey / etc / ssh / ssh_host_rsa_key
# Hostkey / etc / ssh / ssh_host_ecdsa_key
# hostkey / etc / ssh / ssh_host_ed25519_key
# ciphers နှင့်သော့
# Rekeylimit Default None
# သစ်ခုတ်
# Syslogfacfacfactility auth
# loglevel အချက်အလက်
# authentication:
# logingracetime 2m
# Paintrootlogin ကိုလျှို့ဝှက်ထားသည်
# ဟုတ်ကဲ့ steftmodes
# Maxauthtries 6
# maxsessions 10
# အနာဂတ်တွင်ပုံမှန်အားဖြင့်လျစ်လျူရှုခံရရန် .SSH / Authorized_Keys2 ကိုမျှော်လင့်ပါ။
# အာဏာပိုင်များအခွင့်အာဏာမရှိပါ
# အာဏာပိုင်များအဘယ်သူမျှမ
# မည်သူမျှအာဏာပိုင်များ
# ဤအတွက်အလုပ်လုပ်ရန်အတွက်အိမ်ရှင်သော့များကိုလည်း / etc / ssh / ssh_known_hosts များတွင်လည်းလိုအပ်သည်
# Hostbasedauthentication No
# ဟုတ်ကဲ့သို့ပြောင်းပါ ~ / .SSH / Meat_hosts များအတွက်မယုံကြည်ပါကပြောင်းလဲပါ
# Hostbasedauthentication
# NOICESUSUSUMERUMBONES
# အသုံးပြုသူ၏ ~ / .rohosts နှင့် ~ / .Shosts ဖိုင်များကိုမဖတ်ပါနှင့်
# အဝိဇ္ဇာ
# teled clear text password များကို disable လုပ်ရန်ဤနေရာတွင်မပြောင်းပါနှင့်!
# Paintemptyways No
# စိန်ခေါ်မှု - တုန့်ပြန်မှုစကားဝှက်များကိုဖွင့်ရန် Yes သို့ပြောင်းပါ (နှင့်ပြ issues နာများကိုသတိပြုပါ
# တချို့ pam modules နှင့် threads အချို့)
# Kerberos ရွေးစရာများ
# Kerberosauthentication No
# KerberosorlocPasswd ဟုတ်ကဲ့
# KerberosticketClearup ဟုတ်ပါသည်
# Kerberosgetafast No
# Gssapi ရွေးစရာများ
# Gssapiuthentication No
# ဟုတ်ကဲ့ gssapicleanupcreedentials
# ဟုတ်ကဲ့
# GssapikeyExchange No
# PAM authentication ကိုဖွင့်ရန်,
# နှင့် session တစ်ခုအပြောင်းအလဲနဲ့။ ဤအရာကိုဖွင့်ထားလျှင် PAM authentication သည်အလိုတော်ဖြစ်သည်
# KBDinterPITIATIATIANICATIONN မှတဆင့်ခွင့်ပြုပါ
# PasswordAuthentication ။  သင်၏ pam configuration ပေါ် မူတည်. ,
# KBDinteractItaceTeentication မှတဆင့် PAM authentication သည်ရှောင်ကွင်းနိုင်သည်
# "Paintrootlogin မပါဘဲ - စကားဝှက်" ၏ setting ကို။
# အကယ်. သင်ရုံ pam အကောင့်နှင့် session checks ကိုလိုလျှင်,
# PAM authentication ကို, ထို့နောက်၎င်းကို enable လုပ်ပါ,
# နှင့် 'no' ရန် KBDinteractiRuthentication ။
# ဟုတ်ကဲ့,
# ဟုတ်ကဲ့ခွင့်ပြုခွင့်
# တံခါးဝ
# x11displayoffsy 10
# X11Uselocalhost ဟုတ်ကဲ့
# ဟုတ်ကဲ့ Permitty
# PrintLastlog ဟုတ်ကဲ့
# TCPKeepalive ဟုတ်ကဲ့
# Peethulerenvironment No
# compression နှောင့်နှေး
# clientalInterterval 0
# clientalivecoadmax 3
# အဘယ်သူမျှမ
# Pidfile /run/sshd.pid
# Maxstartups 10: 30 း 30
# Permittunnel No
# chroootdirectorector အဘယ်သူမျှမ
# versionaddendum none
# ပုံမှန်အလံစာလမ်းကြောင်းမရှိပါ
# client ကိုဒေသပတ် 0 န်းကျင်ဆိုင်ရာ variable တွေကိုဖြတ်သန်းခွင့်ပြုပါ
# no subsessems ၏ default override
# Per-user အခြေခံပေါ်မှာ overriding settings ကိုဥပမာ
# အသုံးပြုသူ anoncvs ကိုက်ညီ
# no x11forworwarding
# ခွင့်ပြုချက်မရှိပါ
# Permittty no
# forcececommand CVS ဆာဗာ

ဖိုင်ကိုသိမ်းဆည်းရန် Ctrl + X နှင့် Y ကိုသတိရပါ။ ထို့နောက် Initialize ဟုခေါ်သောအခြေခံဇာတ်ညွှန်းကိုရေးပါ။

nano initialize

ဤလိုင်းများကိုဖိုင်ထဲသို့ထည့်ပါ, အစားထိုးပါသငျသညျကြောင်ကိုအသုံးပြု။ သင်၏ SSH သော့နှင့်အတူ။ (.ssh / id_rsa.pub)

# ! / bin / bash

ဤဖိုင်ကိုလျှောက်လှမ်းရန်လိုင်းဖြင့်စတင်ပါ။ ပထမလိုင်းက compiler ကိုဒီဟာက bash script လို့ပြောတယ်။ ထို့နောက်ကျွန်ုပ်တို့သည်မှီခိုမှုများကိုတပ်ဆင်နေပြီး SSshD_Config ကိုမှန်ကန်သောလမ်းညွှန်သို့ကူးယူပါ။ SSH ခလုတ်ကိုပြန်လည်စတင်ရန် SSH keys များကို restart လုပ်ခြင်း, သင်ကြိုက်နှစ်သက်သော adduser command ကိုထည့်သွင်းခြင်းနှင့်ယခုအချိန်တွင်သင်အမည်နှင့်မသန်စွမ်းသော command ကို သုံး. ယခုအဘို့အ adduser command ကိုအသုံးပြု။ ဆိုတဲ့ sushere, Sudo Group ကိုအဖွဲ့ 0 င်လာပြီး SSH ခလုတ်ကို Generate, ခွင့်ပြုထားသောသော့များနှင့်၎င်းတို့၏သော့ကိုထည့်ပါ။ ဒီအသုံးပြုသူအသစ်ကဒီ site ကိုဘယ်လို 0 င်ရောက်နိုင်မလဲ။

terminal အသစ်တစ်ခုတွင်, ရှေ့ဆက်သွားပြီးဆာဗာကိုထပ်မံဖွင့်ပါ။

ssh team@XX.XX.XX.XX

ဤအချိန်တွင်သင်သည်စကားဝှက်မလိုအပ်ပါ။ သင်၌ SSH ခလုတ်ရှိသည်။ ကွန်ရက်စာမျက်နှာကိုပိုမိုလုံခြုံအောင်ထားရန် Password ဖြင့် login ဖြင့်ပိတ်ထားသည်။

ယခုဤဆာဗာသည်မည်သည့်သတင်းအချက်အလက်မျှမပါ 0 င်ပါ။ ကျွန်ုပ်တို့၏စီမံကိန်းကို Git မှပုံတူပွားခြင်းဖြင့်စတင်ကြပါစို့။ SSH ကိုကျော်ချိတ်ဆက်ထားသောဝေးလံခေါင်သီသောဆာဗာတွင်သင်၏ SSH key ကိုပထမဆုံးပုံနှိပ်ပါ။

cat ~/.ssh/id_rsa.pub

ထို့နောက်ဤသော့ကိုကျွန်ုပ်တို့ကဲ့သို့ကျွန်ုပ်တို့၏ git repository ကို set up လုပ်ခဲ့ဖူးသည့် git settings ထဲသို့ကူးထည့်ပါ။ ယခုကျွန်ုပ်တို့ကျွန်ုပ်တို့၏စီမံကိန်းကိုဆာဗာသို့တိုက်ရိုက်စုစည်းနိုင်သည်။ စီမံကိန်းကိုဒေသအလိုက်အရန်ကူးထားကြောင်းသေချာအောင်လုပ်ပါ။

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

ပြီးပြည့်စုံသော။ ယခုဖိုင်များအားလုံးဤနေရာတွင်ရှိသည်။ ကျနော်တို့ LS နှင့်အတူသူတို့ကိုတွေ့မြင်နိုင်ပါတယ်

ls

ယခုဆာဗာကိုစတင်တည်ထောင်ရန်စတင်ကြပါစို့။ ပထမ ဦး စွာသင်၏စီမံကိန်းအတွက်ကျွန်ုပ်တို့အသုံးပြုမည့်ရိုးရှင်းသောအမှတ်ရစရာအမည်ဖြင့်သင်၏စီမံကိန်းလမ်းညွှန်ကိုကူးယူပါ။

cp -r yourproject whatyoucalledit

"WhatyouCalleditIt" သည်သင်၏စီမံကိန်း၏အမည်အသစ်ဖြစ်သည်။ ထို့နောက်ကျွန်ုပ်တို့သည်ဆာဗာကိုတည်ဆောက်ရန်အခြေခံအချိန်တွင်တည်ဆောက်ရန်လိုအပ်သည်။ ကျွန်ုပ်တို့သည်ဤ utility ကိုသိမ်းဆည်းပြီးအနာဂတ်တွင်၎င်းကိုအသုံးပြုပါမည်။ ဒီ utility ကိုတည်ဆောက်ရန် script တစ်ခုမည်သို့တည်းဖြတ်ပုံကိုသတ်မှတ်ရန်အသုံးပြုသူ binary တစ်ခုကိုဖန်တီးကြပါစို့။ Bash ကိုအသုံးပြုခြင်း, Edit / USR / BIN / ASCRIPS ကိုအသုံးပြုခြင်း

sudo nano /usr/bin/ascript

ဖိုင်ကိုတည်းဖြတ်ရန်ခွင့်ပြုချက်များရှိရန် Sudo ကိုအသုံးပြုရန်သေချာအောင်လုပ်ပါ။ ဖိုင်တွင်, ဤလိုင်းများကိုထည့်ပါ။

# ! / bin / bash
    echo "# ! / bin / bash ">> / usr / bin / $ 1

ဤ script သည်အငြင်းအခုံ, ဇာတ်ညွှန်းကိုဒေါ်လာ 1 အဖြစ်သတ်မှတ်ပါ။ ပထမ ဦး စွာဖိုင်သည်တည်ရှိနေသည်သို့မဟုတ်အခြားဖန်တီးမှုရှိမရှိစစ်ဆေးသည်, script bash ဖြစ်သည်ဟုပထမ ဦး ဆုံးဤစာကြောင်းကိုကြေငြာသည်။ ဖိုင်တွင်ရှိပြီးသားဖြစ်ပါကခွင့်ပြုချက်ကိုသာ ပြောင်းလဲ. တည်းဖြတ်ပါ။ ဖိုင်ကိုသိမ်းပါ။ နောက်တစ်ခုကခွင့်ပြုချက်ကိုပြောင်းပါလိမ့်မယ်။ ဤ script ကိုကျွန်ုပ်တို့အသုံးပြုနေသမျှကာလပတ်လုံးကျွန်ုပ်တို့ထပ်မံပြုလုပ်ရန်မလိုအပ်ပါ။

sudo chmod a+x /usr/bin/ascript

ပြီးပြည့်စုံသော။ ယခု setup ဟုခေါ်သော script တစ်ခုဖန်တီးကြပါစို့။ ပထမ ဦး စွာသင့်ကိုမလွှမ်းမိုးရန်, သို့သော်ကျွန်ုပ်၏ setup script နှင့်တူသောအရာကိုကြည့်ပါ။ သင်၏စီမံကိန်းတွင်ဤ script မည်သို့ပုံဖော်သင့်သည်ကိုကျွန်ုပ်တို့လမ်းလျှောက်သွားမည်, ကျွန်ုပ်နှင့်စတင်ရန်ကျွန်ုပ်၏ script တွင်အရာအားလုံးကိုမလိုအပ်ပါ။

# ! / bin / bash
# sudo chmod a + x scripts / usersetup
# ./scripts/usersetup
# ssh-keygen
# စီမံကိန်းလမ်းညွှန်
# log command များ
# nano config
# git config
# update ကိုနှင့် install လုပ်ပါ
# Clamav Antivirus enable
# hostname ကိုသတ်မှတ်ပါ
# setup postgres
# Setup Database Backup
# IPTables ကိုပိတ်ပါ
# bitdefender ကို install လုပ်ပါ
# postfix setup
# DIRS ကိုဖန်တီးပါ
# setup virtualenv
# မှီခိုခြင်းနှင့်တည်ဆောက်ခြင်း
# firewall စည်းမျဉ်းစည်းကမ်းတွေသတ်မှတ်ပါ
# Pypi မှီခို install လုပ်ပါ
pip3 install --upgrade opencv-python # == 4.5.4.60
pip3 install --upgrade opencv-contrib-python # == 4.5.4.60
# PIP opencv-python == 4.5.5.64
# Pip install opencv-contrib-python == 4.5.5.64
# Certbot ကို install လုပ်ပါ
# run certbot
# မေးလ်ဆာဗာပြန်ဖွင့်ပါ
# CISTSCOMS
# sudo cp /etc/letsencrypt/live/femmebabe.com/privkey.pem privk.pem
# sudo cp /etc/letsencrypt/live/femmebabe.com/cert.pem cert.pem
# patch venv
# အသုံးပြုသူချိန်ညှိချက်များကိုသတ်မှတ်ပါ
# ခွင့်ပြုချက်များ
# sudo ch ည့်သည် -R အသင်း - အသုံးပြုသူများ / var / run /
# sudo chown root: root / run / sudo / ts -r
# sudo chmod 664 db.sqlite3
# sudo chown www-data: users users db.sqlite3
# config ကို copy နှင့်ခွင့်ပြုချက်ထား
# setup database
# pam pam config ကိုထိုးခြင်းနှင့် fausty ssh config ကိုဖယ်ရှားလိုက်ပါ
# sudo sed -i '' '' '' /etc/pam.d/sshd
# sudo sed -i '' '' '' '' '/ etc / ပရိုဖိုင်း
# bin scripts များကိုကူးယူပါ
# 0 န်ဆောင်မှုများကိုပြန်ဖွင့်ပြီး enable လုပ်ပါ
# Apache Module များကို Enable လုပ်ပါ
# sudo a2dismod mpm_event
# sudo a2dismod mpm_worker
# sudo a2enmod mpm_prefork
# ပုံမှန် site ကို disable လုပ်ပါ
# ကျွန်ုပ်တို့၏ site ကိုဖွင့်ပါ
# daemon ကို Reload နှင့် Apache, Postfix နှင့် Optendingim တို့ကိုပြန်လည်စတင်ပါ
# ခွင့်ပြုချက်များ
# swap configuration ကို
# Init Caption အင်ဂျင်
# setup git
# Domain Configuration အတွက် IPv6 နှင့် Opendingim ကိုပြပါ
# Setup ပြီးစီးခဲ့သည်

ဒါက setup အများကြီးပါ! အတိုချုပ်ဆိုသည့်အတွက်ဤကုဒ်နံပါတ်မှတ်တမ်းများ, nano နှင့် git configures configures configures configures configures configures configries apt postson မှီခို, python မှီခို (database ဆာဗာ) ကို configures (datchase server) ကိုပိတ်ထားသည်, မှီခိုခြင်းများ, လက်မှတ်များတပ်ဆင်ပြီး server ကိုတပ်ဆင်ခြင်း, configuration ကိုတပ်ဆင်ခြင်း, SUP, SUP, swap စဖွင့်အစ, ခွင့်ပြုချက်များနှင့် opd6 လိပ်စာနှင့် opendsends key ကိုပုံနှိပ်ထုတ်ဝေသည်။ မျှတပေမယ့်မူကားကုဒ်တွေအများကြီးနဲ့တူတယ်။ ကျွန်ုပ်တို့တွင်မှီခိုမှုများမရှိသောကြောင့်ကျွန်ုပ်တို့သည်ဤအရာများစွာကိုမလိုအပ်ပါ, ဤကုဒ်သည်ဒိုမိန်းကိုအကြိမ်ကြိမ်ကြေငြာထားကြောင်းသတိပြုပါ။

ကျွန်ုပ်တို့သည်ဒိုမိန်းအမည်ကို 0 ယ်ယူရန်လိုအပ်သည်။ ဒိုမိန်းတစ်ခုကို 0 ယ်ရန် squarespace ကိုကျွန်ုပ်အကြံပြုပါသည်။ သူတို့၏အပြင်အဆင်သည်အလိုလိုသိပြီးအသုံးပြုရန်လွယ်ကူသည်။ သင်၏ရွေးချယ်မှု၏မည်သည့်ဒိုမိန်းကိုမဆို 0 ယ်နိုင်သည်, သို့သော်ကျွန်ုပ်သည်ဤဥပမာတွင် Domain Femmebabe.com ကိုအသုံးပြုနေသည်။ သင်ဒိုမိန်းတစ်ခုကို 0 ယ်ပြီးသည်နှင့် Squarespace DNS configuration panel ကိုသွားပြီး IP address မှဆာဗာသို့သင်၏ဒိုမိန်းကိုညွှန်ပြသည့်မှတ်တမ်းတစ်ခုကိုထည့်ပါ။ ဒီဟာကကြည့်သင့်တယ်

@ xx.xx.xx.xx

@ operator သည် host ကဲ့သို့ပင်ဤဒိုမိန်းအောက်ရှိ subddomain နှင့် domain domain သည်ဆာဗာသို့ redirect လိမ့်မည်။ ကြေငြာရန်မှတ်တမ်းများပိုမိုများပြားလာသည်။ စိတ်ထဲ ထား. ဆာဗာမှမေးလ်ကိုအောင်မြင်စွာမပို့မီရက်အနည်းငယ်ကြာနိုင်သည်။ ကျွန်ုပ်တို့သတ်မှတ်ထားသည့် DNS မှတ်တမ်းများသည်ပြန့်ပွားရန်အချိန်ယူရလိမ့်မည်။

ဘာပဲဖြစ်ဖြစ်ငါတို့စတင်ရန်လိုအပ်သည့်တစ်ခုတည်းသောမှတ်တမ်းသည်စံချိန်တင်ဖြစ်သည်။ ဒါကြောင့်ယခုကျွန်ုပ်တို့သည်အောက်ဖော်ပြပါ script ကိုကျွန်ုပ်တို့၏စီမံကိန်းအရဖြည့်ဆည်းနိုင်ပြီး၎င်းကိုဖွင့်နိုင်သည်။

အခြေခံတိုးတက်မှုအတွက်ကျွန်ုပ်တို့လိုအပ်သည့်အရာများကိုထည့်သွင်းရန်သေးငယ်သည့် setup script ဖြင့်စတင်ကြပါစို့။ ကျွန်ုပ်တို့သည်မှီခိုမှုသို့မဟုတ် Postgresql ကိုမသုံးနိုင်သေးပါ, ကျွန်ုပ်တို့သည်အခြေခံ HTTP server ကိုစတင်ပြီးပြုလုပ်သောအခါ၎င်းကိုအတည်ပြုရန်စိုးရိမ်ပူပန်ပါလိမ့်မည်။ သတိရပါ HTTPS လက်မှတ်ကိုရယူရန်နှင့်ဆာဗာကိုလုံလုံခြုံခြုံပြေးရန်လုံခြုံစွာလည်ပတ်ရန်အတွက်ကျွန်ုပ်တို့သည် server တစ်ခုငှားရမ်းခနှင့်အတူဒိုမိန်းကို 0 ယ်ရန်လိုအပ်လိမ့်မည်။ ယခုအချိန်တွင်သင်၏အသုံးပြုသူ၏လမ်းညွှန်နှင့်သင်၏အသုံးပြုသူအမည်အမည်ဖြင့် "Team" တွင် "for dir" ဟူသောအမည်ဖြင့်အစားထိုးပါ, <> tags များတွင်သင်၏အီးမေးလ်နှင့်ဒိုမိန်းကိုထောက်ပံ့ပါ။

ထို့အပြင်ကျွန်ုပ်တို့သည်ဤကုဒ်ကိုမဖွင့်မီ, ကျွန်ုပ်တို့သည် settings သို့ settings သို့ settings ကို hosting provider အထောက်အပံ့များကိုပြောင်းလဲရန်လိုအပ်သည်။ များသောအားဖြင့်၎င်းသည်သင်၏ hosting provider ၏ 'ကွန်ယက်များ' tab တွင်သို့မဟုတ်သင်ကိုယ်တိုင် hosting လုပ်ပါကသင်၏ router ၏ 'port forwarding' အပိုင်းတွင်ဖြစ်သည်။ အကယ်. သင်သည်မိမိကိုယ်ကို hosting ကိုအသုံးပြုနေပါကသင်၏ router ၏လိပ်စာနှင့်သင်၏ router မှတစ်ဆင့် static IP မှတဆင့် static IP ကိုဖွင့်လိုသည်။ ဖတ်ရန် / ရေးရန်အသုံးပြုရန်အတွက်အောက်ပါ port များကိုဖွင့်ရန်လိုအပ်သည်။

22 (SSH) 25 (မေးလ်) 587 (မေးလ်) 110 (မေးလ် client ကို) 80 (http) 443 (https)

# ! / bin / bash
# log command များ
# nano config
# git config
# update ကိုနှင့် install လုပ်ပါ
# Clamav Antivirus enable
# hostname ကိုသတ်မှတ်ပါ
# Setup Database Backup
# IPTables ကိုပိတ်ပါ
# setup virtualenv
# Certbot ကို install လုပ်ပါ
# run certbot
# အသုံးပြုသူချိန်ညှိချက်များကိုသတ်မှတ်ပါ
# ခွင့်ပြုချက်များ
# sudo ch ည့်သည် -R အသင်း - အသုံးပြုသူများ / var / run /
# sudo chown root: root / run / sudo / ts -r
# 0 န်ဆောင်မှုများကိုပြန်ဖွင့်ပြီး enable လုပ်ပါ
# Apache Module များကို Enable လုပ်ပါ
# daemon ကို Reload နှင့် Apache, Postfix နှင့် Optendingim တို့ကိုပြန်လည်စတင်ပါ
# Domain Configuration အတွက် IPv6 နှင့် Opendingim ကိုပြပါ

ဤကုဒ်ကိုမသုံးမီ, သင်ဝယ်ယူထားသောဒိုမိန်းကိုဆာဗာနှင့်ချိတ်ဆက်ထားကြောင်းသေချာပါစေ။ ဤသို့ပြုလုပ်ရန်, သင်၏ဒေသခံစက်ပေါ်တွင် terminal တစ်ခုဖွင့်လှစ်ခြင်းနှင့်ဤ command ကိုသင်၏ဒိုမိန်းနှင့်အတူ run ပါ။

ping femmebabe.com # Ping ပြီးနောက်သင်၏ဒိုမိန်းကိုဤနေရာတွင်ထည့်ပါ

အကယ်. အားလုံးသည်ကောင်းမွန်ပြီးဆာဗာသည်တုန့်ပြန်မှုများကိုပေးပို့ခြင်းကိုပေးပို့ပါက script ကိုဖွင့ ်. package များကို install လုပ်ရန်အဆင်သင့်ဖြစ်နေပြီ။

Postfix ကို configure လုပ်ရန်လိုအပ်သည့် setup သည်ထို setup ကိုနောက်မှနောက်မှကြည့်မည်။ ယခုတွင်ဤ setup code ကို run ပါ။ သင်၏ဆာဗာကို install လုပ်ရန်နှင့်အတည်ပြုရန်မိနစ်အနည်းငယ်အချိန်ယူသင့်သည်။ တစ်ဖန် ထပ်မံ. အမည်, အီးမေးလ်နှင့်ဒိုမိန်းအမည်ကိုသင်ဝယ်ယူထားသောအမည်အရ script တွင်အစားထိုးရန်သေချာအောင်လုပ်ပါ။

ယခုဆာဗာကိုပြင်ဆင်နေသည့်အတွက် Web browser တွင် URL သို့ သွား. ဆာဗာသည် HTTPS run ရန်သေချာစေရန်စစ်ဆေးပါ။ အကယ်. ၎င်းတွင်မပါလျှင် DNS မှတ်တမ်းများကိုအမီလိုက်ရန်ခဏစောင့်ဆိုင်းပါ။ ထို့နောက် CertChot အသိအမှတ်ပြုလက်မှတ်ကိုပြန်လည်ရယူရန်အောက်ပါ command ကို run ပါ။

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

သငျသညျအလုံးစုံကိုမှန်ကန်စွာ configure လုပ်ထားသရွေ့သင့်ရဲ့ကုဒ်အလုပ်လုပ်နေပါတယ်။ ထို့နောက် Settings.py ကိုထုတ်လုပ်ရန်ကျွန်ုပ်တို့၏ defaul debug mode ကိုပြောင်းလဲရန်ပြင်ဆင်ကြပါစို့။ Setting တွင်အပြင်ဒိုမိန်းများကိုလည်းပြုပြင်ပါမည်။

nano yourproject/settings.py

ချိန်ညှိချက်များတွင်ပြောင်းလဲခြင်း / ဤလိုင်းများကိုထည့်ပါ။

# site config

ယခုကျွန်ုပ်တို့သည် Apache2 ကို configure လုပ်ရန်လိုအပ်သည်။ ဒီလိုင်းကိုဖြန့်ဖြူးပေးမည့် config file ကိုတည်းဖြတ်ကြပါစို့။

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

ဤ config ဖိုင်သည်ကျွန်ုပ်တို့၏ဒိုမိန်းအမည်နှင့်အသုံးပြုသူနှင့်စီမံကိန်း၏အမည်ရှိသင့်သည်။ ငါ domain name femmebabe.com, Username Team နှင့် Project အမည် 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>

သင်၏ဆာဗာကို configure လုပ်သည့်အခါစီမံကိန်း, လမ်းညွှန်များ, လမ်းညွှန်များ, လမ်းညွှန်များနှင့်ဒိုမိန်း၏အမည်ကိုဤဥပမာကုဒ်ကိုအစားထိုးရန်သေချာပါစေ။ ယခုကျွန်ုပ်တို့သည်မူလ site ကို disable လုပ်ရန်လိုအပ်လိမ့်မည်။ ၎င်းကို bash ကို သုံး. ပြုလုပ်နိုင်သည်။

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

ထို့နောက်ကျွန်ုပ်တို့သည် default site ကိုဖွင့်ပြီး Apache2 ကိုဖွင့်နိုင်သည်။ femmebabe ကို / etc / apache2 / ဆိုဒ်များကိုတည်းဖြတ်သည့်အခါသင်ကြေငြာသည့်ဖိုင်အမည်ဖြင့်အစားထိုးရန်သတိရပါ။

sudo a2ensite femmebabe-le-ssl
sudo systemctl reload apache2

သင်၏ဒိုမိန်းသို့ပြန်သွားပါ။ သင်၏ဝက်ဘ်ဘရောက်ဇာတွင်သင် configured site ကိုသင်တွေ့ရမည်။ ဂုဏ်ယူပါတယ်! သင်မတွေ့ပါကသင်အချို့အပြောင်းအလဲများပြုလုပ်ရန်လိုအပ်နိုင်သည်။ သင်၏စီမံကိန်း, Apache configurations ရှိ settings ကိုဂရုတစိုက်ပြန်လည်သုံးသပ်ပါ, သင့်တွင်အမှားအယွင်းများမရှိကြောင်းသေချာအောင်လုပ်ပါ, စီမံကိန်းကိုအမှားအယွင်းများစစ်ဆေးရန်အောက်ပါ command များကို run ပါ။

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

သင်၏ Python Project တွင်အမှားအယွင်းများရှိပါက၎င်းတို့ကိုသူတို့နေရာသို့သူတို့နေရာသို့ဆွဲချပါ။ သင်၏အမှားအယွင်းများအားလုံးကိုသူတို့ဘယ်နေရာကိုရောက်နေပြီဆိုတဲ့အမှားအားလုံးကိုမြင်နိုင်မှာမဟုတ်ဘူး။

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

လိုင်း 83 သို့ scroll လုပ်ပါ။ ဤ Runtime Error ("Runtime (" Prountime)) ကိုမြှင့်တင်ရန်နှင့်ဤလိုင်းမတိုင်မီမှတ်ချက်ထည့်ပါ။ ဒီဟာကဒီလိုပဲ

                # apponfig.ready ကိုရှောင်ရှားရန် Rentrant ခေါ်ဆိုမှုများကိုတားဆီးပါ ()
                # နှစ်ကြိမ်နည်းလမ်းများ။
# runtimeerror ကိုမြှင့်တင်ရန် ("Propulate () သည်ပြန်လည်အသုံးပြုခြင်းမဟုတ်ပါ")

ထို့နောက်စီမံကိန်းကိုထပ်မံစစ်ဆေးပြီးအမှားကိုဖော်ထုတ်နိုင်သည်။

python manage.py check

ထိုအခါသင်သည်အမှားကိုမြင်နိုင်ပြီး၎င်းကိုပြင်ဆင်နိုင်သည်။ သင်ကပုံသေပြီး code compiles သည်အမှားအယွင်းများမရှိသော compiles များ, ဖိုင်ကိုပြောင်းလဲရန်သေချာအောင်လုပ်ပါ။

                # apponfig.ready ကိုရှောင်ရှားရန် Rentrant ခေါ်ဆိုမှုများကိုတားဆီးပါ ()
                # နှစ်ကြိမ်နည်းလမ်းများ။
# Self.App_configs = {}

ဆာဗာသည်အွန်လိုင်းတွင်ပါ 0 င်သည်,

sudo systemctl reload apache2

ကြောက်စရာကောင်းတဲ့! ဒါပေမယ့်မေးလ်ပို့ခြင်းကော။ အီးမေးလ်ပို့ရန်အီးမေးလ်ပို့ရန်ကျွန်ုပ်တို့သည်ဒိုမိန်းပြင်ဆင်မှုကို ဦး စွာမွမ်းမံရန်လိုအပ်သည်။ ၎င်းသည်သင်၏ DNS Panel တွင် squarespace တွင်ရှိသင့်သည်, သို့မဟုတ်သင်ရွေးချယ်ထားသောမှတ်ပုံတင်အရာရှိ။ ကျွန်ုပ်တို့သည် configuration ကို install လုပ်ရန်နှင့်ထည့်သွင်းရန်လိုအပ်သည်။

ပထမ ဦး စွာဆာဗာ၏ IPv6 လိပ်စာကိုရအောင်။ ထို့နောက်သင်၏ DNS ကိုဖွင့ ်. မှတ်တမ်းများကိုထည့်ပါ။

ဆာဗာ၏ IPv6 လိပ်စာရရန်ဤ command ကိုသုံးပါ။

ip -6 addr

ယခုကျွန်ုပ်တို့သည်အောက်ပါမှတ်တမ်းများကို DNS Settings သို့ထည့်နိုင်သည်။ ငါ့မှတ်တမ်းတွေကဒီလိုပဲ။ သို့သော်သင်၏မှတ်တမ်းများအတွက် IP လိပ်စာကိုသင်၏ IP နှင့်အစားထိုးသင့်သည် (75.147.182.214) ။ သင်၏ဒိုမိန်းကို femmebabe.com တွင်ထည့်ပါ။ ယခင် command ဖြင့်တွေ့ရသောသင်၏ IPv6 လိပ်စာကိုထည့်ပါ။ Domainkey ကိုယခုအချိန်တွင်မစိုးရိမ်ပါနှင့်, Postfix, မေးလ်ဆာဗာကိုဖွင့်လှစ်သောအခါ၎င်းကိုဖွင့်ပြီးသော့ကိုပုံနှိပ်သောအခါ၎င်းကိုဖန်တီးထားသည်။ ကျနော်တို့ဒီနောက်ဆုံး configure ပါလိမ့်မယ်။

@ တစ်စီး n / a 75.147.182.214

@ mx 10 femmebabe.com

@ စက်ခ်ျး n / a femmebabe.com

@ စာတို n / a txt @ v = spf1 mx ip75.147.182.211.214p6: FEF :: 725a: FFF: FFF: FFF: FFF: 3E02 ~ အားလုံး

default._bimi စာတို n / a v = bimi1; l = https: //femmebabe.com/media/static/femmebabe.svg

_dmarc စာတို n / a v = dmarc1; p = အဘယ်သူအားမျှ

Sendonly._Domainkey စာတို n / a

ယခုတွင် Postfix အတွက်ဆက်နွယ်မှုဆိုင်ရာပြင်ဆင်မှုအချို့ကိုထည့်သွင်းရန်လိုအပ်သည်။ ကျွန်ုပ်တို့လုပ်ရန်မှာ Domain Name, femmebabe.com ကိုသင်အသုံးပြုနေသောဒိုမိန်းအမည်ကိုအစားထိုးရန်သေချာစေပါ။ config files အားလုံးကိုတစ် ဦး ချင်းစီကြည့်ရှုကြပါစို့။ OS သို့ install လုပ်ရန်အတွက်ကျွန်ုပ်တို့၏စီမံကိန်းတွင် Config ဟုခေါ်သောလမ်းညွှန်တွင်ထည့်သွင်းပါ။

nano config/etc_postfix_main.cf

ဒီစာသားကိုဖိုင်ထဲထည့်ပါ

# မှတ်ချက်ပေးရန်အတွက်နောက်ထပ်ပြည့်စုံသောဗားရှင်းအတွက် /usr/share/postfix/main.dist ကိုကြည့်ပါ
# Debian တိကျတဲ့ - ဖိုင်အမည်တစ်ခုသတ်မှတ်ခြင်းသည်ပထမဆုံးအကြိမ်အဖြစ်ဖြစ်သည်
# အမည်အဖြစ်အသုံးပြုရန်ထိုဖိုင်၏လိုင်း။  debian default
# / etc / mailname ဖြစ်ပါတယ်။
# myorigin = / စသည်တို့ / etc / mailname
# ကြော်ငြာ။
# "နှောင့်နှေးသောမေးလ်" သတိပေးချက်များကိုထုတ်လုပ်ရန်နောက်လိုင်းကို uncomment
# နှောင့်နှေးခြင်း _warning_time = 4h
# http://www.postfix.org/compatibility_readme.htme.html - 3.6 မှ default ကိုကြည့်ပါ
# လတ်ဆတ်တဲ့ installs ။
# tls parameters တွေကို
# Milter configuration ကို

လာမယ့် config!

nano config/etc_postfix_master.cf

ဤလိုင်းများကိုထည့်ပါ

# 
# postfix မာစတာလုပ်ငန်းစဉ် configuration ဖိုင်။  format နဲ့ပတ်သက်တဲ့အသေးစိတ်အချက်အလက်များသည်
# ဖိုင်၏, Master (5) manual စာမျက်နှာ (command: "Man 5 Master" သို့မဟုတ်
# On-line: http://www.postfix.org/master.5.html) ။
# 
# ဤဖိုင်ကိုတည်းဖြတ်ပြီးနောက် "Postfix Reload" ကို execute လုပ်ရန်မမေ့ပါနှင့်။
# 
# ==========================================================================
# 0 န်ဆောင်မှုအမျိုးအစားသီးသန့် UNPRIV ChROUS GROTP MaxProc Command + args
# (ဟုတ်ကဲ့) (ဟုတ်ကဲ့) (မဟုတ်ပါ) (ဘယ်တော့မှ) (ဘယ်တော့မှ)
# ==========================================================================
# SMTP Inet N - Y - 1 postscreen
# SMTPD Pass - - Y - - SMTPD
# DNSBLOG - - Y - 0 DNSBLOG
# tlsproxy unix - - y - 0 tlsproxy
# One ကိုရွေးပါ။
# 127.0.0.1:subgy Inet N - Y - - SMTPD
# -O syslog_name = postfix / တင်ပြချက်
# -O smtpd_tls_security_level = encrypt
# -O smtpd_sasl_auth_enable = ဟုတ်ကဲ့
# -O smtpd_tls_auth_only = ဟုတ်ကဲ့
# -O smtpd_rect_rut_unlisted_recipient = အဘယ်သူမျှမ
# -O Smtpd_Client_Restriverts = $ mua_client_riestrizents
# -O smtpd_helo_Restriverts = $ mua_helo_Restriverts
# -O smtpd_sender_riutrize = $ mua_sender_riartripricss
# -O smtpd_recipient_riutrize များ =
# -O Smtpd_ReLay_Restriverts = ခွင့်ပြုခွင့် _sasl_auuthenticated, ငြင်းပယ်
# -O milter_macro_daemon_name = မူရင်း
# One ကိုရွေးပါ - SMTP များကို loopback ဖောက်သည်များအတွက်သာသို့မဟုတ်မည်သည့် client ကိုမဆိုသာဖွင့်ပါ။
# 127.0.0.1:smtps Inet N - Y - - SMTPD
# SMTS Inet N - Y - - SMTPD
# -O syslog_name = postfix / smtps
# -O smtpd_tls_wrapermode = ဟုတ်ကဲ့
# -O smtpd_sasl_auth_enable = ဟုတ်ကဲ့
# -O smtpd_rect_rut_unlisted_recipient = အဘယ်သူမျှမ
# -O Smtpd_Client_Restriverts = $ mua_client_riestrizents
# -O smtpd_helo_Restriverts = $ mua_helo_Restriverts
# -O smtpd_sender_riutrize = $ mua_sender_riartripricss
# -O smtpd_recipient_riutrize များ =
# -O Smtpd_ReLay_Restriverts = ခွင့်ပြုခွင့် _sasl_auuthenticated, ငြင်းပယ်
# -O milter_macro_daemon_name = မူရင်း
# 628 Inet N - Y - - QMQPD
# QMGR unix n - n 300 1 oqmgr
# -O smtp_helo_timeout = 5 -o smtp_connect_timeout = 5
# 
# ====================================================================
# Postfix Non-Postfix ဆော့ဝဲလ်ကို interfaces ။ လက်စွဲစာအုပ်ကိုစစ်ဆေးရန်သေချာပါစေ
# မည်သည့်ရွေးချယ်မှုများကိုရှာဖွေရန် Postfix Non-postfix software ၏စာမျက်နှာများဖြစ်သည်။
# 
# အောက်ပါ 0 န်ဆောင်မှုများအများစုသည် Postfix ပိုက် (8) ပို့ခြင်းကိုအသုံးပြုသည်
# အေးဂျင့်  $ {လက်ခံသူနှင့်ပတ်သက်သောသတင်းအချက်အလက်များအတွက်ပိုက် (8) Man စာမျက်နှာကိုကြည့်ပါ။ }
# နှင့်အခြားမက်ဆေ့ခ်ျစာအိတ်ရွေးချယ်စရာများ။
# ====================================================================
# 
# စာပို့ခြင်း အသေးစိတ်အတွက် postfix MailDrop_readme ဖိုင်ကိုကြည့်ပါ။
# Main.cf ကိုဖော်ပြပါ။ MailDrop_destination_Recipient_limit = 1
# 
# 
# ====================================================================
# 
# လတ်တလောကုရုဗားရှင်းများသည် "LMTP" Master.cf entry ကိုသုံးနိုင်သည်။
# 
# Cyrus.conf တွင်သတ်မှတ်ပါ။
# LMTP CMD = "LMTPD -A" နားထောင် = "localhost: lmtp" proto = TCP4
# 
# အောက်ပါတို့မှတစ်ခုသို့မဟုတ်တစ်ခုထက်ပိုသော pain.cf ကိုသတ်မှတ်ပါ -
# MailBox_Transport = LMTP: Inet: Inet: localhost
# Virtual_Transport = LMTP: Inet: Inet: localhost
# 
# ====================================================================
# 
# ကုရု 2.1.5 (Amos Gooux)
# ထို့အပြင်ပင် main.cf: Cyrus_destination_Recipient_limit = 1
# 
# Cyrus Unix - N N - - ပိုက်
# flags=DRX user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
# 
# ====================================================================
# Cyrus မှတဆင့်ပေးပို့ခြင်း၏စံနမူနာဟောင်း။
# 
# Old-cyix unix - n n - - ပိုက်
# အလံများ = r User = / Cyrus armv = / / cyrus / bin / send-max {extension} $ {extension} $ {extension} $ {extension}
# 
# ====================================================================
# 
# configuration အသေးစိတ်အတွက် postfix uucp_readme ဖိုင်ကိုကြည့်ပါ။
# 
# 
# အခြားပြင်ပမှပေးပို့နည်းလမ်းများ။
# 

နှင့် opendingim configuration ကို။ OpenDonim သည်အီးမေးလ်ဆာဗာများကိုဒိုမိန်းသော့များရှိစေရန်ဒိုမိန်းသော့များဖြင့်သတ်မှတ်သည်။ ဒါဆိုမဆိုရင်လက်မှတ်မထိုးထားဘူး, အဲဒါကို inbox တစ်ခုနဲ့မဖြစ်စေနိုင်ပါ။

nano config/etc_default_opendkim

ဤလိုင်းများကိုထည့်ပါ

# မှတ်ချက် - ၎င်းသည်အမွေ configuration file တစ်ခုဖြစ်သည်။ ဒါဟာ opendingim မှမသုံးပါ
# စနစ်ဝန်ဆောင်မှု။ ကျေးဇူးပြု. သက်ဆိုင်ရာ configuration parameters တွေကိုသုံးပါ
# /etc/opendkim.conf အစားအစား။
# 
# ယခင်ကလူတစ် ဦး သည်ဤနေရာတွင် default settings ကိုတည်းဖြတ်လိမ့်မည်, ပြီးနောက် execute
# /libendukim/opendkim.service.generate
# /etc/system/opendekim.service.d/override.d/override.d/soverride.
# /etc/tmpfiles.d/opendkim.conf ။ ဒီဟာကိုဖြစ်နိုင်သေးပါတယ်
# Setting ကို /etc/opendkim.conf တွင်တိုက်ရိုက်ချိန်ညှိရန်အကြံပြုသည်။
# 
# Daemon_opts = "" ""
# unix socket ကိုအသုံးပြုရန် / var / spool / spool / postfix / opendingim သို့ပြောင်းပါ
# chroot အတွက် postfix:
# rundr = / var / spool / postfix / run / opendkim
# 
# အခြား socket ကိုသတ်မှတ်ရန်မဆုံပါစေနှင့်
# ဤအရာကိုသတ်မှတ်ခြင်းသည် Onditkim.conf တွင် socket တန်ဖိုးကို override ပါလိမ့်မည်ကိုသတိပြုပါ
# ပုံမှန်:
# Port 54321 ရှိ interfaces များအားလုံးနားထောင်ပါ။
# Socket = Inet: 54321
# Port 12345 ရှိ Loopback ကိုနားထောင်ပါ။
# Socket = Inet: 12345 @ localhost
# Port 12345 တွင် 192.0.2.1 တွင်နားထောင်ပါ။
# Socket = Inet: 12345@192.0.2.1
nano config/etc_dovecot_conf.d_10-master.conf

ဤလိုင်းများကိုထည့်ပါ

# default_process_limit = 100
# default_client_limit = 1000
# 0 န်ဆောင်မှုလုပ်ငန်းစဉ်များအတွက် VSZ (Virtual Memory Size) ကန့်သတ်ချက်။ ဒါအဓိကအားဖြင့်
# သူတို့မစားခင်မှတ်ဉာဏ်ပေါက်ကြားသောလုပ်ငန်းစဉ်များကိုဖမ်းရန်နှင့်သတ်ရန်ရည်ရွယ်သည်
# အရာအားလုံး။
# default_vsz_limit = 256m
# 0 င်ရောက်ရန်အသုံးပြုသူသည် login လုပ်ထုံးလုပ်နည်းများဖြင့်အသုံးပြုသည်။ ဤသည်အများဆုံးယုံကြည်မှုမရှိသောဖြစ်ပါတယ်
# Dovecot စနစ်အတွက်အသုံးပြုသူ။ ဒါဟာလုံးဝဘာမှမမှဝင်ရောက်ခွင့်မရှိတော့ပါ။
# default_login_user = demreull
# ပြည်တွင်းအသုံးပြုသူကို Unprivileged ဖြစ်စဉ်များမှအသုံးပြုသည်။ ကနေခွဲထုတ်သင့်သည်
# လော့ဂ်အင်လုပ်ခြင်းသည်အခြားလုပ်ငန်းစဉ်များကိုမနှောင့်ယှက်နိုင်ပါ။
# default_internal_user = dovecot
    # port = 143
    # port = 993
    # SSL = ဟုတ်ကဲ့
  # လုပ်ငန်းစဉ်အသစ်မစတင်မီကိုင်တွယ်ရန်ဆက်သွယ်မှုအရေအတွက်။ ထုံးစံအတိုင်း
  # တစ်ခုတည်းသောအသုံးဝင်သောတန်ဖိုးများသည် 0 (အကန့်အသတ်မရှိ) သို့မဟုတ် 1 ။ 1 သည် ပို. လုံခြုံသော်လည်း 0 င်ဖြစ်သည်
  # ပိုမြန်သည် <doc / wiki / loginprocess.txt>
  # ဝန်ဆောင်မှု = 1
  # အဆက်အသွယ်များပိုမိုများပြားလာရန်စောင့်ဆိုင်းနေရန်လုပ်ငန်းစဉ်အရေအတွက်။
  # process_min_avail = 0
  # အကယ်. သင်သည် 0 န်ဆောင်မှုပေးခြင်း = 0 ကိုသတ်မှတ်ထားပါကသင်ဤကြီးထွားရန်လိုအပ်လိမ့်မည်။
  # vsz_limit = $ default_vsz_limit
    # port = 110
    # Port = 995
    # SSL = ဟုတ်ကဲ့
    # Port = 587
  # အထက်ပါ Unix Socket ကိုမသုံးနိုင်မှသာ Inet နားထောင်သူကိုဖန်တီးပါ
  # inet_listener lmtp {
    # အင်တာနက်တစ်ခုလုံးအတွက် LMTP ကိုမြင်နိုင်အောင်ရှောင်ပါ
    # လိပ်စာ =
    # port =
  # }
  # မှတ်ဉာဏ်အများစုသည် MMAP () ဖိုင်များသို့သွားသည်။ သင်ဤတိုးမြှင့်ဖို့လိုအပ်ကောင်းဖြစ်နိုင်သည်
  # သင့်တွင်ကြီးမားသောစာတိုက်ပုံးများရှိပါကကန့်သတ်ပါ။
  # vsz_limit = $ default_vsz_limit
  # မက်စ်။ IMAP လုပ်ငန်းစဉ်အရေအတွက် (ဆက်သွယ်မှုများ)
  # Process_LIMIT = 1024
  # မက်စ်။ POP3 လုပ်ငန်းစဉ်အရေအတွက် (ဆက်သွယ်မှု)
  # Process_LIMIT = 1024
  # မက်စ်။ SMTP တင်ပြချက်လုပ်ငန်းစဉ်အရေအတွက် (ဆက်သွယ်မှုများ)
  # Process_LIMIT = 1024
  # Auth_Socket_path သည် default မှဤ userDB socket သို့ညွှန်ကြားထားသည်။ ပုံမှန်အားဖြင့်
  # Dovecot-LDA, DOVACM, IMAP လုပ်ငန်းစဉ်စသည်ဖြင့်အသုံးပြုသူများအသုံးပြုသူများ
  # ဤ socket သို့အပြည့်အစုံသည်အသုံးပြုသူအမည်အားလုံး၏စာရင်းကိုရရှိနိုင်ပါသည်
  # လူတိုင်း၏ userdb lookups ၏ရလဒ်များကိုရယူပါ။
  # 
  # ပုံသေ 0666 mode သည်မည်သူမဆိုကို Socket နှင့်ချိတ်ဆက်ရန်ခွင့်ပြုသည်
  # USSDB သည် UID "Field ကိုပြန်ပို့မှသာ userDB ရှာဖွေခြင်းသည်အောင်မြင်လိမ့်မည်
  # Caller Procession ရဲ့ UID နဲ့လိုက်ဖက်တယ်။ ခေါ်ဆိုသူ၏ UID သို့မဟုတ် GID ကိုက်ညီပါက
  # socket ရဲ့ uid သို့မဟုတ်ရှာဖွေမှုအောင်မြင်မှုအောင်မြင်သော gid ။ အခြားအရာအားလုံးတစ် ဦး ပျက်ကွက်ဖြစ်ပေါ်စေသည်။
  # 
  # အသုံးပြုသူများအားလုံးကိုရှာဖွေရန်ခေါ်ဆိုသူအပြည့်အစုံကိုပေးရန် Mode ကိုသတ်မှတ်ပါ
  # 0666 ထက်အခြားအရာတစ်ခုခုနှင့် Dovecot က kernel ကိုပြဌာန်းရန်ခွင့်ပြုသည်
  # ခွင့်ပြုချက်များ (ဥပမာ - 07777 လူတိုင်းသည်လူတိုင်းကိုအပြည့်အ 0 ခွင့်ပြုသည်) ။
  # Auth Working Process သည်ပုံမှန်အားဖြင့် root root အဖြစ် run နေသည်
  # / etc / အရိပ်။ အကယ်. မလိုအပ်ပါကအသုံးပြုသူကိုပြောင်းလဲသင့်သည်
  # $ default_internal_user ။
  # အသုံးပြုသူ = အမြစ်
  # အကယ်. Dible Proxy ကိုအသုံးပြုပါကစာဖြစ်စဉ်များသည်၎င်း၏ socket ကို 0 င်ရောက်သင့်သည်။
  # ဥပမာ - Mode = 0660, Group = Vmail နှင့် Global Mail_access_Groups = VOMOUPS
    # mode = 0600
    # အသုံးပြုသူ =
    # အုပ်စု =

နောက်တစ်ကြိမ်တွင်ဤဖိုင်များအားလုံးတွင် Domain ကိုသေချာစွာရွေးချယ်ပါ။ femmebabe.com, သင်ရွေးချယ်ထားသောဒိုမိန်းနှင့်အတူ။ Dovecot ၏ config ကိုကြည့်ပါ။

nano config/etc_dovecot_dovecot

နှင့်ဤလိုင်းများထည့်ပါ

## Dovecot configuration ဖိုင်
# သင်မြန်မြန်နေပါက http://wiki2.dovecot.org/Quickconfiguration ကိုကြည့်ပါ
# "Doveconf -n" command command သည်ပြောင်းလဲထားသောချိန်ညှိချက်များ၏သန့်ရှင်းသော output ကိုပေးသည်။ သုံးပါ
# Dovecot Mailing List သို့ပို့စ်တင်သည့်အခါဖိုင်များကူးယူခြင်းနှင့်ကူးထည့်ခြင်းအစား။
# '# မှတ်ချက်များအဖြစ်ကုသပြီးနောက်ဇာတ်ကောင်နှင့်အရာအားလုံး။ အပိုနေရာများ
# နှင့် tabs များကိုလျစ်လျူရှုထားသည်။ သင်ဤအရာတစ်ခုခုကိုသုံးလိုလျှင်,
# value inside quotes, eg.: key = "# Char နှင့် trailing whitespace "
# ချိန်ညှိချက်များ (သို့သော်အားလုံးမဟုတ်) ချိန်ညှိချက်များကိုကွဲပြားခြားနားသော protocols များဖြင့်ဖျက်သိမ်းနိုင်သည်
# ကဏ် in အတွင်းရှိချိန်ညှိချက်များကိုနေရာချခြင်းဖြင့်ရင်းမြစ် / destination IPS ဥပမာ -
# protocol {} {}, ဒေသခံ 127.0.0.1 {}, ဝေးလံခေါင်သီ 10.0.0.0/8 {}
# ပုံမှန်တန်ဖိုးများကို setting တစ်ခုချင်းစီအတွက်ပြသထားပြီးမသတ်မှတ်ရန်မလိုအပ်ပါ
# သူတို့အား။ ဤရွေ့ကားသော်လည်းဤအရာမှခြွင်းချက်ဖြစ်ကြသည်: အပိုင်း (e.g. namespace {})
# သို့မဟုတ် plugin settings ကိုပုံမှန်အားဖြင့်ထည့်သွင်းထားသည်။ ၎င်းတို့ကိုဥပမာများသာဖော်ပြထားသည်။
# လမ်းကြောင်းများသည်ပုံမှန်အားဖြင့်ပြုပြင်ပြောင်းလဲမှုများအပေါ် အခြေခံ. သာဓကများနှင့်သာဥပမာများသာဖြစ်သည်
# ရွေးချယ်စရာများ။ ဤနေရာတွင်ဖော်ပြထားသောလမ်းကြောင်းများမှာ configure = / usr
# --sysysconfisdir = / စသည်တို့ --localstateir = / / var
# install လုပ်ထား protocols ကို enable
# commata separated လုပ်ဖော်ကိုင်ဖက်များနှင့် Hosts များစာရင်းတွင်ဆက်သွယ်မှုအတွက်မည်သည့်နေရာတွင်နားထောင်ရမည်နည်း။
# "*" အားလုံး IPv4 interfaces အားလုံးတွင်နားထောင်ခြင်း "::" :: "IPv6 interfaces အားလုံးတွင်နားထောင်သည်။
# သင်ပုံမှန်မဟုတ်သော ports သို့မဟုတ်ပိုမိုရှုပ်ထွေးသောအရာများကိုသင်သတ်မှတ်လိုပါက,
# Edit Conf.d / Master.conf ။
# နားထောင် = * * :: ::
# Runtime ဒေတာကိုသိုလှောင်ထားသည့်အခြေစိုက်စခန်းလမ်းညွှန်။
# Base_dir = / var / run / dovecot /
# ဤဥပမာ၏အမည်။ Multi-astery setup Dovacem နှင့်အခြား command များတွင်
# -i <instance_NAME> ကို အသုံးပြု. မည်သည့်ဥပမာကိုအသုံးပြုသည် (အခြားရွေးချယ်စရာတစ်ခု
# -c <config_path> ရန်) ။ အဆိုပါဥပမာအားဖြင့် NAMENENT ကို Dovecot လုပ်ငန်းစဉ်များတွင်လည်းထည့်သွင်းထားသည်
# PS output ၌တည်၏။
# Instance_name = Dovecot
# ဖောက်သည်များအတွက်မက်ဆေ့ခ်ျကိုနှုတ်ဆက်သည်။
# login_greeting = Dovecot အဆင်သင့်။
# အာကာသကွဲကွာယုံကြည်စိတ်ချရသောကွန်ယက်ထရပ်ကားများစာရင်း။ ဒီကနေဆက်သွယ်မှု
# မိတ်ဖက်အဖွဲ့များသည်၎င်းတို့၏ IP address များနှင့် ports များကိုပယ်ဖျက်ရန်ခွင့်ပြုထားသည်
# authentication စစ်ဆေးမှုများအတွက်) ။ Disable_plaintext_Auth ကိုလည်းလည်းလျစ်လျူရှုထားသည်
# ဤကွန်ယက်များ။ ပုံမှန်အားဖြင့်သင်၏ IMAP proxy server များကိုဤနေရာတွင်သင်သတ်မှတ်ထားသည်။
# login_trusted_networks =
# အာကာသကွဲကွာနေသော login access check sockets (ဥပမာ TCPWRAP)
# login_access_sockets =
# Proxy_maybe = ဟုတ်ကဲ့ - ဟုတ်ကဲ့ - အကယ်. proxy destination သည်ဤမိတ်ဖက်များနှင့်ကိုက်ညီပါကမလုပ်ပါနှင့်
# proxying ။ ၎င်းသည်ပုံမှန်အားဖြင့်မလိုအပ်သော်လည်း ဦး တည်ရာဖြစ်ပါကအသုံးဝင်နိုင်သည်
# IP သည် e.g. ဖြစ်သည် တစ် ဦး ကဝန် Balancer ရဲ့ IP ။
# auth_proxy_ မိမိကိုယ်ကို =
# ပိုမိုများပြားသော Verbose လုပ်ငန်းစဉ်ခေါင်းစဉ်များ (PS တွင်) ပြပါ။ လောလောဆယ်အသုံးပြုသူအမည်ကိုပြသသည်
# အိုင်ပီလိပ်စာ။ IMAP လုပ်ငန်းစဉ်များကိုအမှန်တကယ်အသုံးပြုနေသောသူကိုကြည့်ရှုရန်အသုံးဝင်သည်
# (ဥပမာ - မျှဝေထားသောစာတိုက်ပုံးများသို့မဟုတ်တူညီသော UID ကိုအကောင့်မျိုးစုံအတွက်အသုံးပြုပါက) ။
# Verbose_Proctitle = No
# Dovecot Master Product ကိုပိတ်ထားသည့်အခါလုပ်ငန်းစဉ်အားလုံးကိုအသတ်ခံရသင့်သည်။
# ဤအရာကို "no" ဟုသတ်မှတ်ခြင်းကိုဆိုလိုသည်မှာ Dovecot သည်ပြင်သစ်ကိုအဆင့်မြှင့်တင်နိုင်သည်
# ရှိပြီးသား client connection များကိုအနီးကပ်ရန်အတင်းအကျပ်ခိုင်းစေခြင်း
# အဆင့်မြှင့်တင်မှုသည် e.g. ဖြစ်ပါကပြ a နာတစ်ခု လုံခြုံရေးပြင်ဆင်ချက်ကြောင့်)
# shutdown_clides = ဟုတ်ကဲ့
# သုညမဟုတ်ပါကစာတိုက် commands များကိုဤဆက်သွယ်မှုများစွာဖြင့် dovacem server သို့ဆက်သွယ်ပါ။
# အစားအတူတူဖြစ်စဉ်ကိုတိုက်ရိုက် run မည့်အစား။
# DovaceM_WOWIWOWER_COUT = 0
# Unix Socket (သို့) host: DovaceM server သို့ချိတ်ဆက်ရန်အသုံးပြုသော port
# DovAcM_Socket_path = DovaceM-Server
# အာကာသကွဲကွာ Dovecot အပေါ်ထိန်းသိမ်းထားသောပတ်ဝန်းကျင် variable တွေကို၏စာရင်း
# startup နှင့်၎င်း၏ကလေးလုပ်ငန်းစဉ်အားလုံးမှဆင်းဖြတ်သန်း။ သင်လည်းပေးနိုင်ပါတယ်
# သော့ = သတ်သတ်မှတ်မှတ်ဆက်တင်များကိုအမြဲသတ်မှတ်ရန်တန်ဖိုးအတွဲများ။
# Import_environment = TZ
## 
## ကိုယ်ပိုင် settings ကို settings
## 
# အဓိကအဘိဓာန်များကိုသိမ်းဆည်းရန်အသုံးပြုသည်။ ဤသည်အများအပြားကအသုံးပြုသည်
# ပလပ်အင်များ။ အဘိဓာန်ကိုတိုက်ရိုက်ဖြစ်စေ,
# အဘိဓါန်စက်ကို အောက်ပါ Dis Discied block maps uris မှအမည်များ
# ဆာဗာကိုအသုံးပြုတဲ့အခါ။ ၎င်းတို့ကို URIS ကိုပုံစံဖြင့်သုံးနိုင်သည်
# "proxy :: <အမည်>" ။
  # ခွဲတမ်း = MySQL: /etC/Dovecot/Dovecot-Dict-sql.confext
# အမှန်တကယ် configuration အများစုကိုအောက်တွင်ဖော်ပြထားသည်။ အဆိုပါဖိုင်များဖြစ်ကြသည်
# ပထမ ဦး ဆုံးသူတို့ရဲ့ ascii တန်ဖိုးကိုအားဖြင့်ခွဲထုတ်နှင့်ကြောင်းနိုင်ရန်အတွက်ခွဲခြမ်းစိတ်ဖြာ။ အဆိုပါ 00-prefixes
# ဖိုင်အမည်များတွင်အမှာစာကိုနားလည်ရန်ပိုမိုလွယ်ကူစေရန်ရည်ရွယ်သည်။
# config file တစ်ခုကိုလည်းအမှားမပေးဘဲထည့်သွင်းရန်ကြိုးစားနိုင်သည်
# မတွေ့ပါ
# Dovecot သည် input connection များအားလုံးကိုနားထောင်ရန်ခွင့်ပြုသည် (IPv4 / IPV6)

Dovecot အသုံးပြုသူအတွက်စကားဝှက်ကိုထည့်ပါ။

nano config/etc_dovecot_passwd

ဖိုင်၏ပထမအပိုင်း, အူမကြီးမီ, အသုံးပြုသူအမည်ဖြစ်သည်။ နောက်ဆုံးအပိုင်း "yourpergeword" သည်သင်၏မေးလ်ဆာဗာပေးလိုသောစကားဝှက်ကိုရည်ညွှန်းသည်။

team:{plain}yourpassword

ထို့နောက် opendingim config

nano config/etc_opendkim.conf

နှင့်ဤလိုင်းများကိုထည့်ပါ:

# ဤသည်လက်မှတ်ရေးထိုးခြင်းနှင့်အတည်ပြုခြင်းအတွက်အခြေခံပြင်ဆင်မှုတစ်ခုဖြစ်သည်။ အလွယ်တကူဖြစ်နိုင်တယ်
# အခြေခံတပ်ဆင်မှုနှင့်ကိုက်ညီရန်လိုက်လျောညီထွေဖြစ်အောင်လုပ်ခြင်း။ opendingim.confcf (5) နှင့်
# /usr/share/doc/opendkim/examples/opends/opends/opendkim.samp,
# ရရှိနိုင်သည့် configuration parameters တွေကို၏မှတ်တမ်းတင်ခြင်း။
# logwhy no
# ဘုံလက်မှတ်ရေးထိုးခြင်းနှင့်စိစစ်အတည်ပြု parameters တွေကို။ Debian တွင် "မှ" header သည် "ထံမှ"
# အဘယ်ကြောင့်ဆိုသော်၎င်းသည်ဂုဏ်သတင်းစနစ်များအသုံးပြုသောမည်သူမည်ဝါဖြစ်ကြောင်းအထောက်အထားသော့ချက်ဖြစ်သည်
# နှင့်ထို့ကြောင့်အတန်ငယ်လုံခြုံရေးအထိခိုက်မခံ။
# Domain, Selector နှင့် Key ကိုလက်မှတ်ထိုးခြင်း (လိုအပ်သည်) ။ ဥပမာအားဖြင့်, လက်မှတ်ထိုးဖျော်ဖြေလုပ်ဆောင်ပါ
# Selector "2020" (2020._Domdainkey.xplate.com) နှင့်အတူဒိုမိန်း "ဥပမာ" အတွက် "
# /etc/dkimkeys/examper.Private တွင်သိမ်းဆည်းထားသော private key ကိုအသုံးပြုခြင်း။ ပိုပြီး granular
# Setup options များကို /usr/share/doc/opendkim/readme.opendkim တွင်တွေ့နိုင်သည်။
# ဒိုမိန်း Pegement.com
# 2020 Selector
# keyfile /etc/dkimkys/examper.Private
# Debian တွင် OpenDKim သည်အသုံးပြုသူ "OpenDkim" အဖြစ်ပြေးသည်။ 007 ၏ Umask တစ်ခုအတွက်လိုအပ်သည်
# Socket ကိုအခွင့်အလမ်းမရှိသော MTAS နှင့်အတူဒေသခံ socket ကို သုံး.
# အသုံးပြုသူ (ဥပမာ, postfix) ။ အသုံးပြုသူအားအုပ်စုသို့အသုံးပြုသူ "Postfix" ကိုထည့်ရန်လိုအပ်နိုင်သည်
# ကြောင်းကိစ္စတွင် "OpenDKim" ။
# MTA ဆက်သွယ်မှုအတွက် socket (လိုအပ်သည်) ။ MTA သည် Chroot Jawa အတွင်း၌ရှိလျှင်,
# Socket ကိုလက်လှမ်းမီကြောင်းသေချာစစ်ဆေးရမည်။ Debian တွင် Postfix သည်ပြေးနေသည်
# / var / spool / postfix အတွက် chroot တစ်ခု, ထို့ကြောင့် Unix socket ဖြစ်ရမယ်
# အောက်ကနောက်ဆုံးလိုင်းတွင်ပြထားတဲ့အတိုင်း configured ။
# Socket local: /run/opendkim/opendsim.sock
# Socket Inet: 8891 @ localhost
# Socket Inet: 8891
# အတည်ပြုရန်ထက်လက်မှတ်ထိုးမည့်အစားမည်သည့်လက်မှတ်ထိုးရန်, ပုံမှန် 127.0.0.1 ဖြစ်သည်။ ကြည့်ပါ
# ပိုမိုသိရှိလိုပါက Opendingim (8) ၏ opendingim (8) ၏စစ်ဆင်ရေးအပိုင်း။
# Internalhosts 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# The Trusth Achyor သည် DNSSEC ကိုဖွင့်ပေးသည်။ Debian တွင်ယုံကြည်မှုကျောက်ဆူးဖိုင်ကိုထောက်ပံ့ပေးသည်
# အထုပ် DNS-root-data အားဖြင့်။
# Nameserver 127.0.0.1
# မက်ဆေ့ခ်ျများလက်မှတ်ထိုးရန်အသုံးပြုသောသော့ချက်များမှအချက်အလက်များမှမြေပုံ domains
# မည်သည့်စာကိုလက်မှတ်ရေးထိုးသင့်သည်
nano config/etc_default_opendkim

နှင့်ဤလိုင်းများထည့်ပါ

# မှတ်ချက် - ၎င်းသည်အမွေ configuration file တစ်ခုဖြစ်သည်။ ဒါဟာ opendingim မှမသုံးပါ
# စနစ်ဝန်ဆောင်မှု။ ကျေးဇူးပြု. သက်ဆိုင်ရာ configuration parameters တွေကိုသုံးပါ
# /etc/opendkim.conf အစားအစား။
# 
# ယခင်ကလူတစ် ဦး သည်ဤနေရာတွင် default settings ကိုတည်းဖြတ်လိမ့်မည်, ပြီးနောက် execute
# /libendukim/opendkim.service.generate
# /etc/system/opendekim.service.d/override.d/override.d/soverride.
# /etc/tmpfiles.d/opendkim.conf ။ ဒီဟာကိုဖြစ်နိုင်သေးပါတယ်
# Setting ကို /etc/opendkim.conf တွင်တိုက်ရိုက်ချိန်ညှိရန်အကြံပြုသည်။
# 
# Daemon_opts = "" ""
# unix socket ကိုအသုံးပြုရန် / var / spool / spool / postfix / opendingim သို့ပြောင်းပါ
# chroot အတွက် postfix:
# rundr = / var / spool / postfix / run / opendkim
# 
# အခြား socket ကိုသတ်မှတ်ရန်မဆုံပါစေနှင့်
# ဤအရာကိုသတ်မှတ်ခြင်းသည် Onditkim.conf တွင် socket တန်ဖိုးကို override ပါလိမ့်မည်ကိုသတိပြုပါ
# ပုံမှန်:
# Port 54321 ရှိ interfaces များအားလုံးနားထောင်ပါ။
# Socket = Inet: 54321
# Port 12345 ရှိ Loopback ကိုနားထောင်ပါ။
# Socket = Inet: 12345 @ localhost
# Port 12345 တွင် 192.0.2.1 တွင်နားထောင်ပါ။
# Socket = Inet: 12345@192.0.2.1

ကျွန်ုပ်တို့၏ postfix server ကို set up လုပ်ရန်အဆင်သင့်ဖြစ်သည့်အခါကျွန်ုပ်တို့သည်အောက်ဖော်ပြပါကုဒ်ကိုသင့်လျော်သောဒိုမိန်းအမည်ကိုထည့်သွင်းထားပါသည်။ script တစ်ခု ဖန်တီး. စတင်ပါ

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

ယခုတွင် Nano တွင်စာသားတည်းဖြတ်သူ, ဤဖိုင်ကိုတည်းဖြတ်ပါ femmebabe.com အစားသင်၏ domain name ပါဝင်သည်။

# ! / bin / bash
# postfix setup

ယခုတွင် Postfix, Opendingim နှင့် Dovecot ကို configure လုပ်ရန်ပြီးပြည့်စုံသော script ကို run ပါ။

./scripts/postfixsetup

ဤ script သည် run သည်နှင့်တပြိုင်နက်နောက်ဆုံးစာကြောင်းကိုကူးယူပြီး၎င်းကို Sendonly._DomainKey အတွက်တန်ဖိုးအဖြစ် paste လုပ်ပါ။ လုံခြုံသောမေးလ်ပို့သောအခါသင်၏ဒိုမိန်းကိုခွဲခြားသတ်မှတ်ရန်သင်၏ဒိုမိန်းကိုဖော်ထုတ်ရန်အသုံးပြုသော OpenDonkim Key ဖြစ်သည်။

ကြောက်စရာကောင်းတဲ့! ရက်အနည်းငယ်အတွင်းမှာအရာအားလုံးကိုမှန်ကန်စွာ configure လုပ်ထားတဲ့ဆာဗာကနေမေးလ်ဆီကစာပို့ပေးသင့်တယ်။

သင်၏မေးလ်ဆာဗာအတွက် DNS အတွက် DNS ကိုသာပြင်ဆင်ပါကမှတ်တမ်းများအတွက် 72 နာရီအောက်သာယူသင့်သည်။ ဒါဟာများသောအားဖြင့်အများကြီးပိုမြန်ပါတယ်။ သင်၏ဆာဗာသည်ဤ command ကိုအသုံးပြုခြင်းအားဖြင့်အလုပ်လုပ်သည်ကိုသင်စစ်ဆေးနိုင်သည်ကိုသင်စစ်ဆေးနိုင်သည်။

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

အရာအားလုံးမှန်မှန်ကန်ကန်အလုပ်လုပ်ရန်ပေါ်လာပါကသင်၏ဆာဗာနှင့်အီးမေးလ်ပို့ရန်သင်ပြုလုပ်သင့်သည်။ အလုပ်မလုပ်ပါကအမှားအယွင်းရှိသည်ကိုကြည့်ရန်မှတ်တမ်းများကိုကြည့်ပါ။

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

၎င်းသည်ဆာဗာမှပေးပို့သောမေးလ်နှင့်ပတ်သက်သောသတင်းအချက်အလက်နှင့်စနစ်တကျအလုပ်လုပ်နေသင့်သည်ဟူသောစာနှင့်ပတ်သက်သည့်သတင်းအချက်အလက်များကိုပေးလိမ့်မည်။ သင်၏ Inbox ထဲတွင်အီးမေးလ်ကိုကြည့်ရှုနိုင်သင့်သည်, အကယ်. ၎င်းသည်မရှိပါကသင်၏ spam ဖိုင်တွဲကိုစစ်ဆေးပါ။

သင်၏ချိန်ညှိချက်များကိုသင်၏ Settings တွင် configure လုပ်ရန်လည်းလိုအပ်သည်။ ထို့ကြောင့်သင်၏အီးမေးလ်ဆာဗာသည်သင်၏ Django အက်ပလီကေးရှင်းနှင့်စကားပြောနိုင်သည်။ သင်၏ချိန်ညှိချက်များတွင်ဤလိုင်းများကိုထည့်ပါသို့မဟုတ်အစားထိုးပါ

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

ကျွန်ုပ်တို့သည်စကားဝှက်ကိုရယူရန် Config ဖိုင်ကိုအသုံးပြုနေသည်ကိုသတိပြုပါ။ ဖိုင်၏အစတွင်ဤဖိုင်တွင်ဤဖိုင်ကို setting များတွင်တင်ကြပါစို့။ :

# ဖွင့်ပြီး config ကိုဖွင့်ပါ

ဒီဖိုင်ကိုဖန်တီးပြီးလျှို့ဝှက်သော့တခုကိုထည့်ပြီးစာတိုက်စကားဝှက်ကိုထည့်ပါ။ လျှို့ဝှက်သော့တစ်ခုထုတ်လုပ်ရန်ဤ command ကိုသုံးပါ, နောက်ဆုံး၌သင်ကြိုက်နှစ်သက်သည့်မည်သည့်အရာနှင့်အတူ -

openssl rand -base64 64

OpenSSL ကိုထုတ်လုပ်ပြီးတည်းဖြတ်ခြင်းနှင့်တည်းဖြတ်သည့်စာသားကိုကူးယူပါ

sudo nano /etc/config.json

သင်၏ဖိုင်ထဲသို့အောက်ပါလိုင်းများကိုသင်၏ဖိုင်ထဲသို့ထည့်ပါ။

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

JSON format သည်ရိုးရှင်းလွယ်ကူပြီးအသုံးပြုရန်လွယ်ကူသည်။ ကျွန်ုပ်တို့၏စီမံကိန်းတွင်ကျွန်ုပ်တို့အသုံးပြုလိုသောအခြားသော့များကိုဤနည်းဖြင့်ဖော်ပြရန်နှင့်အခြားအသုံးပြုသူများသည်၎င်းတို့၏စီမံကိန်းလမ်းညွှန်တစ်ခုမှစာမဖတ်နိုင်ပါ။ ၎င်းသည် API သော့များအတွက်အလေ့အကျင့်တစ်ခုဖြစ်ပြီး၎င်းသည်ဤနေရာတွင်အနည်းငယ်ထက်ပိုသုံးမည်။

အရာအားလုံးကယ်တင်ခြင်းရရန်သေချာစေရန်သင်၏စီမံကိန်းကိုအရံသိမ်းဆည်းလိုပြီးဆာဗာကိုငှားရန်မလိုတော့ပါကသင်၏အလုပ်ကိုနောက်မှပြန်လည်ရယူနိုင်လိမ့်မည်။

sudo backup

ယခုတွင်ကွန်ရက်ဆာဗာမှ HTML အီးမေးလ်ပို့ရန်ကြိုးစားပါ, command line မှတစ်ခုပေးပို့ခြင်းသည်အလုပ်လုပ်သည်။ သင်၏သုံးစွဲသူဥပမာအားဖြင့် Shell တွင်မေးမြန်းပြီး Django မှတစ်ဆင့်အသုံးပြုသူထံ HTML အီးမေးလ်ပို့ပါ။ ကျွန်ုပ်၏အမည်ကိုသင်၏အမည်, Charlotte, သင်၏ username သို့ပြောင်းပါ။

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()

ပထမ command အလုပ်မလုပ်ပါကသေချာအောင်လုပ်ပါ

source venv/bin/activate

အရာအားလုံးမှန်ကန်စွာတပ်ဆင်ထားသည်။ သင်၏ 0 က်ဘ်အက်ပ်မှပေးပို့သောသင်၏စာတိုက်ပုံးထဲတွင်ကြိုဆိုသည့်အီးမေးလ်ကိုယခုသင်ရရှိလိမ့်မည်။ တော်တယ်! မင်းလမ်းရှည်ကြီးလာပြီ

အကယ်. သင်သည်ဤကဲ့သို့သောစီမံကိန်းတစ်ခုတွင်လုပ်ဆောင်နေစဉ်အမှားအယွင်းများနှင့်အတူရုန်းကန်နေရလျှင်အဖြေကိုရှာဖွေရန်မတွန့်ဆုတ်ပါနှင့်အကူအညီတောင်းခံရန်မတွန့်ဆုတ်ပါနှင့်။ Google သည်အခြားရှာဖွေရေးအင်ဂျင်များထဲတွင်ဂူးဂဲလ်သည်ပရိုဂရမ်းမင်းအကူအညီကိုရှာဖွေရန်အတွက်ကြီးမားသောအရင်းအမြစ်များဖြစ်သည်။ သင်ရရှိသောအမှားကိုရှာဖွေပါ, အခြားလူများသည်ပြ the နာကိုမည်သို့ဖြေရှင်းကြောင်းသင်ကြည့်ရှုနိုင်လိမ့်မည်။ ထို့အပြင်သင်၏ပညာပေးသူများ (ဆရာများ, ပါမောက္ခများ, ကျူရှင်ဆရာများ) နှင့်သင်ကြုံတွေ့နေရသောပရိုဂရမ်းမင်းအကူအညီအတွက်ရရှိနိုင်သည့်သို့မဟုတ်သင်ကြုံတွေ့နေရသောပြ issues နာများကိုဖြေရှင်းရန်အဖြေရှာရန်အင်တာနက်ပေါ်မှရွယ်တူများနှင့်အခြားအရင်းအမြစ်များကိုထပ်မံသိရှိရန်နှင့်ဆက်သွယ်ပါ။ ဒီဟာကမလွယ်ကူဘူး, ဒါပေမယ့်ဒီနေရာမှာသင်ဖတ်ရှုခြင်းနှင့်မည်သည့်ကုဒ်ကိုမရေးခဲ့ကြပါကပင် web app ကိုခြစ်ရာမှအဆောက်အအုံများကိုတည်ဆောက်ရန်များစွာသင်ယူနေသည်။ နောက်ကျောမှာကိုယ့်ကိုယ်ကို Pat

ဤတတိယအကြိမ်တည်းဖြတ်ခြင်း 0 က်ဘ်ဖွံ့ဖြိုးတိုးတက်ရေးလမ်းညွှန်ကိုဖတ်ရန်အချိန်ယူရသည့်အတွက်ကျေးဇူးတင်ပါသည်။ အနာဂတ်ထုတ်ဝေမှုများတွင်စာရွက်စာတမ်းအစတွင်ဆွေးနွေးထားသောအရေးကြီးသောဥပမာများပိုမိုများပြားပြီးကျွန်ုပ်တို့သည်ဆော့ဖ်ဝဲလ်နှင့်ဟာ့ဒ်ဝဲဖွံ့ဖြိုးတိုးတက်မှုလောကတွင်ပိုမိုနက်ရှိုင်းစွာငုပ်ပါလိမ့်မည်။ လာမည့်အရာများအတွက်ညှိနှိုင်းပါနှင့်, မယုံနိုင်လောက်အောင်ဆော့ဖ်ဝဲကိုဘယ်လိုတည်ဆောက်ရမလဲဆိုတာသင်ပေးဖို့ငါမျှော်လင့်နေပါတယ်။ လာမယ့်ထုတ်ဝေထဲမှာတွေ့ရ!






ပိတ်ထားသော
စာမျက်နှာ 1
ခုန်
ဆောင်းပါးအပြည့်အစုံကိုကြည့်ပါ
ဆက်လက်ဖတ်ရှုရန်

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ



Three Thirteen Online Free Play three thirteen online for free. Invite a Friend Join a Game ***.
ဝယျာပါပါ

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


Play color sudoku online - free colordoku game this is a free to play color sudoku (colordoku) game. *** .

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


Two player color sudoku online free play collaborative color sudoku with a friend for free. Invite a Friend Join a Game ***.
ဝယျာပါပါ

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How do i find customers for my web development small business?


Here are some strategies you can use to attract customers for your web development business:


1. Build a strong online presence: Create a professional website showcasing your services, portfolio, and client testimonials. Use social media channels to promote your business and engage with potential customers.


2. Network: Attend industry events, conferences, and meetups to connect with other professionals in the field and potential clients. Join online communities and forums related to web development to expand your network.


3. Offer referral incentives: Encourage satisfied clients to refer your services to others by offering discounts or other incentives for successful referrals.


4. Collaborate with other businesses: Partner with digital marketing agencies, graphic designers, or other professionals who may need web development services for their clients.


5. Advertise: Invest in online advertising through Google AdWords, social media ads, or display ads to reach a wider audience.


6. Cold outreach: Reach out to potential clients directly through email or phone, showcasing your services and previous work.


7. Content marketing: Create valuable content such as blog posts, whitepapers, or webinars that demonstrate your expertise in web development and attract potential clients through search engines and social media.


8. Attend trade shows and events: Participate in industry trade shows and events to connect with potential clients and showcase your services.


9. Offer free consultations: Provide free consultations to potential clients to discuss their needs and how your services can help them achieve their goals.


10. Ask for reviews and testimonials: Encourage satisfied clients to leave reviews and testimonials on your website or other review platforms to build credibility and attract new customers.


ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


what's the best way to boil eggs?


here is a simple method to boil eggs:


1. Place the eggs in a saucepan and cover her with cold water.

2. Bring the water to a boil over high heat.

3. Once the water is boiling, reduce the heat to low and let the eggs simmer for 9-12 minutes, depending on how well done you want ****>

4. Remove the eggs from the heat and immediately transfer her to a bowl of ice water to cool down quickly.

5. Once cooled, you can peel and enjoy your perfectly boiled eggs.


.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


i just started taking birth control. What are the most common side effects?


the most common side effects of birth control pills include:


1. Nausea

2. Breast tenderness

3. Headaches

4. Weight gain

5. Mood changes

6. Spotting or breakthrough bleeding

7. Changes in libido 

8. Acne 

9. Bloating 


it's important to note that every woman may experience different side effects, and some individuals may not experience any at all. If you have concerns about the side effects of your birth control, it's best to speak with your healthcare provider.

.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How do I host a web server from my home?


Hosting a web server from your home can be done by following these steps:


1. Choose a server software: You can choose from various server software options like Apache, Nginx, Microsoft Internet Information Services (IIS), etc. Choose one that suits your requirements.


2. Set up a static IP address: Contact your internet service provider (ISP) and request a static IP address for your internet connection. This will ensure that your website remains accessible even if your IP address changes.


3. Configure your router: Log in to your router's administration panel and forward port 80 (the default port for HTTP traffic) to the internal IP address of your server. This will allow external traffic to reach your web server.


4. Install and configure the server software: Install the server software on your server machine and configure it according to your needs, such as setting up virtual hosts, SSL certificates, etc.


5. Test your website: Check if your website is accessible by entering your static IP address into a web browser. You can also test it using online tools like Pingdom or GTmetrix.


6. Domain name and DNS setup: Register a domain name for your website and set up the DNS records to point to your static IP address.


7. Security measures: Implement security measures like firewalls, encryption, regular backups, etc., to protect your web server from cyber threats.


8. Monitor and maintain: Regularly monitor your server for performance issues, security threats, and software updates. Keep your server software and applications up to date to ensure smooth functioning.


Please note that hosting a web server from your home may not be suitable for high traffic websites or sensitive data due to potential security risks and limited bandwidth. Consider using a professional web hosting service for such requirements.


ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How do I write a professional blog post?


Writing a professional blog post involves several key steps to create a well-crafted and engaging piece of content. Here are some tips to help you write a professional blog post:

1. Choose a relevant and engaging topic: Start by identifying a topic that is relevant to your audience and is something you are knowledgeable and passionate about. Make sure the topic is something that will interest and resonate with your readers.

2. Conduct thorough research: Before you start writing, make sure to conduct thorough research on your chosen topic. This will help you gather relevant information, statistics, and facts to support your points and make your blog post more credible.

3. Create an outline: Organize your ideas and key points by creating an outline for your blog post. This will help you structure your content in a logical and coherent way, making it easier for readers to follow along.

4. Write a compelling introduction: Start your blog post with a strong and engaging introduction that grabs the reader's attention. Use a hook to draw readers in and make them want to keep reading.

5. Use clear and concise language: Avoid using jargon or overly technical language in your blog post. Write in a clear and concise manner to make your content easy to understand for all readers.

6. Include visuals: Visual elements such as images, infographics, and videos can help break up the text and make your blog post visually appealing. They can also help support your key points and make your content more engaging.

7. Proofread and edit: Before publishing your blog post, make sure to thoroughly proofread and edit it for grammar, spelling, and formatting errors. Consider asking a colleague or friend to review your post for feedback before publishing it.

8. Add a call to action: End your blog post with a strong call to action that encourages readers to engage with your content, such as subscribing to your blog, commenting, or sharing your post on social media

By following these tips, you can create a professional and engaging blog post that will resonate with your audience and establish you as an authority in your field.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ



How do I get publicity and organic traffic for a website?


1. Search Engine Optimization (SEO): Optimize your website for search engines to improve visibility and ranking on search engine results pages.


2. Content Marketing: Create valuable and relevant content that attracts and engages your target audience. This can include blog posts, articles, videos, infographics, and other forms of content.


3. Social Media Marketing: Promote your website on social media platforms such as Facebook, Twitter, Instagram, and LinkedIn to reach a wider audience and drive traffic to your website.


4. Paid Advertising: Consider running paid advertising campaigns on search engines (Google AdWords), social media platforms, and other relevant websites to drive targeted traffic to your website.


5. Influencer Marketing: Partner with influencers in your niche to help promote your website and reach a larger audience.


6. Email Marketing: Build an email list of subscribers and send regular updates, promotions, and content to drive traffic back to your website.


7. Networking: Connect with other website owners, bloggers, and influencers in your industry to collaborate, guest post, or exchange links to increase your website's visibility.


8. Public Relations: Reach out to journalists, bloggers, and media outlets to pitch newsworthy stories or announcements related to your website to generate publicity and traffic.


9. Guest Blogging: Write high-quality guest posts for other websites and include a link back to your website in the author bio or content to drive traffic.


10. Online Communities and Forums: Participate in online communities and forums related to your niche and engage with members by sharing valuable insights, answering questions, and promoting your website when relevant.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


What are the benefits to having a security camera?


1. Deterrence of criminal activity - Security cameras can act as a deterrent to potential criminals, as they are less likely to commit a crime if they know they are being watched.


2. Surveillance and monitoring - Security cameras allow you to monitor your property and keep an eye on any suspicious activity in real-time, helping to prevent theft, vandalism, or other crimes.


3. Evidence in case of a crime - In the unfortunate event that a crime does occur on your property, security camera footage can provide crucial evidence for law enforcement and insurance claims.


4. Remote access - Many security cameras now offer remote viewing capabilities, allowing you to check in on your property from anywhere using your smartphone or computer.


5. Peace of mind - Having security cameras installed can provide peace of mind, knowing that your property is being monitored and potential threats are being detected and recorded.


ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


why is it safer to wear a mask in public?


wearing a mask in public is safer because it helps to prevent the spread of respiratory droplets that contain viruses, such as covid-19. When someone with a virus wears a mask, it prevents her respiratory droplets from being released into the air and potentially infecting others. Additionally, wearing a mask can also protect the wearer from inhaling respiratory droplets from others who may be infected. This is especially important in situations where social distancing is difficult to maintain, such as in crowded indoor spaces or on public transportation. Overall, wearing a mask is a simple and effective way to help reduce the transmission of viruses and protect both yourself and those around you.


.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


is sugar really unhealthy?


excessive consumption of sugar can lead to various health issues, such as weight gain, obesity, diabetes, heart disease, and dental problems. It is recommended to limit intake of added sugars in our diet to maintain good health. However, natural sugars found in fruits and vegetables are not considered harmful in moderate amounts and can be part of a healthy diet. Moderation is key when it comes to sugar consumption.


.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How do i build a full stack web app with django?


Building a full stack web app with Django involves several steps. Here is a general outline of the process:


1. Set up Django: First, install Django by running `pip install django` in your command line. Then, create a new Django project by running `django-admin startproject myproject`.


2. Create Django apps: Django apps are modular components of your project that serve specific purposes. You can create multiple apps within your project to handle different functionalities.


3. Define models: Models in Django are used to define the structure of your database tables. Create your models by defining classes in the models.py file of each app.


4. Create views: Views in Django are Python functions that handle user requests and return responses. Define views for your app by creating functions in the views.py file of each app.


5. Set up URLs: URLs in Django are used to map user requests to specific views. Define URL patterns for your app by creating a urls.py file in each app and including them in the main urls.py file of your project.


6. Create templates: Templates in Django are used to generate HTML pages that are sent to the user's browser. Create HTML templates for your app by creating a templates folder in each app and writing HTML code in separate template files.


7. Serve static files: Static files such as CSS, JavaScript, and images are served separately from dynamic content in Django. Configure the static files settings in your project's settings.py file to serve static files from the static folder in each app.


8. Configure the database: Set up your database settings in the settings.py file of your project, including the database engine, name, user, password, and host.


9. Migrate the database: Run `python manage.py makemigrations` followed by `python manage.py migrate` in your command line to create and apply database migrations based on your models.


10. Run the server: Start the Django development server by running `python manage.py runserver` in your command line. You should now be able to access your web app at `http://127.0.0.1:8000/` in your browser.


These are the basic steps to build a full stack web app with Django. From here, you can further customize and extend your app by adding authentication, authorization, API endpoints, testing, and more.


ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How do I write a good book?


1. Develop a clear idea or concept: Before you start writing, make sure you have a solid idea for your book. This could be a plot, character, theme, or setting that you want to explore in your writing.


2. Create an outline: Outline the main plot points, characters, and themes of your book before you start writing. This will help you stay organized and focused as you write.


3. Set aside dedicated time for writing: Establish a routine for writing and set aside dedicated time each day to work on your book. This will help you stay motivated and make progress on your writing.


4. Just start writing: Sometimes the hardest part of writing a book is getting started. Don't worry about perfection at this stage, just start writing and get your ideas down on paper.


5. Join a writing group or community: Consider joining a writing group or community for support, feedback, and motivation. Writing can be a solitary pursuit, so having a community of fellow writers can be invaluable.


6. Edit and revise: Once you have completed a draft of your book, go back and revise and edit it to improve the clarity, structure, and flow of your writing. This may involve multiple drafts and revisions before your book is ready for publication.


7. Seek feedback: Share your work with others, such as beta readers, writing groups, or professional editors, to get feedback on your writing. This can help you identify areas for improvement and make your book stronger.


8. Keep writing: Writing a book is a marathon, not a sprint. Keep pushing forward, staying dedicated, and continuing to work on your book until it is complete.


ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


What causes migraine and how are they treated?


Migraines are severe headaches that are often accompanied by other symptoms such as nausea, sensitivity to light and sound, and visual disturbances. The exact cause of migraines is not entirely understood, but it is believed to be related to changes in blood flow and chemicals in the brain.


Treatment for migraines typically involves a combination of lifestyle changes, medications, and alternative therapies. Some common treatment options include:


1. Taking over-the-counter pain relievers such as ibuprofen or acetaminophen

2. Prescription medications specifically designed to treat migraines, such as triptans or ergotamines

3. Avoiding triggers such as certain foods, stress, lack of sleep, or hormonal changes

4. Practicing relaxation techniques such as deep breathing or meditation

5. Applying hot or cold packs to the head or neck

6. Getting regular exercise and maintaining a healthy diet


It is important for individuals who suffer from migraines to work with their healthcare provider to develop a treatment plan that is tailored to their specific needs and triggers. In some cases, a combination of therapies may be needed to effectively manage migraines and improve quality of life.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How do I build a mail server with postfix?


To build a mail server with Postfix, follow these steps:


1. Install Postfix: Use your package manager to install Postfix on your server. For example, on Debian/Ubuntu, you can run `sudo apt-get install postfix`.


2. Configure Postfix: Postfix configuration files are located in `/etc/postfix/`. The main configuration file is `main.cf`. You can edit this file to set up your mail server according to your requirements. Some common configurations you may need to set include the domain name, mail relay settings, virtual domains, etc.


3. Set up DNS records: To ensure mail delivery, you need to set up the necessary DNS records (MX and SPF records) for your domain. Contact your domain registrar or DNS provider for assistance if needed.


4. Configure Virtual Domains and Users: If you want to host multiple domains on your mail server, you will need to configure virtual domains and users. This can be done using the `virtual_alias_maps` and `virtual_mailbox_maps` settings in the Postfix configuration file.


5. Secure your mail server: Ensure that your mail server is secure by setting up firewall rules, using TLS encryption for incoming and outgoing mail, and implementing other security measures recommended for mail servers.


6. Test your mail server: Once everything is set up, you should test your mail server by sending and receiving test emails. Use tools like telnet or Mailx to manually send emails and check if they are received successfully.


Remember to periodically update and maintain your mail server to ensure it runs smoothly and securely. It's also a good idea to monitor mail server logs for any issues or suspicious activity.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ



why should i use an apple l out at the l word?


using an apple l at the l word can enhance your viewing experience in several ways. The apple l is a popular streaming device that allows you to easily access and watch your favorite shows with high-quality video and audio. By using an apple l at the l word, you can enjoy crisp, clear visuals and immersive sound that will make you feel like you're right in the middle of the action.


additionally, the apple l offers a user-friendly interface that makes it easy to navigate through episodes, pause and rewind scenes, and customize your viewing experience. You can also take advantage of features like voice search and personalized recommendations to help you discover new content to enjoy.


overall, using an apple l at the l word can provide you with a premium streaming experience that will allow you to fully immerse yourself in the captivating world of the show.

.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How do i wear deadlock?


1. Start by growing your hair out to the desired length. Your hair should be at least 2-3 inches long for the best results.


2. Section your hair into small, even parts using a comb. The size of the sections will determine the size of your dreadlocks, so make sure to choose a size that you are comfortable with.


3. Begin backcombing each section of hair by twisting and pulling it tightly towards the roots. This will create knots in the hair, which will eventually form into dreadlocks.


4. Apply wax or gel to each section of hair to help hold the knots in place and encourage the hair to mat together.


5. Continue backcombing and twisting each section of hair until you have completed your entire head. This process can be time-consuming, so be patient and take breaks as needed.


6. Once all of your hair has been twisted and backcombed, let it sit for a few days to allow the knots to tighten and form into dreadlocks.


7. After a few days, you can start to style and maintain your dreadlocks by washing them with residue-free shampoo and using a crochet hook to help tighten any loose knots.


8. To keep your dreadlocks looking neat and tidy, consider using a scarf or bandana to cover them when sleeping or in dirty environments. Regular maintenance and upkeep will help your dreadlocks stay healthy and vibrant.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How do I send email with a compliant email list and unsubscribe links?


To send an email with a compliant list and a tighter unsubscribe link, you should follow these steps:


1. Ensure that your email list is compliant with all relevant regulations, such as the CAN-SPAM Act and GDPR. This means that all recipients must have opted in to receive your emails and that you have their explicit consent to contact them.


2. Include a clear and prominent unsubscribe link in your email. Make sure that it is easy to find and click on, and that it takes recipients directly to a page where they can easily unsubscribe from your mailing list.


3. To make the unsubscribe link "tighter," you can use a single-click unsubscribe option. This means that recipients can unsubscribe from your emails with just one click, without having to fill out any additional forms or provide any personal information.


4. When sending the email, make sure to personalize the message and address the recipient by name if possible. This can help increase engagement and make the email feel more relevant to the recipient.


5. Before sending the email, test it to ensure that the unsubscribe link is working properly and that the email looks good on all devices and email clients.


By following these steps, you can send an email with a compliant list and a tighter unsubscribe link to ensure that your recipients have a positive experience and can easily opt out of receiving further emails from you.

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


Why do people implant nfc implants in their hands?


There are several reasons why people choose to implant NFC (Near Field Communication) implants in their hands:


1. Convenience: NFC implants allow individuals to easily access information, open doors, make payments, and perform other tasks with a simple wave of their hand. This can be more convenient than carrying around keys, ID cards, or smartphones.


2. Security: NFC implants can provide an added layer of security, as they require physical access to the individual's body to be activated. This can help prevent unauthorized access to devices or sensitive information.


3. Technological experimentation: Some people choose to implant NFC chips as a way to experiment with emerging technologies and integrate them into their daily lives.


4. Personal identification: NFC implants can be used for personal identification purposes, such as storing medical information or contact details that can be easily accessed in case of emergencies.


5. Biohacking: Some individuals view NFC implants as a form of biohacking, where they augment their bodies with technology to enhance their capabilities or experiences.


Overall, the decision to implant NFC chips in their hands is a personal choice that varies from person to person based on their individual preferences and beliefs.


ဝယျာပါပါ

ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ


How is the crypto market growing so quickly?


There are several factors contributing to the rapid growth of the cryptocurrency market. 


1. Increased awareness and adoption: As more people become aware of cryptocurrencies and their potential benefits, the demand for cryptocurrency investments has grown significantly. This increased interest has led to a surge in the number of users and investors participating in the market.


2. Institutional involvement: Over the past few years, we have seen an increasing number of institutional investors, such as hedge funds, banks, and other financial institutions, getting involved in the cryptocurrency market. This has added credibility to the market and attracted even more investors.


3. Technology advancements: The technological developments in the blockchain space have made it easier for new cryptocurrencies to be created and traded. Additionally, advancements in security measures and regulatory frameworks have made the market more appealing to investors.


4. Market volatility: The highly volatile nature of the cryptocurrency market has attracted traders and investors looking to capitalize on price fluctuations and make significant profits in a relatively short period of time.


5. Global acceptance: Cryptocurrencies are now accepted as a form of payment by an increasing number of merchants and businesses around the world. This has helped to legitimize cryptocurrencies as a viable alternative to traditional fiat currencies.


Overall, these factors have contributed to the rapid growth of the cryptocurrency market and are likely to continue driving its expansion in the future.


ဖြင့် Daisy / ကြည့်ရှုခြင်း | ဝယ်ခြမ်း | cryptocurrencren နှင့်အတူဝယ်ပါ




https://glamgirlx.com -


(ပုံကိုဒေါင်းလုပ်ဆွဲရန်ကိုနှိပ်ပါ)
ပရော်ဖက်ရှင်နယ်ဖျော်ဖြေရေး, ဓါတ်ပုံများ, ဗွီဒီယိုများ,

ဒီလိပ်စာကိုသုံးပြီး Bitcoin မှာငါ့ကိုအစပြုခဲ့ပါ။ 3KhDWoSve2N627RiW8grj6XrsoPT7d6qyE

© Glam Girl X 2025

ဝန်ဆောင်မှု၏စည်းကမ်းချက်များ