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
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
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
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
> 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
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_
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
> 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
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
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
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
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
> 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
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
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')
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
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.
--
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, '
18 matches
Mail list logo