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.
- 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.
- Making Virtual Environment
- Installing django via pipenv.
- Selecting linter as flake8 and formatter as black
- SECURITY TIP: HOW TO KEEP SECRET_KEY SAFE
- 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
- register on settings.py
- shape database with models.py
- connect admin panel page with database at admin.py
- Make migrations and migrate
<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
- Seedng fake data using faker
- Seeding list files to database
- 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
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