I'd like to 're-open' this question to ask another (maybe) short one:
Therefore, is django not very suitable for NOSQL databases like mongo or
couch or others in general?
Or is the problem specifically using RDBMS in a NoSQL manner?
Because if using NOSQL, the whole model system would be obsolet
tks! that was it! Sorry for the ignorance, but i'm starting with python too!
Sexta-feira, 19 de Dezembro de 2014 12:00:01 UTC, Guilherme Leal escreveu:
>
> Are you sure that your shell is running on the same folder that contains
> the manage.py?
>
> Em Fri Dec 19 2014 at 09:53:05, Valéria Pacheco
Are there any known attack vectors that involve appending a period/
full-stop to a sites domain name?
My Django application throws a handful of errors in production every day:
ERROR: Invalid HTTP_HOST header: 'www.example.com.'. You may need to add
u'www.example.com.' to ALLOWED_HOSTS.
(note the
Hey Alex,
a trailing . in the host header is valid per RFC 3986:
http://tools.ietf.org/html/rfc3986#section-3.2.2:
The rightmost domain label of a fully qualified domain name in DNS may be
> followed by a single "."
/Markus
On Monday, December 22, 2014 12:44:25 PM UTC+1, Alex Haylock wrote:
Thanks Markus.
So, as per the RFC, are 'example.com' and 'example.com.' considered to
be the same domain, or two separate domains?
Are there any security implications if I add 'example.com.' to
ALLOWED_HOSTS to cater for these requests?
Thanks,
Alex.
On 22/12/14 11:52, Markus Holtermann wrote:
Alex,
The trailing period could be from online promotional materials for your
site. Someone may have written your URL with the trailing period inside the
URL by mistake when the promotional materials were created. It may not be
an attack vector from a malicious hacker, but instead, valid users jus
Hi Alex,
There is no security implication adding 'example.com.' (with trailing
dot) to your ALLOWED_HOSTS setting. There is some more information in
the ALLOWED_HOSTS setting docs.
From https://docs.djangoproject.com/en/1.7/ref/settings/#allowed-hosts
In previous [<= 1.6.X] versions of Djan
It's hard to answer without seeing what's in your db, and what are the
values of ano/mes/dia variables, but:
- maybe you do not have pytz package installed (you can install with 'pip
install pytz') - though in that case you should get an error when trying to
access the results
- maybe the day
Thanks Alasdair, that's really useful. I'm using v1.6.X in production,
which makes sense based on your email.
Alex.
On 22/12/14 13:58, Alasdair Nicol wrote:
> Hi Alex,
>
> There is no security implication adding 'example.com.' (with trailing
> dot) to your ALLOWED_HOSTS setting. There is some mo
Is there any difference, either functional or performance wise,
between these 2 constructs:
Q(f=1) and filter(f=1)
Or, between these 2:
(~Q(f=1)) and exclude(f=1)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group
>
>
> > What do you think - is this expected?
>
> Yes, this is expected. Django's form system is designed for use with
> HTML forms, which do not provide partial data: unchanged field values
> are sent too, so this problem does not occur.
>
I thought that Web framework can validate RESTful(-l
Hi Collin,
Am 20.12.2014 um 00:18 schrieb Collin Anderson:
save_model() happens first, then save_related() which
calls save_formset() on each formset.
It might end up being easier to save the parent model _again_, instead
of doing something before it's saved.
Thank you very much for your repl
Hi Alex,
Am 20.12.2014 um 22:47 schrieb Alex Haylock:
Take a look at the Django signal dispatcher:
https://docs.djangoproject.com/en/dev/topics/signals/
Specifically, the 'update_fields' argument passed to the 'pre_save'
signal should provide what you need:
https://docs.djangoproject.com/en/de
Hello community, I wanted to show interest in collaborating on an
opensource Django application called Gazelle (a fork of Mezzanine).
I built a SearchQuerySet with a drop in replacement to the filter() command
which does not hit the database.
So, far the results are promising and I am opening the p
Hi Colin,
> Den 21/12/2014 kl. 05.55 skrev Collin Anderson :
>
> If you want a nicer interface, I just ran manage.py inspecdb on one of my
> databases and got this for the cache table. Not sure why django still does it
> by hand.
>
> class Cache(models.Model):
> cache_key = models.CharFiel
Hi Russel,
> Den 22/12/2014 kl. 00.40 skrev Russell Keith-Magee :
>
> If you *do* want to do complex queries on the database cache table, the
> approach suggested by Collin is as good an approach as any. A managed table
> will give you ORM operations over an arbitrary table - include Django's o
> Den 22/12/2014 kl. 11.27 skrev Felipe Faraggi :
>
> I'd like to 're-open' this question to ask another (maybe) short one:
>
> Therefore, is django not very suitable for NOSQL databases like mongo or
> couch or others in general?
> Or is the problem specifically using RDBMS in a NoSQL manner?
Well, Django, in the role of an ORM, is necessarily pretty coupled to SQL. I
know people have been toying with nosql databases with Django; I don't know
much about those efforts.
EAV intentionally defeats the intended use of RDBMSes by ignoring normalization
and data typing, thus (among other
On 22/12/2014, Alasdair Nicol wrote:
> [ ... ]
> > In Django 1.7, the trailing dot is stripped when performing host
> > validation, thus an entry with a trailing dot isn’t required.
How odd, since the canonical representation would be to add a dot when
one is missing rather than removing it whe
I'm trying to work through the Poll Tutorial and I've run into some
problems. I'd like to compare the code I've written to a working file. Is
there any place to download the entire working project?
--
You received this message because you are subscribed to the Google Groups
"Django users" gr
Hi,
There's a good example of creating a custom manager here:
https://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers
Collin
On Saturday, December 20, 2014 8:28:57 AM UTC-6, pythonista wrote:
>
> Thank you for your response.
>
> Most of my data is complex raw sql.
> I had pla
I'm in the process of incrementally upgrading a site running some ancient
software (django 1.3.1 and django-cms 2.2). I've got a development version of
the site running django-cms 2.3.8 (and still django 1.3.1) for testing. The
plan is to get it up to modern versions of both, but one step at a
Hi,
Do you have more of your traceback?
Are you sure this is your "home" view that's being called?
Is this happening in an included template?
Collin
On Saturday, December 20, 2014 3:27:00 PM UTC-6, Alexandre Provencio wrote:
>
> Hello all, this is a cross post i made on stackoverflow
>
> http
Hi,
Are you sure you saved your code? There's a len() in your traceback that
isn't in your code.
Collin
On Saturday, December 20, 2014 3:50:11 PM UTC-6, Dariusz Mysior wrote:
>
> I change it on
>
> import csv, random
>
> def new_name():
> with open('PL_surnames.csv', newline='') as csvfile
Hi,
Something like this might be a start:
class UserIP(models.Model):
user = models.ForeignKey(User)
ip = models.GenericIPAddressField()
last_seen = models.DateTimeField(auto_now=True)
class Middleware(pass):
def process_response(request, response):
if request.user: # or
That seems like a bit of a broad brush stroke against Django. Have you
looked at the Django REST Framework module? It can often utilize your
existing views, and has support for partial updates.
http://www.django-rest-framework.org/api-guide/serializers/#partial-updates
Django is primarily used fo
Hi,
You're just using one database?
Are all 6 ALTER statements identical?
Collin
On Sunday, December 21, 2014 5:27:06 PM UTC-6, pjotr wrote:
>
> Just realized the subject was wrong, it should be *makemigrations , not
> makemigrate*
>
> On Sunday, December 21, 2014 8:36:29 PM UTC+1, pjotr wrote
Hi,
The model name is hidden in model.__name__ or model._meta.model_name, and
you can't access attributes starting with underscore in templates.
This might work:
from django.db.models import get_app, get_models
def index(request):
app = get_app('sampledb')
modeldict = {model._meta.mod
28 matches
Mail list logo