?

Log in

No account? Create an account
Previous Entry Share Next Entry
how to set environmental variables in windows 7
pic1
lawgon
[16:20] [djangoobie] anyone have tips on configuring DJANGO_SETTINGS_MODULE on windows 7
[16:21] [all_vs_one] whhat knd of tips do you need?
[16:22] [djangoobie] whenever I use manage.py syncdb or the reset function it can't continue because DJANGO_SETTINGS_MODULE is either undefined or incorrect
[16:22] --] innervision has joined this channel (~david@189.75.37.158).
[16:22] [djangoobie] i've added 2 system environment variables, PYTHONPATH and DJANGO_SETTINGS_MODULE
[16:23] [all_vs_one] have't you forgot to add database configuration in settings.py?
[16:23] [FunkyBob] djangoobie: honestly, from what I've seen of all the pain in here from people using windows.... you will generally be better off running a vm of linux/freebsd/something-unixy
[16:24] [FunkyBob] even given the learning curve if you've never used *nix before... it will be easier
[16:24] [FunkyBob] that's, as I said, from my observations in this channel of the problems people have trying to work in Windows
[16:24] [djangoobie] I can't use linux and I don't have any experience with it
[16:24] --] cdr_ has joined this channel (~cdr@94-192-110-239.zone6.bethere.co.uk).
[16:24] [FunkyBob] [true, some people have it all sorted, and appear to work on Windows no problem]
[16:24] --] jorn has joined this channel (~jorn@unaffiliated/jorn).
[16:24] [FunkyBob] can't? why not?
[16:25] [all_vs_one] for enjoining good things you have to try bad things ath the beginning

[16:25] [FunkyBob] djangoobie: from memory... don't you have to log out and back in after setting env vars in Win32?
[16:25] [all_vs_one] djangoobie: take virtualbox, ubuntu and play

[16:25] [djangoobie] I'm doing graphic design between the development process and switching 2 OS all the time will drive me crazy
[16:25] [-- cyberdelia has left this server (Quit: Leaving...).
[16:25] [apollo13] s/tutorial/docs/
[16:26] [FunkyBob] djangoobie: that's why I suggested using a VM
[16:26] [djangoobie] I logged out

[16:26] [lawgon] FunkyBob: the other day I went to a browsing centre for a printout and the guy had to reboot after inserting the usb stick
[16:27] [lawgon] djangoobie: lot of people do graphic design on linux
[16:27] [FunkyBob] lawgon: "Windows has detected that you have moved your mouse. Your computer needs to reboot to handle these changes."

[16:27] [djangoobie] can the problem be PostgreSQL
[16:31] [djangoobie] so I set up the environment variables like in the docs, but now I get "Error: No module named settings"
[16:31] [FunkyBob] djangoobie: both SQLite and Postgres would require it to be set
[16:31] --] sym has joined this channel (~sym@cust27-dsl45.idnet.net).
[16:31] [FunkyBob] djangoobie: ah, well.. that's often caused by people misunderstanding PYTHONPAHT
[16:31] [-- sym has left this server (Client Quit).
[16:31] [lawgon] FunkyBob: is a that a thai dish?
[16:32] [djangoobie] :)
[16:32] --] r0bby_ has joined this channel (~wakawaka@guifications/user/r0bby).
[16:32] *** r0bby_ is now known as robbyoconnor.
[16:32] [FunkyBob] lawgon: :P
[16:32] [djangoobie] so how do I fix it?
[16:32] [FunkyBob] djangoobie: did you set/change PYTHONPATH env var?
[16:33] [-- beevee has left this server (Quit: Leaving.).
[16:33] [djangoobie] via Python you mean?
[16:33] [FunkyBob] no, the same way you set DJANGO_SETTINGS_MODULE
[16:33] --] keyo has joined this channel (7cbf53ee@gateway/web/freenode/ip.124.191.83.238).
[16:33] [djangoobie] yes it's configured one directory above my project
[16:34] [lawgon] configured where?
[16:35] [djangoobie] in the system environment variables window I added 2 variables, one called PYTHONPATH with the value of D:\djangoprojects and the django module variable is configured to be mysite.settings
[16:36] [apollo13] djangoobie: did you relogin?
[16:36] [m0no] djangoobie: well you dont need to add django settings module env variable in system environment
[16:36] [FunkyBob] apollo13: well, I think I've seen 3 or 4 people in the last month sk about it
[16:36] [djangoobie] yes I logged out for the changes to take efect
[16:36] [apollo13] try a reboot *runs*
[16:37] [m0no] djangoobie: presumably you have \djangoprojectz\mysite as your structure
[16:37] [apollo13] + check in the console if the env vars are configured correctly
[16:37] [djangoobie] m0no: yes
[16:38] [m0no] djangoobie: and djangoprojects\mysite has an __init__.py, settings.py, urls.py in it
[16:38] [djangoobie] yes
[16:38] [djangoobie] if I echo the PYTHONPATH in cmd it displays the correct path
[16:39] [FunkyBob] ok
[16:39] [FunkyBob] so, in a totally unrelated directory, run python
[16:39] [m0no] ok so open a new cmd window (as this will ahve latest env vars set)
[16:45] [djangoobie] brb gotta relogin
[16:45] [-- djangoobie has left this server.

[16:49] --] djangoobie has joined this channel (~djangoobi@82-169-114-214.ip.telfort.nl).
.
[16:49] [djangoobie] ok where were we :p, I had to import settings from django.conf ?
[16:52] [djangoobie] then what?
[16:55] [lawgon] reboot
[16:55] [djangoobie] the ENV variables are all loaded, no need to restart

[16:58] [djangoobie] i'll remove the DJANGO_SETTINGS_MODULE and see if it will work then, brb
[16:58] [-- djangoobie has left this server.

  • 1

Кошерненько

(Anonymous)
Hello .
Shikarnenko here. I liked it!
Keep up the good work! :)

  • 1