Re: Newbie, trying [read: failing] to set up Django
Do you have psycopg2 installed? If you have pip then "pip install psycopg2" I would suggest using python virtualenv for django development. Makes life easier. On Sunday, September 16, 2012 5:28:12 AM UTC+3, Helly wrote: > > Hello all, > > I've been trying to set up Django for quite some time now. I'm on Mac OS X > Lion 10.7.4. As to my level of expertise, let's just say I'm pretty new > to...computers. I guess I figured I'd just stumble around until it worked. > How hard could it be right? Wrong. It seems like you all don't mind helping > out newbies though, so I thought I'd give this a shot. > > I'm running into problems with synchronizing Django with my database. I > installed MySQL and MySQLdb. I created a database and edited the > settings.py file according to instructions in the tutorial. However, I > couldn't get it to work with the python manage.py syncdb command due to an > "architecture" error. Keep in mind that I had, at this point, spent a > really long time trying to set these babies up, and this is what finally > stumped me. > > So, I told MySQL and MySQLdb that I was taking my ball home if that's how > they wanted to play. I downloaded and installed Homebrew, Macports, and > postgreSQL (through Homebrew) with minimal fumbling. There was one error > with my PATH but I fixed it in my .bash_profile. As per the advice of the > internet and Homebrew's brew doctor, I amended "PATH so that > /usr/local/bin occurs before /usr/bin." This allowed me to start up psql > and create a database - at least it seemed like it worked, there was no > satisfying little message about its dimensions like in MySQL. > > Anyhoo, now when I do python manage.py runserver or python manage.py > syncdb it tells me lots of stuff and "ImportError: No module named > psycopg2.extensions." What does this mean, and how do I fix it? I am > totally at a loss. > > I'm sorry if the way I posed the question is long/confusing, but I wasn't > really sure what information would be important. I can post the whole > output from the terminal if it's helpful. It's really long though, and I > had a hunch the last part is the important part. Any help would be greatly > appreciated. > > Thanks > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/4nUbruq74m0J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Test driven development in Django framework
Thank you for reply, I have been using your tutorial to learn TDD in django. One of the best I have found so far. You also talk about "unit tests" and thats what is confusing. As I understand, your tutorial examples are not unit tests in the strict meaning of the term. You have a great tutorial and I have learned a lot of them. Maybe too much focus on admin and polls app for me. I would have liked to see something different and new. What about running you selenium functional tests in a acceptance testing framework? I would love to see your tutorials for intermediate/advanced level. On Thursday, September 6, 2012 1:57:08 PM UTC+3, Harry P wrote: > > Hi there, > > I work for a bunch of XP fanatics, so we do quite religious TDD in our > Python/Django development. We start with functional/acceptance tests, > which we write using Selenium, driving a real web browser, and following a > test script that is essential a user story. We then write unit tests that > we can run using a python manage.py test. > > I've written a "TDD for beginners" tutorial, that covers both of these > types of test: > > http://www.tdd-django-tutorial.com/ > > I'd love any comments, feedback, suggestions? > > rgds, > Harry > > On Thursday, September 6, 2012 1:47:08 AM UTC+1, Mike Dewhirst wrote: >> >> On 6/09/2012 3:04am, Javier Guerra Giraldez wrote: >> > On Wed, Sep 5, 2012 at 7:46 AM, jyria wrote: >> >> What is your experience? Is it worth it, and is it possible? >> >> >> >> I tried it and found it quite difficult to follow guideline of unit >> testing >> >> -- testing a unit of code, a class for example. Maybe Im just >> ignorant, but >> >> I didnt see, how can I create registration app only with unit tests. >> The >> >> only way I could drive implementation with tests was using more like >> an >> >> integration testing approach: calling requests with data and asserting >> that >> >> new user was registered and that form was valid/invalid etc, but this >> goes >> >> against TDD as I understand it. So should I not worry about pure "unit >> >> testing" approach and use django client http request to validate >> >> RegistrationForm. Or I should write unit tests for RegistrationForm >> class? >> > >> > TDD is not unit-testing >> >> Here is a lovely diagram I found recently - probably by following a link >> someone posted here - which shows the TDD process with unit tests and >> acceptance tests. >> >> IMO it covers pretty much everything in the universe ... >> >> http://www.methodsandtools.com/archive/attready3.jpg >> >> > >> > https://www.google.com/webhp?q=tdd%20is%20not%20unit%20testing >> > >> > >> > in short, it's like you've found: the tests you easily get with TDD >> > are more (but not exactly) like integration tests, because you test >> > features, not units. The "test isolated units" mantra of unit-testing >> > requires different work. There's nothing wrong in adding 'real' >> > unit-tests, but it's not required to do effective TDD. >> > >> > I guess that since unittesting became so well known so long ago, >> > almost all test frameworks (including Python's and Django's) call >> > their base test class "UnitTest", but they're not; they're just tests. >> > you make them feature tests, or integration tests, or unit tests, or >> > whatever kind of test. >> > >> > now, about the pros/cons of unit-testing vs. other kinds of tests. >> > that's a whole debate that i'm not going to touch. >> > >> >> -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/APq2O40-Ll8J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Test driven development in Django framework
What is your experience? Is it worth it, and is it possible? I tried it and found it quite difficult to follow guideline of unit testing -- testing a unit of code, a class for example. Maybe Im just ignorant, but I didnt see, how can I create registration app only with unit tests. The only way I could drive implementation with tests was using more like an integration testing approach: calling requests with data and asserting that new user was registered and that form was valid/invalid etc, but this goes against TDD as I understand it. So should I not worry about pure "unit testing" approach and use django client http request to validate RegistrationForm. Or I should write unit tests for RegistrationForm class? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/OpZIMMWTTOcJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Can I run django tests in pydev's pyunit view?
Im used to JUnit testing in eclipse and Im wondering if I can hook up pyunit view with django tests. I would like to start my tests effortlessly within eclipse, pressing Ctrl+F11 or something like that and get red or a green bar. Currently I'm running tests in console and colorize output with fabric. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/rE6paGhF0GkJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.