From 44b453c35983ab74de2369dab32f8e23bd6177ce Mon Sep 17 00:00:00 2001 From: ImportErr Date: Fri, 4 Jan 2019 11:57:24 +0000 Subject: Added info for running the server --- docs/setup.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/setup.md') diff --git a/docs/setup.md b/docs/setup.md index d6e5a7bf..f92a24df 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -67,5 +67,7 @@ pip install -e .[lint,test] to install base dependencies along with lint and test dependencies. You can either use `python manage.py` directly, or you can use the console -entrypoint for it, `psmgr`. For example, to run tests, you could use either -`python manage.py test` or `psmgr test`. Happy hacking! +entrypoint for it, `psmgr`. For example, to run tests, you could use either `python manage.py test` or `psmgr test`. +To run the server, run `DEBUG=1 python manage.py runserver`. If it gives you an error saying +`django.core.exceptions.ImproperlyConfigured: Set the DATABASE_URL environment variable` please make sure the server your postgres database is on is running +and run the command `$(export cat .env) in your terminal`. Happy hacking! -- cgit v1.2.3 From 949f3d8932f5b87b93092d8654aaa0ac15a5200d Mon Sep 17 00:00:00 2001 From: ImportErr Date: Fri, 4 Jan 2019 14:11:32 +0000 Subject: Made clarifications on the hosts file --- docs/setup.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'docs/setup.md') diff --git a/docs/setup.md b/docs/setup.md index f92a24df..dfaf3122 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -26,6 +26,9 @@ in your environment variables: export DATABASE_URL=postgres://pysite@localhost/pysite ``` +After this step, inside the `.env` file, set the `SECRET_KEY` variable which can be anything you like. Also, set the `ENGINE` variable +to `django.db.backends.postgresql`. + A simpler approach to automatically configuring this might come in the near future - if you have any suggestions, please let us know! @@ -68,6 +71,23 @@ to install base dependencies along with lint and test dependencies. You can either use `python manage.py` directly, or you can use the console entrypoint for it, `psmgr`. For example, to run tests, you could use either `python manage.py test` or `psmgr test`. + +## Hosts file + +Make sure you add the following to your hosts file: + +```sh +127.0.0.1 pythondiscord.local +127.0.0.1 api.pythondiscord.local +127.0.0.1 staff.pythondiscord.local +127.0.0.1 admin.pythondiscord.local +127.0.0.1 wiki.pythondiscord.local +127.0.0.1 ws.pythondiscord.local +``` +When trying to access the site, you'll be using the domains above instead of the usual `localhost:8000`. + To run the server, run `DEBUG=1 python manage.py runserver`. If it gives you an error saying -`django.core.exceptions.ImproperlyConfigured: Set the DATABASE_URL environment variable` please make sure the server your postgres database is on is running -and run the command `$(export cat .env) in your terminal`. Happy hacking! +`django.core.exceptions.ImproperlyConfigured: Set the DATABASE_URL environment variable` please make sure the server that your postgres database is located at is running +and run the command `$(export cat .env)`. Happy hacking! + + -- cgit v1.2.3 From bfc9327a17322d1870c5cb51cb89390d0d4f8ebd Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Thu, 11 Apr 2019 20:21:40 +0200 Subject: Remove `ENGINE` variable export documentation. --- docs/setup.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/setup.md') diff --git a/docs/setup.md b/docs/setup.md index dfaf3122..2f791923 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -26,8 +26,7 @@ in your environment variables: export DATABASE_URL=postgres://pysite@localhost/pysite ``` -After this step, inside the `.env` file, set the `SECRET_KEY` variable which can be anything you like. Also, set the `ENGINE` variable -to `django.db.backends.postgresql`. +After this step, inside the `.env` file, set the `SECRET_KEY` variable which can be anything you like. A simpler approach to automatically configuring this might come in the near future - if you have any suggestions, please let us know! -- cgit v1.2.3 From aa8f0855e2a44566b79f178b489cf52239ad8b82 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Thu, 11 Apr 2019 20:23:38 +0200 Subject: Document `LOG_LEVEL` and `DEBUG` setup. --- docs/setup.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'docs/setup.md') diff --git a/docs/setup.md b/docs/setup.md index 2f791923..18f5ee97 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -68,8 +68,7 @@ pip install -e .[lint,test] to install base dependencies along with lint and test dependencies. -You can either use `python manage.py` directly, or you can use the console -entrypoint for it, `psmgr`. For example, to run tests, you could use either `python manage.py test` or `psmgr test`. +To run tests, use `python manage.py test`. ## Hosts file @@ -85,8 +84,10 @@ Make sure you add the following to your hosts file: ``` When trying to access the site, you'll be using the domains above instead of the usual `localhost:8000`. -To run the server, run `DEBUG=1 python manage.py runserver`. If it gives you an error saying +Finally, you will need to set the environment variable `DEBUG=1`. When using `pipenv`, you can +set put this into an `.env` file to have it exported automatically. It's also recommended to +export `LOG_LEVEL=INFO` when using `DEBUG=1` if you don't want super verbose logs. + +To run the server, run `python manage.py runserver`. If it gives you an error saying `django.core.exceptions.ImproperlyConfigured: Set the DATABASE_URL environment variable` please make sure the server that your postgres database is located at is running and run the command `$(export cat .env)`. Happy hacking! - - -- cgit v1.2.3