django_airbnb_cloning_practice Tailwind Templates

Django_airbnb_cloning_practice

Django, CSS, Tailwind Tutorial by cloning AirBnB webpage - Nomad Coders Course

Airbnb Cloning using Django

  • My purpose is to make website for fitcuration: exercise recommendation system.
  • While taking Nomad Coders lectures, I don't recommend rewinding back. Instead, I recommend you to refer to the final result.
    • First, Code with the instructor.
    • Second, Make your project
    • Summary is important, but is low priority. When multitasking(phone call), summarize github log for your future self.

Django Project Folder & File Structure

  • config folder is master folder
  • rest of folders are just applications: applications are group of functionalities.

Project configuration folder's structure

  • settings.py: you can refer to installed default apps in django. Look at django documentation links to find out.
  • init.py helps to work like python package
  • urls.py: controls url of the website. Can also be established under application.

Individual application folders' structure

  • apps.py: configuration file which is installed at the project's settings.py
  • models.py: describing how database look like.
  • admin.py: reflects changes on models.py to admin panel
  • views.py: function that renders html
  • urls.py: you can create urls.py under an application.like /users/profile, /users/delete, /users/register etc.

Notes #1 Initializing a Django Project

  • Making Virtual Environment
  • Installing django via pipenv.
  • Selecting linter as flake8 and formatter as black
  • SECURITY TIP: HOW TO KEEP SECRET_KEY SAFE

Notes #2 Building Applications and Models

  • Building Users Applications inheriting Django's AbstractUsers class
  • Building Core Application to reduce repetitive configuration in each applications.
  • Building Rooms, Reviews, Reservations, Lists, Conversatiosn application
    1. register on settings.py
    2. shape database with models.py
    3. connect admin panel page with database at admin.py
    4. Make migrations and migrate

Notes #3: Making Admin Panel & Using Django Queryset

<QuerySet [<User: myam>]>
  • Querysets are list.
    • Objects are either manytomany, or foreignkey(=onetomany).
    • In the example above, <User: myam> is foreignkey.
  • Adding fields to admin panel
  • "super" in Python

Notes #4: Seeding Data to Database, not through Admin Panel

  • Seedng fake data using faker
  • Seeding list files to database

Notes #5: Views and URLs

  • template
    • user interaction
    • Use Django Template for formatting HTML file that Django can render
  • urls.py
    • connection between views.py and template
  • views.py
    • Controller which provides functions and methods from django classes.
    • Supplies functions and methods to templates
  • forms.py
    • branched off from views.py, receives forms from template and processes certain actions

Notes #6: Users app Login, Logout and Sign up

  • Using OAuth to log user in with Github & Kakao

    • Users are redirected to request their GitHub identity
    • Users are redirected back to your site by GitHub
    • Your app accesses the API with the user's access token

Notes #7: Web decoration with Tailwind and Gulp

21 User Profile, Edit Profile, Change Password

22 Room Detail

23 Update Room, Create Room, Room photos

24 Reservations and Reviews

25 Translations, lists and messages

26 Deployment to AWS

My development environment

  • System: Mac OS(10.15.3, Cattalina)
  • Python: 3.8.1 64bit
  • Module information is stated in requirements.txt

Top categories

Loading Svelte Themes