A Website that I have built for myself to display my resume and projects on the web.
- Install python v3.5 or higher and pip
- Run
pip install -r requirements.txt
- Load the default.env file, or create your own .env file with your environment variables (check next section):
source dotenv.sh local.env #this will load the environment variables in default.env
- Execute the following:
./build.sh # to collect static files, build sass
./start_server.sh # to init your database and start your django app
- Visit http://0.0.0.0:8000
- Load your secret environment variables (check docker-compose.yml for missing envs)
- Execute
docker-compose build
docker-compose up
Check out article
- Back up:
python manage.py dumpdata > backup/dump_`date +%d-%m-%Y"_"%H_%M_%S`.json
# or for docker
ssh root@<hostname>
cd /code
docker-compose exec web python manage.py dumpdata > dump.json
exit
ssh root@<hostname> cat dump.json > backup/dump_`date +%d-%m-%Y"_"%H_%M_%S`.json
- Restore:
python manage.py loaddata dump.json
# remove previous db (in project root)
rm -rf db
# copy backup to VPS
scp backup/dump<date>.json root@<hostname>:dump.json
# inside docker
cd <project root>
docker ps # find out web image ID
docker cp backup/dump<date>.json <id>:/code/dump.json # copy backup to container
docker-compose exec web python manage.py loaddata dump.json
- DEBUG (optional): set this to "y" if you want debug information, leave unset or different from "y" to disable debugging.
- SECRET_KEY: the private key used by django.
- DATABASE_URL: url to the database following the dj-database-url format
- P_USERNAME: the username from the Person table (personalWebsite/models.py). A tuple that contains this username will be used to populate the website with data.
- WEBSITE_HOSTNAME: Your hostname with protocol, used to embed the resume pdf for mobile devices. Ex: "http://website-name.com"
- ADMIN_EMAIL: Email of the system admin account.
- ADMIN_PASS: Password used to to login to the admin account (username 'admin')
You can login to you admin account and populate the website with data by creating various tuples for the database tables. Login at /admin with username 'admin' and the password you specified in the environment variable (default 'admin')
- Showcase for projects
- Resume display
The blog feature is not implemented yet.
The style follows the Tomorrow Night color scheme
- Checks unique IP visits:
# in VPS, source root
cat logs/access.log | grep -Eo '^[^ ]+' | uniq | sort