This project corresponds to the API for iCard.
Welcome! ✅
To see this project in action, you can go to CS50 Web 2020 | Project 2 | Commerce
Or, stay on this page and see Commerce Project contents based on the structure guidelines: s
Don't worry. It is easy to use. You must follow these steps:
-
Required Packages: Before starting, you need to install Python and pip. Then you have to install Django.
-
Download the source project: Download or clone the project to your computer.
-
Open the project (Optional): Once you have downloaded the project, extract it! You should open the project in your code editor so that you can see or understand the structure of the project.
-
Before execute the project:
- makemigrations: Open new terminal and inside the root directory type:
python manage.py makemigrations
to create the migrations (generate the SQL commands). - migrate: Then run
python manage.py migrate
to run the migrations (execute the SQL commands). - Create a superuser: To get logged into the application you have to create a superuser. Use
python manage.py createsuperuser
then complete the requested data.
- makemigrations: Open new terminal and inside the root directory type:
-
Execute the project: Now you have completed the previous steps, run
python manage.py runserver
on the root directory. If everything went well, you should be able to observe a line with the following:Starting development server at http://127.0.0.1:8000/
. All you have to do is copy that address and paste it into your search bar. Also, you can type the addresslocalhost:8000
.
If you are not logged in, when you visit the site, you are able to see the active listings and filter them by category. If you want to access to add a new listing, or bid for a list, you have to login.
If you are logged in, when you visit the site, you are able to see the active listings, filter them by category. Also, you can access to see listings details (bids, comments, all listing pictures, etc.) Also, you can offer for lists, comment on a listing, win an auction, or close the listing if you are the owner.
When you want to add a new listing, you have to provide some data:
- Title
- Description
- Initial bid
- Category
- At most 4 pictures.
Then you have to Upload the listing.
By clicking on a list, and if that list is active you can bid for the listing. Remember, your bid must be greater than the last bid.
By clicking comments tab, you are able to add a comment to the current selected listing. You can add a title for the comment, and the content of the comment.
If you are the owner of the listing and you want to close at least one is nedded. When you close, the person who have done the last bid will be who win the auction.
If you are interested in a listing, you are able to add to your Watchlist.
You can click on your Watchlist in order to see only the listings you had mark. When you are not interested on the list, you can remove it from your Watchlist.
-
TimeStampedModel Excecute ´pip install django-model-utils´: 'django-model-utils'
-
Run ´python manage.py test´: Make sure that any test.py file exists in main app folder. Then, make sure that the user used as admin in the database project have the permission to create a database. django test app error - Got an error creating the test database: permission denied to create database
-
Safe built-in template tag: If you see something like this
<h1>Git</h1> <p>Git is a version...
when you try to render the content, most likely you are missing the safe tag when you try to render. -
Using static files: If you have an error corresponding to static files. You probably want to see these links: Django TemplateSyntaxError - 'staticfiles' is not a registered tag library, Django: Invalid block tag: 'static', expected 'endif'
-
Images Carousel: In order to create the carousel slider on this project, you may want see Tailwind CSS Carousel Slider Examples
By: Alex Cuenca