Skip to content

lbenno/my-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to run in terminal

Run virtual environment

source myvenv/bin/activate

Start the app

python3 manage.py runserver

If the site displays without formattng

It means DEBUG is set to False. Try uncommenting 'DEBUG = True' in the settings.py file and rerun the app. If formatting reappears, re-comment-out the setting and let the os.environ check run.

To Run files and functions in the shell

python3 manage.py shell

>>> from { file_name } import { function/Class/etc }
>>> print(function())
>>> exit()

How to deploy

Push to GitHub

git status
git add .
git status
git commit -m "<insert message>"
git push

Deploy to the Web

Open PythonAnywhere

Open the bash console

Pull from Github to PythonAnywhere

cd lbenno.pythonanywhere.com
git pull

or, open the virtual env console

(lbenno.pythonanywhere.com) 18:30 ~/lbenno.pythonanywhere.com (master)$ 
(lbenno.pythonanywhere.com) 18:30 ~/lbenno.pythonanywhere.com (master)$ git pull

If you've installed packages as part of your updates, remember to include them in requirements

pip3 freeze > requirements.txt

Load static files to PythonAnywhere

python manage.py collectstatic

Run Migrations in PythonAnywhere

Ensure migrations were made before the git pull into Pythonanywhere.

python manage.py makemigrations
python manage.py migrate

Then, from Pythonanywhere

python manage.py migrate

Deploy to the Web

Got to the 'Web' section of PythonAnywhere and click 'Reload lbenno/pythonanywhere.com'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published