The code for the personal website of Benjamin Schmidt using Django.
DO NOT DEPLOY THIS WEBSITE WITHOUT CHANGING THE PASSWORD IN personal_site/settings.py
How to deploy on PythonAnywhere
Consider to check out the official instructions for setting up an existing project on PythonAnywhere.
-
Open a new bash console and clone the repository with
git clone https://github.com/benjaminschmidt/benjaminschmidt.github.io.git mysite
. -
Open
mysite/personal_site/settings.py
.- Change the
SECRET_KEY
. - Add
'myusername.pythonanywhere.com'
toALLOWED_HOSTS
.
- Change the
-
Create a new virtual environment with
python3 -m venv venv
. -
Activate the virtual environment with
source venv/bin/activate
. -
Upgrade pip and install Django and Pillow with
python3 -m pip install --upgrade pip
python3 -m pip install Django
python3 -m pip install Pillow
-
Go to the Django projects folder with
cd mysite
. -
Run
python3 manage.py collectstatic
to collect all the static files. -
Run the database migrations with
python3 manage.py migrate
. -
Create an admin user with
python3 manage.py createsuperuser
. -
Create a new web app.
- Use
Manual configuration
andPython 3.9
. - Add the full path to the source
/home/myusername/mysite
. - Choose the virtualenv to
/home/myusername/venv
. - Add a static files url
/static/
and path/home/myusername/mysite/static/
- Use
-
Open
/var/www/myusername_pythonanywhere_com_wsgi.py
and replace its content byimport os import sys path = '/home/myusername/mysite' if path not in sys.path: sys.path.insert(0, path) os.environ['DJANGO_SETTINGS_MODULE'] = 'personal_site.settings' from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
-
Reload the website at the top of the settings page.
-
Go to the admin interface at
https://myusername.pythonanywhere.com/admin/
and add all the information you want. The minimum to get the website to work is to add amyself
entry. -
Once everything works go back to
mysite/personal_site/settings.py
and setDEBUG = False
.
-
The envelope icon under information/static/information/mail-icon.pgn is licensed under CC0 1.0 Universal (CC0 1.0) and was downloaded from https://www.iconsdb.com/black-icons/email-icon.html.
-
Information about the license of the GitHub logo under information/static/information/github.pgn can be found on https://github.com/logos.
-
Information about the license of the LinkedIn logo under information/static/information/linkedin.pgn can be found on https://brand.linkedin.com/downloads.