Brief Project Overview: This project utilizes the Django framework to create a web application for querying housing price information in various cities. It involves web scraping to collect housing price data. The backend reads and processes the data, passing it to the frontend for display and generating line charts.
Below are the basic steps to run the project locally:
-
Clone the project to your local machine:
git clone [https://github.com/your-username/your-repo.git](https://github.com/Enl1ghtener/Django-housing-price-srch-web)
-
Navigate to the project directory:
cd your-repo
-
Create a virtual environment (optional):
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
.\venv\Scripts\activate
-
On macOS/Linux:
source venv/bin/activate
-
-
Install dependencies:
pip install -r requirements.txt
-
Run the development server:
python manage.py runserver
-
Open http://127.0.0.1:8000/ in your browser to view the project.
Provide a brief explanation of the project's directory structure and main files.
Django_first
: Main project directoryDjango_first
: Django frameworkcrwal
: Web scrapingstu
: Main application directorytemplates/
: HTML template filesstatic/
: Static files (CSS, JS, images, etc.)views.py
: View functions- ...
manage.py
: Django management scriptdb.sqlite3
: Database
Data is obtained through the crwal_houseprice.py
spider program. Due to the variation in city URLs, only 15 cities were manually crawled.
In addition to the city search function, the project also includes a test function for student login of login and register, which is written in the STU
The code only has Chinese comments.
This is a practice project and may have some shortcomings, with potential updates in the future.
MIT License
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.