Skip to content
Permalink
Browse files
Added files from 5001CEM Group Project
  • Loading branch information
masudm6 committed Nov 24, 2022
0 parents commit 9b4311229b222eaaa60e642ece4a5631a6d2078a
Show file tree
Hide file tree
Showing 28 changed files with 2,059 additions and 0 deletions.
@@ -0,0 +1,156 @@
# ignore custom virtual environments, not just /venv/ mentioned in the template below.
venvLAPTOP/
venvPC/
venvCODIO/

# ignore databases and images from being committed
db/USER_DB.sqlite3
db/BOOK_DB.sqlite3
static/img/

# ignore PyCharm folder
.idea/*

# ignore the folder for included files and documentation
external/

# Rest of .gitignore from https://github.com/github/gitignore/blob/master/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
@@ -0,0 +1,38 @@
# bad_bookshop

## Project 2: Bookshop website
This repository contains the code for my submission of the 5001CEM Project (Bookshop) as part of my coursework

## Install instructions
These are some instructions to get started with the project.
> Root access to a Python Codio environment is required.
### Create a Python environment on Codio and open the terminal:
- You can use the 'Open Terminal' button under the Codio project's name, or by clicking Tools > Terminal at the top.

### Clone the repository and switch into its directory:
- Type `git clone https://github.coventry.ac.uk/5001CEM-2122/bad_bookshop.git` to clone this repository.
- Type `cd bad_bookshop` to switch into the cloned files.
- Type `cd static` to switch into the `static` folder
- Type `mkdir img` to create the folder `img` for saved images.
- Type `cd ..` to return to the `bad_bookshop` folder.

### Install and activate the virtual environment:
Type the following in order:
1. `sudo apt update`
2. `sudo apt-get install python3-venv` (_Make sure to enter_ `Y` _when prompted_)
3. `python3 -m venv venvCODIO` (`venvCODIO` is the venv name defined in the `.gitignore` file.)
4. `. venvCODIO/bin/activate`

### Install dependencies from the requirements file:
`pip install -r requirements.txt`

### Setup and run the flask application using the integrated CLI:
- Type `export FLASK_APP=app` so flask knows where to look to run our code.
- Type `flask run --host=0.0.0.0` to start the flask app.

### Access the flask app:
1. Click **Project -> Box Info** at the top.
2. Copy the first link under the **WEB: Dynamic Content** section.
3. Paste the link into a browser tab, and change the number at the end to **5000** (It is 80 by default.)
4. Press enter or reload the tab, and you should now be on the index page for the website.

0 comments on commit 9b43112

Please sign in to comment.