To find out about this project and the members behind it, please watch over at: https://www.youtube.com/watch?v=bpE9dG1jXHk
Make sure virtualenv is installed:
pip install virtualenv
Create virtual environment (if you don't have a venv folder):
python -m venv ./venv
Run virtual environment:
cd library-book-ordering
source venv/bin/activate
Run virtual environment in Windows 10 (if the above doesn't work):
py -m venv env
.\env\Scripts\activate
If that doesn't work try:
.\venv\Scripts\activate
Note: (venv) should be at the start of each line in the terminal.
In terminal with virtual environment (venv) running:
cd library-book-ordering
pip install -r requirements.txt
cd library-book-ordering/frontend
npm install
In terminal with virtual environment running:
cd library-book-ordering
python manage.py runserver
Note: this runs the Django server (and will run the front-end stuff).
In a second terminal:
cd library-book-ordering/frontend
npm run dev
Note: this watches for changes to the React folders and recompiles the bundled JavaScript file (Webpack/Babel).
In the virtual environment terminal, there should be the following:
Month DD, YYYY - HH:MM:SS
Django version X.X.X, using settings 'library_book_ordering.settings'
Starting development server at **http://127.0.0.1:8000/**
...
You should either click or copy and paste the above highlighted link. Afterwards, you will be met wit a login screen to which the superuser details are shown below.
cd library-book-ordering
python manage.py makemigrations
python manage.py migrate
python manage.py test
- Username: user
- Email: user@email.com
- Password: pass
The internal API. Connects to the database and requests data from Google Books. Hosted at http://127.0.0.1:8000/api/
- admin.py -> admin view settings
- models.py -> database settings
- serializers.py -> api json settings
- tests -> Python unit tests
- urls.py -> api endpoints
- views.py -> api server logic
The frontend UI hosted at http://127.0.0.1:8000/
- src -> React source folder
- components -> React components (almost everything goes here!)
- index.js -> React entry point (this shouldn't be changed)
- static -> frontend static files
- templates -> frontend html templates
- babel.config.json -> babel settings (JavaScript transpiler)
- package.json -> npm settings (Node modules and scripts)
- tests.py -> Python unit tests
- urls.py -> frontend endpoints
- views.py -> frontend server logic
- webpack.config.js -> webpack settings (JavaScript bundler)
- settings.py -> main project settings
- urls.py -> main project urls (these shouldn't be changed)
- db.sqlite3 -> this shouldn't need to be changed directly (see models.py)
- manage.py -> Django manager (used to access Django commands)
- requirements.txt -> Python required packages file
- venv -> virtual environment folder
- Issues with downloading and running the Python Environment on Windows click here
- Issues with the webpack configurations and DefinePlugin values click here
- CSS Files causing an error with webpack click here