createsuperuser และการเข้าสู่ระบบ
สร้างบัญชีผู้ดูแลระบบและเข้าถึง /admin
createsuperuser และการเข้าสู่ระบบ เป็นบทเรียน Django Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Django Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Django Academy มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Meet the Admin
Django ships with a full admin site, a ready-made web dashboard for managing your data, so you never have to build a CRUD panel by hand. 🎛️
Who Can Enter
The admin is locked to staff users, so first you need an account. A superuser is an account with full permissions across the whole site.
The Magic Command
You create that account from the terminal with one management command. The createsuperuser command walks you through it step by step.
python manage.py createsuperuserAnswer the Prompts
The command asks for a username, an optional email, and a password. Type them in and your admin account is born.
Hidden Password
When you type the password it stays invisible, so the cursor will not move. That blank screen is normal, your keystrokes are still being read. 🤫
Migrate First
Auth tables must exist before an account can be saved. If you see an error, run migrate once to set up the database.
python manage.py migrateStart the Server
To reach the admin you need the dev server running. Launch it with runserver and keep that terminal open.
python manage.py runserverFind the Door
The admin lives at a fixed URL. Open your browser to the /admin path and Django shows you a clean login screen.
http://127.0.0.1:8000/admin/Log In
Type the same username and password you just created. On success Django drops you into the admin dashboard, your control room for data.
What You See
At first the dashboard only lists Users and Groups. That is expected, you have not registered your own models yet.
Forgot Your Password
Locked out? You can reset any account from the terminal with the changepassword command, no email setup required.
python manage.py changepassword adminQuick Check
Which command creates a full-access admin account?
Recap
You made a superuser, started the server, and signed into /admin. That account is your key to managing data through the dashboard. 🔑
คำถามที่พบบ่อย
บทเรียน “createsuperuser และการเข้าสู่ระบบ” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “createsuperuser และการเข้าสู่ระบบ” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Django Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Django Academy มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “createsuperuser และการเข้าสู่ระบบ”
สร้างบัญชีผู้ดูแลระบบและเข้าถึง /admin คุณปฏิบัติ Django Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Django Academy หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Django Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน
บทเรียน “createsuperuser และการเข้าสู่ระบบ” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Django Academy นี้ได้ไหม
ได้ บทเรียน Django Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- createsuperuser และการเข้าสู่ระบบ
- ลงทะเบียนโมเดลด้วย admin.site
- ปรับแต่ง ModelAdmin
- อินไลน์และฟิลด์อ่านอย่างเดียว