diff --git a/.gitignore b/.gitignore index a7d59b0..b714747 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ .DS_Store .idea node_modules/ -pgaweb/settings_local.py \ No newline at end of file +pgaweb/settings_local.py +*.pyc +static/css/pgaweb.css +static/css/pgaweb.css.map diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d9f2e3 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +pgAdmin Website + +# Installation instructions + +## Install Python dependencies +Run the command: + +```bash +pip install -r requirements.txt +``` + +## Create local settings file +Create a the file pgaweb/settings_local.py from pgaweb/settings.py changing the needed options to run locally. +For connection complaints inquiring about postgres "running locally and accepting connections on Unix domain socket...", +you'll need to change the `HOST` from the postgres data directory to `localhost`. + + +## Database setup + +### Create a new database + +Create a new database using the command + +```bash +createdb pgaweb +``` + +### Migrate database + +```bash +./manage.py migrate +``` + +### Populate the table + +You will at least need to: + +```bash +./manage.py loaddata ./versions/fixtures/versions.json +``` + +If you want to see the other content in the site running locally, +you will need to repeat this for the other fixtures: + +```bash +./manage.py loaddata ./download/fixtures/packages.json +./manage.py loaddata ./download/fixtures/distributions.json +./manage.py loaddata ./download/fixtures/versions.json +./manage.py loaddata ./download/fixtures/downloads.json +./manage.py loaddata ./faq/fixtures/categories.json +./manage.py loaddata ./faq/fixtures/faqs.json +./manage.py loaddata ./news/fixtures/news.json +``` + +## Install frontend requirements + +```bash +pushd static +yarn install +popd +``` + +# Start the application + +```bash +cd static + +yarn start +``` diff --git a/pgaweb/settings.py b/pgaweb/settings.py index 2ad99c9..f5a25ba 100644 --- a/pgaweb/settings.py +++ b/pgaweb/settings.py @@ -46,6 +46,7 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'sass_processor', 'download', 'faq', 'news', @@ -123,5 +124,9 @@ USE_TZ = True STATIC_URL = '/static/' STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),) +# Location for SCSS output +SASS_PROCESSOR_ROOT = 'static/' +COMPRESS_ROOT = 'static/' + # Load local settings overrides from settings_local import * diff --git a/pgaweb/templates/pgaweb/base.html b/pgaweb/templates/pgaweb/base.html index f5ea6a6..6af244d 100755 --- a/pgaweb/templates/pgaweb/base.html +++ b/pgaweb/templates/pgaweb/base.html @@ -1,4 +1,6 @@ {% load staticfiles %} +{% load sass_tags %} + @@ -15,7 +17,7 @@ - +