f1748e9c71a9e35b7fca9652cb88ecbef00c55b7
Summary
Orange County 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/ingit clone https://github.com/grking8/oc-lettings-site.git
Create the virtual environment
cd /path/to/oc-lettings-sitepython -m venv venvapt-get install python3-venv(If previous step errors with package not found on Ubuntu)- Activate the environment
source venv/bin/activate - Confirm the command
pythonnow 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
pipruns the pip executable in the virtual environment,which pip - To deactivate the environment,
deactivate
Run the site
cd /path/to/oc-lettings-sitesource venv/bin/activatepip install --requirement requirements.txtpython manage.py runserver- Go to
http://localhost:8000in a browser. - Confirm the site is running and can be navigated (you should see several profiles and lettings).
Linting
cd /path/to/oc-lettings-sitesource venv/bin/activateflake8
Unit tests
cd /path/to/oc-lettings-sitesource venv/bin/activatepytest
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%'; .quitto exit
Admin panel
- Go to
http://localhost:8000/admin - Login with user
admin, passwordAbc1234!
Windows
Using PowerShell, as above except:
- To activate the virtual environment,
.\venv\Scripts\Activate.ps1 - Replace
which <my-command>with(Get-Command <my-command>).Path
Description
Languages
CSS
91.8%
Python
5.1%
HTML
2.5%
JavaScript
0.4%
Dockerfile
0.2%