-
Notifications
You must be signed in to change notification settings - Fork 20
Supplemental Django Topics
Oscar Chan edited this page Dec 21, 2022
·
1 revision
DOCTYPE declaration: https://www.w3schools.com/tags/tag_doctype.asp
- All HTML documents require the DocType on top
- Because of the “extends” of the “base.html”, we don’t need this for all HTML documents that “extends” from the “base.html” (as long as it works as an HTML document itself)
on_delete
options in Django: https://docs.djangoproject.com/en/3.1/ref/models/fields/#arguments
- Usually this is a design choice where consultation with other CompServ members and domain knowledge is needed to know which one is best
Importing data from other Data Models: https://stackoverflow.com/questions/43847173/cannot-import-models-from-another-app-in-django
- Read the Checkmarked answer
- Making forms using
<p>
-
permission_required
: https://docs.djangoproject.com/en/3.1/topics/auth/default/#the-permission-required-decorator -
login_required
: https://docs.djangoproject.com/en/3.1/topics/auth/default/#the-login-required-decorator
Django Authentication Views: https://docs.djangoproject.com/en/3.1/topics/auth/default/#module-django.contrib.auth.views
- Only the following sections:
- Authentication Views
- Using the views
- All authentication views
class LoginView
class LogoutView
- other sections optional
- Authentication Views
Topics that are good to know
- Review: SQL Injection Attack
- https://cs61a.org/assets/slides/34-Databases_1pp.pdf
- There is such a thing as “HTML Injection”, web developers call it Cross-Site Scripting (XSS) attacks
- XSS Attacks
- “safe” tag
- More info from Django (basically allow render as HTML code)
- Vulnerability of using “safe”
- Markdown
- https://django-markdownify.readthedocs.io/en/latest/settings.html
- Vulnerability issues of Markdown + fix
- Fixed on HKNWeb
- Sanitizing HTML tags
- git fetch and merge
-
https://stackoverflow.com/questions/20101994/git-pull-from-master-into-the-development-branch
- Follow the first code block of ANSWER
Homepage
Guide
- Basics
- Recommended Onboarding Pacing Schedule
- Comprehensive Setup (Forking, Cloning, and Dev Environment)
- Setup
- Django Development Tutorial
- Other Software Engineering Useful Topics
- Contribution Procedure
- Layout
- Deployment
- Server Administration
- Git Guide
- Style
- FAQ
- For Maintainers
Rails - unmaintained - leftover to serve as source of inspiration for other wiki pages