I am migrating a 1.5 project to 1.6 (then 1.9). imports used `import myapp` and settings had `myapp` in requirements. For 1.6 the project name needed to be appened. `myproject.myapp`. Can PYTHONPATH be set the app like in 1.5 or is that a bad pratice. (relative imports)
kodeart is now known as Guest39055
andygmb joined the channel
dkb20k joined the channel
apollo13
coulix_tap: the project name was never needed
coulix_tap
The djangoproject startproject does use the projectname in the default settings and urs. Is that optional?
dopry__ joined the channel
apollo13
project name is a "relative" term, all django needs is an importable path
What's the simplest way to form a queryset for `foreign_key = # OR foreign_key IS NULL`?
frostythesnowman
hi, i'm seeing a really weird phenomenon in my django app where a page load to /user/123 is also firing a request to /user in the background. does anyone know waht could be causing this?
intr1nsic joined the channel
BodaciousBrian joined the channel
deitarion
Wait, sorry. Conflating two problems. What I meant to ask is how do I do that for a many-to-many relation.
BodaciousBrian
can anyone help me get anything out of my django server that isnt a 500 error?
frostythesnowman
i've even tried purposely causing a traceback in the handler for /user. then, when i navigate to /user/123 (which is handled by a different handler), the page loads fine, but in my server logs i see a request going to /user immediately afterwards that triggers the traceback
Sammichmaker joined the channel
BodaciousBrian
i have posted my views and url/py here http://pastebin.com/5gc930kC urls seems to call views just fine, and views is being called, but the Index function in views is not responding at all
SlayerGoury has quit
mattmcc
frostythesnowman: Browser prefetching?
frostythesnowman: Does the same thing happen if you use curl, for example?
hutch34 joined the channel
deitarion
Actually, does Django's ORM have a way to enforce an equivalent to null=False on ManyToManyField?
phorloop_ joined the channel
mattmcc
BodaciousBrian: Looks fine, assuming the URL you're viewing is the root, e.g http://localhost:8000/
How are you running Django?
BodaciousBrian
Yes it is... Im running it via the manage.py runserver command
phorloop_ has quit
tuxtoti joined the channel
"[27/Feb/2016 17:32:12] "GET /test HTTP/1.1" 500 27" is all i get out of it
mattmcc
deitarion: There isn't an equivalent in SQL, so no. But validation for a form will trigger, that is if you have a ManyToManyField that isn't blank=True, a form won't validate if you don't pick an option.
BodaciousBrian
it seems nothing i change can get a different result
hpanago has quit
mattmcc
'/test' wouldn't call index.
Only '/'
phorloop has quit
BodaciousBrian
Oh sorry, i know.. i have just implemented a New test view. but the / is the same result
always error 500 27
mattmcc
So, you are getting a 500 there, what's the traceback?
BodaciousBrian
im not sure how to get a traceback
mattmcc
If DEBUG is True, it'll show up in your browser.
BodaciousBrian
DEBUG = os.environ.get('DEBUG') == 'True'
on the website itself all i get is "Server Error (500)"
mattmcc
So you need to set that environment variable.
maryokhin has quit
BodaciousBrian
haha, got it....
i thought that was setting it =) i have the traceback now
well, i might be able to solve this now that the debug is fixed
dheerajchand has quit
mattmcc
return render(request, "index.html", {'working'})
vyscond joined the channel
jaddison has quit
BodaciousBrian
ive tried that line about every way a view is returned that can be found online... In my templates directry i have an index.html that just says 'working' in the files
mattmcc
Well, {'working'} isn't a dictionary, it's a set.
BodaciousBrian
yes i just want anything to be returned..... that isnt a 500 anyway
dkb20k joined the channel
mattmcc
So make that a dictionary.
Since that's what's expected for the context argument to render..
And, maybe, run through the official tutorial again, or if you haven't yet.