From af3ab5adea7a6b93f6a1644430210c3f7d7f9a20 Mon Sep 17 00:00:00 2001 From: Guy King Date: Wed, 29 Jul 2020 08:15:11 +0100 Subject: [PATCH] commit message --- .gitignore | 3 + README.md | 78 ++++++++++++++ manage.py | 19 ++++ oc-lettings-site.sqlite3 | Bin 0 -> 151552 bytes oc_lettings_site/__init__.py | 0 oc_lettings_site/admin.py | 10 ++ oc_lettings_site/apps.py | 5 + oc_lettings_site/asgi.py | 7 ++ oc_lettings_site/migrations/0001_initial.py | 46 +++++++++ oc_lettings_site/migrations/__init__.py | 0 oc_lettings_site/models.py | 31 ++++++ oc_lettings_site/settings.py | 109 ++++++++++++++++++++ oc_lettings_site/tests.py | 2 + oc_lettings_site/urls.py | 13 +++ oc_lettings_site/views.py | 45 ++++++++ oc_lettings_site/wsgi.py | 7 ++ requirements.txt | 3 + setup.cfg | 8 ++ templates/index.html | 4 + templates/letting.html | 8 ++ templates/lettings_index.html | 17 +++ templates/profile.html | 9 ++ templates/profiles_index.html | 17 +++ 23 files changed, 441 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 manage.py create mode 100644 oc-lettings-site.sqlite3 create mode 100644 oc_lettings_site/__init__.py create mode 100644 oc_lettings_site/admin.py create mode 100644 oc_lettings_site/apps.py create mode 100644 oc_lettings_site/asgi.py create mode 100644 oc_lettings_site/migrations/0001_initial.py create mode 100644 oc_lettings_site/migrations/__init__.py create mode 100644 oc_lettings_site/models.py create mode 100644 oc_lettings_site/settings.py create mode 100644 oc_lettings_site/tests.py create mode 100644 oc_lettings_site/urls.py create mode 100644 oc_lettings_site/views.py create mode 100644 oc_lettings_site/wsgi.py create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 templates/index.html create mode 100644 templates/letting.html create mode 100644 templates/lettings_index.html create mode 100644 templates/profile.html create mode 100644 templates/profiles_index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b4405eb --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/__pycache__ +*.pyc +venv diff --git a/README.md b/README.md new file mode 100644 index 0000000..e22561e --- /dev/null +++ b/README.md @@ -0,0 +1,78 @@ +## Summary + +Holiday lettings website + +## Local development + +### Prerequisites + +- GitHub account with read access to this repository +- Git CLI +- SQLite3 CLI +- Python interpreter, version 3.6 or higher. + +In the rest of the local development documentation, it is assumed the command `python` in +your OS shell runs the above Python interpreter (unless a virtual environment is activated) + +### macOS / Linux + +#### Clone the repository + +- `cd /path/to/put/project/in` +- `git clone https://github.com/grking8/oc-lettings-site.git` + +#### Create the virtual environment + +- `cd /path/to/oc-lettings-site` +- `python -m venv venv` +- `apt-get install python3-venv` (If previous step errors with package not found on Ubuntu) +- Activate the environment `source venv/bin/activate` +- Confirm the command `python` now runs the Python interpreter in the virtual environment, +`which python` +- Confirm the version of the Python interpreter is 3.6 or higher `python --version` +- Confirm the command `pip` runs the pip executable in the virtual environment, `which pip` +- To deactivate the environment, `deactivate` + +#### Run the site + +- `cd /path/to/oc-lettings-site` +- `source venv/bin/activate` +- `pip install --requirement requirements.txt` +- `python manage.py runserver` +- Go to `http://localhost:8000` in a browser +- Confirm the site is running and can be navigated (you should see several profiles and lettings) + +#### Linting + +- `cd /path/to/oc-lettings-site` +- `source venv/bin/activate` +- `flake8` + +#### Unit tests + +- `cd /path/to/oc-lettings-site` +- `source venv/bin/activate` +- `pytest` + +#### Database + +- `cd /path/to/oc-lettings-site` +- Open a shell session `sqlite3` +- Connect to the database `.open oc-lettings-site.sqlite3` +- Display tables in the database `.tables` +- Display columns in the profiles table, `pragma table_info(oc_lettings_site_profile);` +- Run a query on the profiles table, `select user_id, favorite_city from + oc_lettings_site_profile where favorite_city like 'B%';` +- `.quit` to exit + +#### Admin panel + +- Go to `http://localhost:8000/admin` +- Login with user `admin`, password `Abc1234!` + +### Windows + +Using PowerShell, as above except + +- To activate the virtual environment, `.\venv\Scripts\Activate.ps1` +- Replace `which ` with `(Get-Command ).Path` diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..c0e27e0 --- /dev/null +++ b/manage.py @@ -0,0 +1,19 @@ +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oc_lettings_site.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/oc-lettings-site.sqlite3 b/oc-lettings-site.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..3d885414f9f3ed046704e8b09bdcd5c791c82d42 GIT binary patch literal 151552 zcmeI5du$uYeaE?cijv5&B+InV_G$GxAFD{(Cm*^vIohTkwjQ=DTbA1cu_9O0%6!O6 zQm<=@%6DneM-nuBr7ikIi=rtOXqrEg0-c#% za+l=F(m4hiUw*{hm^=HM-+bpYGrOFb)z0l(^IBD9H_CcZsj{N$l#5|pFSD%6<(k6( zkK+I9pIQ9HTR*`6GPdtWeVuYmT==k$7^ANfn~3qxQRWa21b_e#00KY&2mk>f00e*l z5C8%|00=yN0{zd2u+!eIS6t|m=qFGP4Tk?N{KMfZq5lp2erPu&b$`D5=ezHA_jG-# z>x0+`K0p8n00AHX1b_e#00KY&2pmm7?De@Wj;1PVrJ|Kf6^`Thj8@XBnop@r5>Mad^A zn>aH*Q`^odRW-A%m-qHF+p1pF3@J|83kg}2xT^?zSg3p8GD@MU>Y2P=u5D*ZN>R-e zl|8Jil&@|&I*G+&a$+Woo!l{M#xj8BKKquX^y3A-cW?IeQu zWKxdZ=*E6tsr!kWes+|ChWV8BN=C`$GODhZ^-K}hmXcR1PNm}$g2W4{F6?Zs?ktwk z)rU1rS2Njisj8N$)%|U?lEL*QIJ$_*$ynk_Cw6h8?n1VgivlW?^I9oWsudg?3NOcE zG5O^n_EE2EPO|%Guqkg>oeLr+B!R!$fj!jgniK6F)S{vlj;U*&<0MI%4PYm$^`Z!- z6RWMAq_Vk$l;q;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>MdFb+oLbb47yrs=wy}m*1rjvYDxVwK(z(o-9Bu^e|+gsRruz!Db zZExY=%GScxm952V3%g6JX?g7+eSq~B7p|@C-`^?}7lm8g;>xYPxe|A|zU76GARF>X z{FIEhDZx7fB;sWKpF#iR!vDbs2mk>f00e*l5C8%|00;m9AOHk_01$Wv2@HD{g2&B@ w7~}uXxzOjH!2*J0AOHk_01yBIKmZ5;0U!VbfB+Bx0zkkdaM6/', views.letting, name='letting'), + path('profiles/', views.profiles_index, name='profiles_index'), + path('profiles//', views.profile, name='profile'), + path('admin/', admin.site.urls), +] diff --git a/oc_lettings_site/views.py b/oc_lettings_site/views.py new file mode 100644 index 0000000..a72db27 --- /dev/null +++ b/oc_lettings_site/views.py @@ -0,0 +1,45 @@ +from django.shortcuts import render +from .models import Letting, Profile + + + + +# Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque molestie quam lobortis leo consectetur ullamcorper non id est. Praesent dictum, nulla eget feugiat sagittis, sem mi convallis eros, +# vitae dapibus nisi lorem dapibus sem. Maecenas pharetra purus ipsum, eget consequat ipsum lobortis quis. Phasellus eleifend ex auctor venenatis tempus. +# Aliquam vitae erat ac orci placerat luctus. Nullam elementum urna nisi, pellentesque iaculis enim cursus in. Praesent volutpat porttitor magna, non finibus neque cursus id. +def index(request): + return render(request, 'index.html') + +# Aenean leo magna, vestibulum et tincidunt fermentum, consectetur quis velit. Sed non placerat massa. Integer est nunc, pulvinar a +# tempor et, bibendum id arcu. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Cras eget scelerisque +def lettings_index(request): + lettings_list = Letting.objects.all() + context = {'lettings_list': lettings_list} + return render(request, 'lettings_index.html', context) + + +#Cras ultricies dignissim purus, vitae hendrerit ex varius non. In accumsan porta nisl id eleifend. Praesent dignissim, odio eu consequat pretium, purus urna vulputate arcu, vitae efficitur +# lacus justo nec purus. Aenean finibus faucibus lectus at porta. Maecenas auctor, est ut luctus congue, dui enim mattis enim, ac condimentum velit libero in magna. Suspendisse potenti. In tempus a nisi sed laoreet. +# Suspendisse porta dui eget sem accumsan interdum. Ut quis urna pellentesque justo mattis ullamcorper ac non tellus. In tristique mauris eu velit fermentum, tempus pharetra est luctus. Vivamus consequat aliquam libero, eget bibendum lorem. Sed non dolor risus. Mauris condimentum auctor elementum. Donec quis nisi ligula. Integer vehicula tincidunt enim, ac lacinia augue pulvinar sit amet. +def letting(request, letting_id): + letting = Letting.objects.get(id=letting_id) + context = { + 'title': letting.title, + 'address': letting.address, + } + return render(request, 'letting.html', context) + +# Sed placerat quam in pulvinar commodo. Nullam laoreet consectetur ex, sed consequat libero pulvinar eget. Fusc +# faucibus, urna quis auctor pharetra, massa dolor cursus neque, quis dictum lacus d +def profiles_index(request): + profiles_list = Profile.objects.all() + context = {'profiles_list': profiles_list} + return render(request, 'profiles_index.html', context) + +# Aliquam sed metus eget nisi tincidunt ornare accumsan eget lac +# laoreet neque quis, pellentesque dui. Nullam facilisis pharetra vulputate. Sed tincidunt, dolor id facilisis fringilla, eros leo tristique lacus, +# it. Nam aliquam dignissim congue. Pellentesque habitant morbi tristique senectus et netus et males +def profile(request, username): + profile = Profile.objects.get(user__username=username) + context = {'profile': profile} + return render(request, 'profile.html', context) diff --git a/oc_lettings_site/wsgi.py b/oc_lettings_site/wsgi.py new file mode 100644 index 0000000..d78ca6d --- /dev/null +++ b/oc_lettings_site/wsgi.py @@ -0,0 +1,7 @@ +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oc_lettings_site.settings') + +application = get_wsgi_application() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c48c84e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +django==3.0 +flake8==3.7.0 +pytest-django==3.9.0 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..b93a5f5 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,8 @@ +[flake8] +max-line-length = 99 +exclude = **/migrations/*,oc-lettings-site,oc_lettings_site/views.py + +[tool:pytest] +DJANGO_SETTINGS_MODULE = oc_lettings_site.settings +python_files = tests.py +addopts = -v diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..0bd6445 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,4 @@ +Holiday Homes +

Welcome to Holiday Homes

+ + \ No newline at end of file diff --git a/templates/letting.html b/templates/letting.html new file mode 100644 index 0000000..579bb6a --- /dev/null +++ b/templates/letting.html @@ -0,0 +1,8 @@ +{{ title }} +

{{ title }}

+

{{ address.number }} {{ address.street }}

+

{{ address.city }}, {{ address.state }} {{ address.zip_code }}

+

{{ address.country_iso_code }}

+ + + \ No newline at end of file diff --git a/templates/lettings_index.html b/templates/lettings_index.html new file mode 100644 index 0000000..a14bd50 --- /dev/null +++ b/templates/lettings_index.html @@ -0,0 +1,17 @@ +Lettings +

Lettings

+{% if lettings_list %} + +{% else %} +

No lettings are available.

+{% endif %} + + \ No newline at end of file diff --git a/templates/profile.html b/templates/profile.html new file mode 100644 index 0000000..1e62a54 --- /dev/null +++ b/templates/profile.html @@ -0,0 +1,9 @@ +{{ profile.user.username }} +

{{ profile.user.username }}

+

First name: {{ profile.user.first_name }}

+

Last name: {{ profile.user.last_name }}

+

Email: {{ profile.user.email }}

+

Favorite city: {{ profile.favorite_city }}

+ + + \ No newline at end of file diff --git a/templates/profiles_index.html b/templates/profiles_index.html new file mode 100644 index 0000000..7757515 --- /dev/null +++ b/templates/profiles_index.html @@ -0,0 +1,17 @@ +Profiles +

Profiles

+{% if profiles_list %} + +{% else %} +

No profiles are available.

+{% endif %} + + \ No newline at end of file