- python3 -m venv venv / or create your own Virtual Environment
- activate the venv
- pip install -r requirements.txt
- python manage.py migrate
- Go to > Pugorugh > Core > Scripts folder
- python data_import.py
Important:
- Make sure you clear all your cache
- Make sure you clear all your cookies for localhost / 127.0.0.1
- python manage.py runserver
- register user or use baloo / baloo
Create the models, serializers, and views to power the provided React application. You can check through the supplied JavaScript to see what resources should be available or check below. You are allowed to change, extend, and improve the JavaScript if desired, but the final result must still meet all of the required features/abilities.
You've been provided with HTML and CSS for a basic, mobile-friendly design. You've also been provided with a starter Django project and application, a serializer and views for authentication, and a bit more.
Create a virtualenv and install the project requirements, which are listed in
requirements.txt
. The easiest way to do this is with pip install -r requirements.txt
while your virtualenv is activated.
If you need to import dogs, a data_import
script has been provided but it
expects a DogSerializer
and Dog
model as outlined below to function
properly.
The following models and associated field names should be present as they will be expected by the JavaScript application.
-
Dog
- This model represents a dog in the app.Fields:
name
image_filename
breed
age
, integer for monthsgender
, "m" for male, "f" for female, "u" for unknownsize
, "s" for small, "m" for medium, "l" for large, "xl" for extra large, "u" for unknown
-
UserDog
- This model represents a link between a user an a dogFields:
user
dog
status
, "l" for liked, "d" for disliked
-
UserPref
- This model contains the user's preferencesFields:
user
age
, "b" for baby, "y" for young, "a" for adult, "s" for seniorgender
, "m" for male, "f" for femalesize
, "s" for small, "m" for medium, "l" for large, "xl" for extra large
age
,gender
, andsize
can contain multiple, comma-separated values
You'll need to provide serializers for both the Dog
and UserPref
models.
Each of them should reveal all of the fields with one exception: the UserPref
serializer doesn't need to reveal the user.
The following routes are expected by the JavaScript application.
-
To get the next liked/disliked/undecided dog
/api/dog/<pk>/liked/next/
/api/dog/<pk>/disliked/next/
/api/dog/<pk>/undecided/next/
-
To change the dog's status
/api/dog/<pk>/liked/
/api/dog/<pk>/disliked/
/api/dog/<pk>/undecided/
-
To change or set user preferences
/api/user/preferences/