Giter Site home page Giter Site logo

proshop_django's Introduction

PropShop Ecommerce Website With Django + React

Live Demo can be viewed at https://www.buildproshop.com/

This project is from my Django + React collaboration wih Brad Traversy. Full Course: https://www.udemy.com/course/django-with-react-an-ecommerce-website/?couponCode=387F19CD4087385E87C1

DEMO

Features

  • Full featured shopping cart
  • Product reviews and ratings
  • Top products carousel
  • Product pagination
  • Product search feature
  • User profile with orders
  • Admin product management
  • Admin user management
  • Admin Order details page
  • Mark orders as delivered option
  • Checkout process (shipping, payment method, etc)
  • PayPal / credit card integration

Download & Setup Instructions

  • 1 - Clone project: git clone https://github.com/divanov11/proshop_django/
  • 2 - cd proshop_django
  • 3 - Create virtual environment: virtualenv myenv
  • 4 - myenv\scripts\activate
  • 5 - pip install -r requirements.txt
  • 6 - python manage.py runserver

Install react modules

  • 1 - cd frontend
  • 2 - npm install

proshop_django's People

Contributors

divanov11 avatar monishshah18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proshop_django's Issues

ModuleNotFoundError: No module named 'rest_framework'

i try to run your project (python manage.py runserver) and what i get on cmd is:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in bootstrap_inner
self.run()
File "C:\Users\kmrn
\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self.target(*self.args, **self.kwargs)
File "C:\Users\kmrn
\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kmrn
\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\kmrn
\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise exception[1]
File "C:\Users\kmrn
\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management_init_.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django_init_.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py", line 228, in create
import_module(entry)
File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rest_framework'

ImproperlyConfigured: WSGI application

From the initial clone and spin up of the project there is an issue in the wsgi.py

env\Lib\site-packages\django\core\servers\basehttp.py", line 49, in get_internal_wsgi_application
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: WSGI application 'backend.wsgi.application' could not be loaded; Error importing module.

the problem pops up on python manage.py runserver

Social Login

Can anyone help on how to implement social login. Should we disable the JWT entirely or is it possible to add social auth Side by side

Cannot read property of undefined loginPage.js : 19 (reading 'search' )

Screenshot 2022-11-10 110823

the code is shown below, I believe the error is occuring because I'm using react router v6
how do I write this code in react router v6

import React, {useState, useEffect} from 'react'
import { Link } from 'react-router-dom'
import { Form, Button, Row, Col } from 'react-bootstrap'
import { useDispatch, useSelector } from 'react-redux'
import Loader from '../components/Loader'
import Message from '../components/Message'
import FormContainer from '../components/FormContainer'

import { login } from '../actions/userActions'

function Loginpage({ Location, history }) {
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')

const dispatch = useDispatch()



const redirect = Location.search ? Location.search.split('=')[1] : '/'

const userLogin = useSelector(state => state.userLogin)
const {error, loading, userInfo} = userLogin 

useEffect(() => {
    if (userInfo) {
        history.push(redirect)
    }
},  [history, userInfo, redirect])

const submitHandler = (e) =>{
    e.preventDefault()
    dispatch(login(email, password))
}

return (

Sign In


{error &&{error}}
{loading && }

    <Form onSubmit={submitHandler}>
        <Form.Group controlId='email'>
            <Form.Label>Email Address</Form.Label>
            <Form.Control
                type='email'
                placeholder='Enter Email'
                value={email}
                onChange={(e) => setEmail(e.target.value)}
            >
            </Form.Control>
        </Form.Group>


        <Form.Group controlId='password'>
            <Form.Label>Password</Form.Label>
            <Form.Control
                type='password'
                placeholder='Enter Password'
                value={password}
                onChange={(e) => setPassword(e.target.value)}
            >
            </Form.Control>
        </Form.Group>

        <Row className='py-3'>
            <Col>
                <Button type='submit' variant='warning'>
                    Sign In
                </Button>
            </Col>
        </Row>

       

    </Form>

    <Row className='py-3'>
        <Col>
            Don't Have an account? <Link 
                    to={redirect ? `/register?redirect=${redirect}` : '/register'}>
                >
                Register
            </Link>
        </Col>
    </Row>
</FormContainer>

)
}

export default Loginpage

Can't get "order._id" in the PlaceOrderScreen.js file

Below is the full error, please help

TypeError: Cannot read properties of undefined (reading '_id')
(anonymous function)
src/screens/PlaceOrderScreen.js:31
28 |
29 | useEffect(() => {
30 | if (success) {

31 | history.push(/order/${order._id})
| ^ 32 | dispatch({ type: ORDER_CREATE_RESET })
33 | }
34 | },[success, history])
View compiled
โ–ถ 22 stack frames were collapsed.
(anonymous function)
src/actions/orderActions.js:42
39 | payload: data
40 | })
41 |
42 | dispatch({
| ^ 43 | type: CART_CLEAR_ITEMS,
44 | payload: data
45 | })

Doc: python dependencies are not compatible with python > 3.9

Python packages when installed via pip command throws error when python version is 3.9 and above. The issue is with djangorestframework-simplejwt v4.4.0 which is incompatible with python v3.9 and above but works well with v3.7.x and v3.8.x.

To resolve this:
->There should be Note regarding python version to be used.
-> Dependencies must be tested and upgraded to latest versions if it solves the issue.

About cart items

Thanks for providing this course i am grateful to you but i found one issue on this course.
The issue is:
when ever one user add items to the cart each and every users have the same item to their cart so please can you provide the solution for this solution

User Registration Error

signUp -401 error

postman- error 401

I Get an error saying Authentication credentials were not provided.
when I try to register a new user.
And my code is literally the same. This i the fifth time I am trying this.

from the console : POST http://localhost:3000/api/users/register/ 401 (Unauthorized)
from the redux state:

loading(pin):false
error(pin):"Authentication credentials were not provided."

it also doesn't work on postman

Can't get "order._id" from PlaceOrderScreen.js

I'm stuck at section 52, in PlaceOrderScreen. Keep getting ff error:

TypeError: Cannot read properties of undefined (reading '_id'), from this segment:

==========================
useEffect(() => {
if (success) {
history.push(/order/${order._id})
dispatch({ type: ORDER_CREATE_RESET })
}
},[success, history])

Please help

Things wrong!

  1. You can still order without having anything in the cart!(Just get something in stock and place the order(since we don't even need to pay yet) like the camera and click the go back arrow to go back to the order screen, and since we reset the cart for each order, the cart will be empty, and we can spam the place order button filling the database with orders with no products and this follows the second issue.)

  2. Why do place the order and we don't even pay yet? The user can just keep placing the order filling up all the database and when someone pays then what lol. Shouldn't the paypal buttons be in the placeorder.js screen and not the orderscreen.js. So this problem doesn't occur and we only see the paid orders. I'm struggling right now as I'm a beginner so I need to learn more just to fix this. I feel like it's easy but when I try I face many problems.

3.Many other problems as well that need to be fixed. For example on your twitter saying you found some problems and a hacker changed the images. I don't know if you had updated the course and showed a way but yeah seems pretty dumb. I'm still going to try to learn more and fix these problems myself or get some help but yeah why do it like that in the first place.

Broken image links in OrderScreen

Image links under Order Items were broken while on Order Screen.

However, changing image = product.image.url to image = product.image seems to resolve the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.