i am a newb too, so don't take my method as gospel
jorvis
We're going to have to change that expression.
rudasn has quit
ecksile
?
mtrythall joined the channel
hairy has quit
tbaxter
litewait: or you could just use the built-in generic TemplateView, which is built to do exactly what you're wanting to do.
jorvis
To some (me), something in the gospel is something to not be believed
sari11
brimpa: its a bundle with apache, databases, django, python for Windows, otherwise setting everything up was annoying. I suppose I could hop on a linux VM and restart there...
Hi I am trying to set up a postgresql database and I installed postgresql and psycopg2 and created a user and database, but am not sure what to put under Name in settings.py
jderosa joined the channel
hairy joined the channel
GoClick joined the channel
Frantic has quit
GoClick
What's the preferred way of dealing with substantially different settings.py files for various development machines and production using the same git repo?
scruz joined the channel
mauricioantunes has quit
z0ran has quit
brimpa has quit
Jax
GoClick: use the DJANGO_SETTINGS_MODULE env variable
you can check the approach used in "two scoops of django"
they explain it pretty well
z0ran joined the channel
ustunozg_ joined the channel
GoClick
Jax: okay
Jax
basiicaly i just have something like: settings/base.py then something like settings/dev_jax.py which does an import * from base.py then you just add your overrides in that file. in my virtualenv bin/postactivate i just do something like export DJANGO_SETTINGS_MODULE=settings.dev_jax
tbaxter
ecksile: in my opinion, the generics are the first thing people should learn. Not only are they tremendously helpful on their own but they're a good way to ease into more advanced views.
djapo joined the channel
GoClick
Well 2 scoops was already on my Amazon wishlist so I might as well just pick it up
Jax
GoClick: sure, support your local geeks ;)
BlueDreams joined the channel
hairy has quit
ustunozgur has quit
ustunozg_ has quit
dlam joined the channel
minim
If someone wanted a list view with objects from multiple models that could be paginated using Django's pagination, what would be the best way to do this? (Right now I'm chaining them in get_context_data, but there doesn't seem to be a straightforward way to paginate this.)
davividal has quit
dlam
is there a way to customize the admin to show a intermediate confirmation page when saving a model? for example, i want to warn non-technical users of the admin to be careful when changing the 'slug' for an Article, as that might break links
scruz has quit
tbaxter
minim: I generally use itertools chain to chain the QS from the different models, then pass that to a ListView
z0ran has quit
jfkdaddy
I'm also using itertools.chain with QuerySets for a similar situation.
scruz joined the channel
z0ran joined the channel
tbaxter
minim: but I dont think you want to do it in context_data. I think you want get_queryset
dlam: I put slug in a hidden fieldset. If they're not smart enough to open it, they're not smart enough to edit slug.
minim
tbaxer: Was just about to ask. I'll make that change. Thank you for the information. (And thank jfkdaddy for confirming this is a good way to do it.)
atula has quit
big_area joined the channel
brimpa joined the channel
nicholasserra has quit
skeet70 joined the channel
brimpa has quit
brimpa joined the channel
frodopwns joined the channel
jfkdaddy
How do people deal with providing test/development data that can't live in fixtures such as images? Just commit a tiny "media" or "static" directory into version control?
scientist1642
Nelluk: deploying on digitalocean turned out painless ;)
Ergo joined the channel
Nelluk
good to know
i assume if i have a domain set up then i will just follow that tutorial
hairy joined the channel
scipy53 joined the channel
quake_guy has quit
SmileyChris joined the channel
scruz has quit
scipy53
I don't know too much about networking, so I have a question about my project. I want to demonstrate it to someone else (not on my local network). Is there any way to do this without hosting my project on something like aws or heroku? I.e. can I just run the webserver like I normally do to test at localhost in some way which will allow anyone in the world to connect to the server on my own pc?
system64 has quit
scientist1642
Nelluk: Yeah, but I wonder for django projects what are advantages over pythonanywhere
scruz joined the channel
brimpa has quit
garrypol_ joined the channel
rabbite
I'm trying to detect the presence of csv_submit in the following request.POST object
if 'csv_submit' in request.POST seems to be failing
zerick has quit
felixsamora joined the channel
oh snap!
underscores!
Nelluk
scientist1642: wel the free pythonanywhere accounts dont have SSH, cant use source control, limited libraries, etc.
brimpa joined the channel
ovnicraft has quit
zerick joined the channel
garrypol_ has quit
thedodd has quit
hairy has quit
radimnov has quit
wenzhixue joined the channel
wenzhixue
I know a object pk for a model , how do i get the next object?
scruz has quit
com_kieffer has quit
scipy53
Any AWS Elastic Beanstalk users here?
ojh joined the channel
leandroa has quit
aah joined the channel
scruz joined the channel
tbaxter
wenzhixue: define "next". Next by ID? Next by date? Are they categorized?
dirn has quit
zenoamaro joined the channel
dirn joined the channel
ecksile
or do you mean getting the other columns from the object once you've identified it by key?
leandroa joined the channel
wenzhixue
tbaxter : next by id
tbaxter: but you can't do obj.pk +1 , because the next object maybe delated, so the next id could be obj.pk+ n
tylergoza has quit
jjmalina has quit
jjmalina joined the channel
scruz has quit
jjmalina has quit
felixsamora has quit
streblo joined the channel
streblo
is there a way with django and postgres to get more informative error messages than "InternalError: current transaction is aborted, commands ignored until end of transaction block"
adamduren has quit
dsirrine has quit
scientist1642 has left the channel
scruz joined the channel
ojh has quit
Siecje has quit
GoClick has quit
hairy joined the channel
forcer
streblo: You should find the real error earlier in the log
rideh has quit
ecksile
streblo why don't you pull out all the records after the one whose id you know (or set a limit of like 10 after) and stick them in a list then just iterate over the list?
nlh joined the channel
felixsamora joined the channel
sddhrthr2 joined the channel
jjmalina joined the channel
streblo
forcer: that is not correct, there are no other messages in the log or traceback that inform *what* caused the transaction to abort
wittgenstein joined the channel
flenter joined the channel
ecksile: because that's tedious
garrypolley has quit
garrypolley joined the channel
ojh joined the channel
forcer
streblo: That error ("transaction is aborted...") means that there was an SQL-level error, so Postgres will deny any further SQL statements until the next ROLLBACK. There has to have been a prior error.
skaflem has quit
sundjango joined the channel
joshfinnie has quit
sundjango
hey, me again :'( total newbie... I have two users based on django,contrib.auth.models.User. Customers and shop owners. My problem is I want to confirm the registration of shop owners.
Perhaps I can do it with is_active field but I also would like to any related model (via foreign key) should not be activated as well