A starting point for a simple website using Django, Bootstrap, Font Awesome and Google Fonts. It contains:
- template base that include navbar and footer templates
- templates for each page that extend base with header and main
- default admin site
- debug toolbar for development
- tests for views, templates and responsive design
Execute install_simple.sh with the command source. You can pass a new name for your root folder in parameter:
source install_simple.sh YourWebsite
First you are asked to choose the place for the root directory of your website, and after you have to register the superuser at the end of the installation.
Clone me, create a virtual environment inside SimpleWebsiteDjango with virtualenv (!!! maybe you have to install !!!) and activate it:
$ git clone https://github.com/JBthePenguin/SimpleWebsiteDjango.git
$ cd SimpleWebsiteDjango
$ virtualenv -p python3 env
$ source env/bin/activate
Install all necessary dependencies (django, django-debug-toolbar, django-bootstrap4, django-fontawesome-5, selenium):
(env)$ pip install -r requirements.txt
Make the migrations:
(env)$ python manage.py makemigrations
(env)$ python manage.py migrate
Create a superuser:
(env)$ python manage.py createsuperuser
Start the server (the virtual environment have to be activated):
(env)$ python manage.py runserver
With your favorite browser, go to url:
- http://127.0.0.1:8000/ to see the home page and visit the site.
- http://127.0.0.1:8000/admin/ to use the admin site.
The tests use selenium and maybe you have to install GreckoWebdriver to use firefox. Run the tests:
(env)$ python manage.py test -v 2
If you want to use Chrome, install ChromeWebDriver and change in visitapp/tests/browser.py line 2:
from selenium.webdriver.chrome.webdriver import WebDriver