CS467 - AI Coder - Animal Adoption
-
Install Python: The application is built with Django, which requires Python. You can download it from the official Python website.
-
Install PostgreSQL: As the application uses PostgreSQL for the database, it needs to be installed. You can download it from the official PostgreSQL website.
-
Set up the PostgreSQL database locally: After installing PostgreSQL, you need to create a new database and user with the credentials provided in the
settings.pyfile. Here are the commands you need to run in the PostgreSQL command line:CREATE DATABASE pawsapp; CREATE USER postgres WITH PASSWORD 'cs467'; GRANT ALL PRIVILEGES ON DATABASE pawsapp TO postgres;
** Note this password is hardcoded in settings.py for local development. We will hide credentials before we deploy.
-
Create a Virtual Environment: Before installing Django, it's recommended to create a virtual environment. This can be done using the following commands in your terminal:
python -m venv env
To activate the virtual environment, use:
- On Windows:
env\Scripts\activate
- On MacOS/Linux:
source env/bin/activate
- On Windows:
-
Install Django: You can install Django by running the following command in your terminal:
pip install Django
-
Clone the application repository: Clone the application repository to your local machine using Git.
-
Install the required Python packages: Navigate to the directory where you cloned the repository and install the required Python packages using the following command:
pip install -r requirements.txt
-
Run the Django migrations: This will create the necessary tables in your database. Run the following commands:
python manage.py makemigrations python manage.py migrate
-
Create a Django superuser: To access the admin panel, you need to create a superuser. Run the following command and follow the prompts:
python manage.py createsuperuser
-
Start the Django server: You can start the Django server using the following command:
python manage.py runserver
Now, you should be able to access the application in your web browser at http://localhost:8000.
The admin page is located at http://localhost:8000/admin
Note: Remember to deactivate your virtual environment when you're done working on the project by running deactivate in your terminal.