Skip to content

nadrowskyy/projekt-car-rental

Repository files navigation

CONTRIBUTORS:

HOW DOES THIS WORK?

  • After downloading project we need to create virtaul env and install dependencies from requirements.txt using command: pip install -r requirements.txt
Important thing is to put database file called car_rental.sql on localhost so mysql connector can connect to it:
  cnx = mysql.connector.connect(
  host='localhost',
  user='root',
  database='car_rental',
  )
Of course we have to install MySQL first if we don’t have it on our computer, you can find it here: https://dev.mysql.com/downloads/installer/
car_rental.sql can be imported to mysql workbench or xampp so our program will connect to a database
  • Then we have to activate virtual env, go to project directory and run it through command: python manage.py runserver
  • And here is what we see when we type http://localhost:8000/ in our browser:

image

  • We can choose date and click SZUKAJ SAMOCHODÓW:

image

  • Filter cars and click WIĘCEJ:

image

  • Rent a car by clicking WYNAJMIJ and choose interesting us options the click DALEJ:

image

  • Fill formula and last click – WYNAJMIJ:

image

  • Congratulations! You rented fake car:

image

We can see here info that we received an email on typed earlier address but this option works if we configure it in app settings.
  • to do this go to settings.py file and edit this lines of code:

    EMAIL_HOST = ‘smtp.gmail.com’ EMAIL_PORT = 587 EMAIL_HOST_USER = ‘’ EMAIL_HOST_PASSWORD = ‘’ EMAIL_USE_TLS = True

    More info here: https://data-flair.training/blogs/django-send-email/

  • then go to views.py in blog folder and uncomment this code:

    #m = EmailMessage(
    #    subject='Carnet Order',
    #    body='Szczegóły zamówienia w załączniku',
    #    from_email='[email protected]',
    #    to=[e_mail],
    #)
    #m.attach('zamowienie', result.getvalue(), 'application/pdf')
    #.send()```
    
    

IMPORTANT! Instead of from_email='[email protected]' type email that you passed in settings.py file.

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •