differentreality / supplies_tracker

Django project for tracking home and office supplies
GNU General Public License v3.0
5 stars 10 forks source link

create config folder. modify manage.py to point to config folder for … #78

Closed jshcrm closed 6 years ago

jshcrm commented 6 years ago

create config folder. modify manage.py to point to config folder for settings. Move wsgi and settings file to config. Create master url conf, move admin urls to master url conf, include supplies_tracker urls. remove unused imports, clean up code style.

A separate config folder is recommended by https://www.twoscoopspress.com/ and https://github.com/pydanny/cookiecutter-django (same author) to separate app files from project files. It will become more useful when new apps are added to the project.

angeanto commented 6 years ago

Hi @joshcrim ,

Is everything running without errors to you ? Coz , i am getting some errors including ModuleNotFoundError: No module named 'supplies_tracker.settings' . I am trying to figure this out

jshcrm commented 6 years ago

Are you getting the error in dev or on production? If on production, is manage.py added to git ignore?

manage.py only does 2 things (with the default setup): 1. set the settings file path in environment variables and 2. execute the command passed from the command line.

I updated manage.py to point to the new settings file in dev. If you're having the problem in production, check manage.py to make sure the line that sets the settings file path looks like this:

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")

jshcrm commented 6 years ago

Also, I checked out the conflicts:

In urls.py keep the HEAD for my branch, not master. My branch removes unused imports and moves the staticfiles to config/urls.py

Looks like the settings.py conflicts are just from the PEP 8 changes

jshcrm commented 6 years ago

Crap I didnt mean to close this, I was making changes to my git setup -_- ill re-open this evening

angeanto commented 6 years ago

I am getting the error in dev. This is the ss of the errors. i am using Pycharm Professional and when i press run to test this PR from pycharm i get following errors.

screenshot from 2018-02-16 10-20-20

Although , when i started server from terminal it started without any error. I am not sure but does this line from django.core.management import execute_from_command_line in manage.py means server starts only from terminal ? im waiting to open your pr

jshcrm commented 6 years ago

Did a little research, it looks like maybe you need to modify your django settings inside pycharm? Try settings -> languages -> django and see what the settings file path is there.

jshcrm commented 6 years ago

Any luck? I've been waiting for #82 to finish before resubmitting this PR so that we don't run into any merge conflicts.

robertpro commented 6 years ago

I am sorry for the delay, I was not sure about what should I do, I think it is done. #82