Open MikeTheCanuck opened 7 years ago
I was not able to reproduce @MikeTheCanuck 's problem. I created a new directory, cloned the repository, and followed the instructions in the top-level README.md. I did not change any of the defaults, so it created a SQLite database in my dev environment. I was able to load data, then get the expected results from endpoints from local ./budget_proj/manage.py runserver
. I then changed the values in project_config.py
to point to the integration instance of PostgreSQL and started a Docker container through ./budget_proj/bin/start-proj.sh -l
. Again, I received expected results from endpoints, including 500 when the response is too big.
I did notice one error with a path in step 2:
pip install -r requirements/dev.txt
should be:
pip install -r budget_proj/requirements/dev.txt
I will file a Pull Request with that fix.
You only need source budget_proj/bin/env.sh
when building the Dockerfile.
Note: The procedure for configuring is slightly different, so you need to have the latest from master
branch.
What were the contents of budget_proj/budget_proj/project_config.py
when you received the error? Were you trying to run a local instance of PostgreSQL? I have not tried that configuration yet, because I had trouble installing PostgreSQL on my workstation.
I do not have DJANGO_SETTINGS_MODULE
defined in my Bash shell environment. However, I see this assignment in budget_proj/manage.py
:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "budget_proj.settings.dev")
Also, when I run:
./budget_proj/manage.py diffsettings
I see that there are some Python or Django settings that are set, including:
SETTINGS_MODULE = 'budget_proj.settings.dev'
I am not sure how/where those variables get set. They are not Bash shell environment variables. At least some of them come from:
budget_proj/budget_proj/setting/base.py
budget_proj/budget_proj/setting/dev.py
Well, I just freshly broke my python installation today so I can't try recreating this until I put 3.5 back on my computer, but some thoughts:
Mike - makemigrations
is not necessary to run to get setup the first time. This command just checks of the state of your django models and the database (as described the migrations) and syncs them up if it detects any differences. migrate
actually applies those changes to your database if necessary. Since as developers we are hopefully including the migration files with the project this step should do nothing.
@jimtyhurst I did modify that line in manage.py, but it was originally:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.py")
- I just pointed it to the new settings file - choosing to use 'dev' as the default.
dict.set_default
here is just setting the 'DJANGO_SETTINGS_MODULE' to the default value if it's not already set
I think that some of our extensions, like DRF, have default settings they come with but I'm not sure if those default settings are actually set in django.conf.settings or they're stored somewhere within the package's codebase.
All other settings you see should be in 'base' or 'dev'.
EDIT Also, I'm actually comfortable having a bug or two in the setup process as long as we're aware of them and know how to fix. Fixing them would be a good way for a new contributor to familiarize themselves with the codebase/github workflow.
I performed a walkthrough of the new README in advance of tomorrow's Hackathon - make sure I know what others will be using, and see if there's any issues that I could clear up.
I discovered one issue that I don't know how to immediately solve, so rather than delay the solution I'm posting my finding in hopes that others might know how to solve.
Steps taken
I'm following this version of the README and I got through to Step 4 of "setting up your development environment". When I run the
./budget_proj/manage.py makemigrations
command, I receive this error in return:Is there a missing step where we'd run
source bin/env.sh
or similar to populate the DJANGO_SETTINGS_MODULE? Or is this an irreproducible artifact of my ever-shifting dev environment?