Re: Deploying Django project

2014-11-20 Thread ajohnston
I would recommend that you read the book "Two Scoops of Django" which covers many (all?) of the issues involved with maintaining dev/staging/production environments, including the kinds of deployment questions you're asking. I think it will answer a lot of your questions, then maybe you could a

Re: DDT not showing

2014-03-10 Thread ajohnston
Make sure you include your client/browser IP address in the INTERNAL_IPS setting (settings.py) something like this: INTERNAL_IPS = ('127.0.0.1','192.168.1.112') -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: Big Picture?

2013-07-07 Thread ajohnston
Hi Ron, To understand more clearly how Django works and what it can do for you, I would strongly urge to you go through the tutorial here: https://docs.djangoproject.com/en/dev/intro/tutorial01/ Depending on your current Python level and familiarity with web programming in general, it will tak

Re: Tutorial database problem

2012-05-27 Thread ajohnston
What happens if you do: $ python manage.py shell ## at the bash prompt >> import django.db.backends.sqlite3 ## in the python shell If you get an error, you might try reinstalling django. But I'm not sure what the problem is/was. Your DATABASES code looks fine. -- You receive

Re: Why '&' is breaking Django CharField(python strings) into parts?

2012-03-12 Thread ajohnston
> Is this a good approach ? > > Yes, that is a better approach. I was going to suggest that earlier, but only now had time to post. -- 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.goog

Re: built-in-views trouble

2012-03-12 Thread ajohnston
1. > Exception Type: ViewDoesNotExist > Exception Value:Tried logout_user in module myapp.views. Error was: > 'module' object has no attribute 'logout_user' > 2. > Here is my current url setting: > url(r'^accounts/password_reset/$', > 'django.contrib.auth.views.password_reset', name='password_

Re: built-in-views trouble

2012-03-11 Thread ajohnston
Out of curiosity, which version of Django are you using? Which message to you get when ViewDoesNotExist is raised?: "Could not import %s.%s. View is not callable." % "Could not import %s. View does not exist in module %s." % "Could not import %s. Parent module %s does not exist." % Alan On Satu

Re: help with time

2012-03-03 Thread ajohnston
> You'll have to add another loop for the hours if you want more than just > 12:xx. Actually, after I hit send, I was sort of curious about how to handle the hours if you cross over from a.m. to p.m., but you just have add another range to the comprehension, and use 24-hour format in the hour ran

Re: help with time

2012-03-03 Thread ajohnston
On Mar 3, 12:54 am, Scott Macri wrote: > OK, I guess a better question is how do I switch my time outputs using > datetime.time from 24-hour clock to 12-hour clock so I can use am/pm? > I think this will work for what you need: >>> import datetime >>> TIME_CHOICES = [(datetime.time(12, min), dat

Re: sqlite3 database error

2012-02-13 Thread ajohnston
Also 'Webseite' in your file path may be misspelled? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@goog

Re: sqlite3 database error

2012-02-13 Thread ajohnston
Sorry. To be clearer, I should have said. In your db file name: C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-win32- x86-3071000\test.db try changing the \ to / See: https://docs.djangoproject.com/en/dev/ref/settings/#name -- You received this message because you are subscribed to the

Re: sqlite3 database error

2012-02-13 Thread ajohnston
Try changing the slashes form \ to / On Feb 13, 4:50 am, Marcus Maximus wrote: > Hey guys, > > i am using sqlite3 for my django app. BUT I have problems installing > it. Here are my configs: > > DATABASES = { >     'default': { >         'ENGINE': 'django.db.backends.sqlite3',  # Add > 'postgresq

Re: How do I sort choices by their localized label?

2012-02-11 Thread ajohnston
> class CountryField(models.CharField): >     def __init__(self, *args, **kwargs): >         kwargs.setdefault('max_length', 2) >         kwargs.setdefault('choices', COUNTRIES) >         super(CountryField, self).__init__(*args, **kwargs) Btw, the reason this doesn't work is because setdefault do

Re: How do I sort choices by their localized label?

2012-02-11 Thread ajohnston
Sorry I just realized that even though that sorts them correctly, it doesn't solve your problem. Have you tried setting the choices in your form, like: class SomeFormUsingCountryField(forms.Form): def __init__(self, *args, **kwargs): super(SomeFormUsingCountryField, self).__init__(*ar

Re: How do I sort choices by their localized label?

2012-02-11 Thread ajohnston
I think this should work: >>> COUNTRIES = ( ... ('GB', _('United Kingdom')), ... ('AF', _('Afghanistan')), ... ('AX', _('Aland Islands')), ... ('AL', _('Albania')), ... ('DZ', _('Algeria')),) >>> sorted(COUNTRIES, key=lambda COUNTRIES: COUNTRIES[1]) [('AF', 'Afghanistan'), ('AX', 'Aland Islands')

Re: Entering Text into a Database

2012-02-02 Thread ajohnston
On Feb 2, 2:30 pm, ds39 wrote: Is there any page, outside of the > official documentation, that gives an example from beginning to end > regarding how to save ModelForms in your database using views.py > rather than the shell (including sample URLs) ? Also, how would I > access the entered text vi

Re: Newbie django/python with C++ background wants enums

2012-02-02 Thread ajohnston
I'm straying a bit off-topic here, but I forgot to mention that other way I've seen people do 'enum' in Python is: >>> class Colors(object): ... RED, GREEN, BLUE = range(3) ... >>> c = Colors() >>> c.RED 0 >>> c.BLUE 2 >>> c.GREEN 1 Not sure this helps much in this particular case though. --

Re: Newbie django/python with C++ background wants enums

2012-02-02 Thread ajohnston
I would probably do it Bruno's way, since it is more explicit, but just so you know, there are some enumeration tools in Python. Just not an 'enum' type: >>> base_choices = ['No', 'Yes'] <-- transform this any way you want: >>> choices = list(enumerate(base_choices)) >>> choices [(0, 'No'), (1, '