0% found this document useful (0 votes)
19 views2 pages

Django HTML CSS Cheatsheet Guide

This document is a cheatsheet covering the basics of Django, HTML, and CSS. It includes commands for creating projects and apps in Django, common HTML structure and tags, and CSS syntax and selectors. Additionally, it outlines concepts like the box model and responsive design in CSS.

Uploaded by

hermes.ar90745
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

Django HTML CSS Cheatsheet Guide

This document is a cheatsheet covering the basics of Django, HTML, and CSS. It includes commands for creating projects and apps in Django, common HTML structure and tags, and CSS syntax and selectors. Additionally, it outlines concepts like the box model and responsive design in CSS.

Uploaded by

hermes.ar90745
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Django, HTML, CSS Cheatsheet with Explanations

Django Basics
1. Create Project: django-admin startproject projectname
2. Create App: python [Link] startapp appname
3. Run Server: python [Link] runserver
4. Migrations:
- Make: python [Link] makemigrations
- Apply: python [Link] migrate
5. Admin:
- Create superuser: python [Link] createsuperuser
- Register model in [Link]
6. Views:
- Defined in [Link]
- Return HttpResponse or render([Link], context)
7. URLs:
- In project [Link]: path('app/', include('[Link]'))
- In app [Link]: path('route/', view_function, name='name')
8. Templates:
- Use {% %} for logic and {{ }} for variables
- Extend base templates using {% extends "[Link]" %}

HTML Basics
1. Structure:
<!DOCTYPE html>
<html>
<head><title>Title</title></head>
<body>Content here</body>
</html>
2. Common Tags:
- <h1> to <h6>: Headings
- <p>: Paragraphs
- <a href="url">Link</a>
- <img src="[Link]" alt="desc">
- <div>: Container
- <form>: User input
3. Attributes: class, id, href, src, alt, style, etc.

CSS Basics
1. Syntax:
selector { property: value; }
2. Types:
- Inline: <p style="color:red;">
- Internal: <style>...</style> in <head>
- External: link to .css file
3. Selectors:
- .class, #id, tag
- div p (descendant), div > p (child)
4. Box Model: margin, border, padding, content
Django, HTML, CSS Cheatsheet with Explanations

5. Layout:
- display: block, inline, flex, grid
- position: static, relative, absolute, fixed
6. Responsive:
- media queries: @media (max-width: 600px) { ... }

You might also like