Strange django question, I am running django with pycharm, when I set Template_debug = True and run the debug it says please set Template_debug = True template path is not available. Has anyone run into this before>
the_rat has quit
issackelly has quit
jiang42 joined the channel
cewing joined the channel
Zeograd has quit
theom3ga joined the channel
theom3ga
Hi guys, quick question. I'm using a formview for login. I'd like to change the success_url depending on an attribute of the just-logged-in user
I'm trying to do it on the get_success_url method but it does not work
I'm guessing it is getting executed before the actual login perhaps
michalmo has quit
k forget it, I had mismatched the case
schinckel
cnk: The best thing about Django (IMHO) is the form handling. It's a really sweet solution for validating user input.
jessamynsmith
schinckel: :)
schinckel
I even use django forms for processing data from other systems, or through our API.
tudmotu has quit
Debnet has quit
cnk
schinckel fair enough. I rarely do a full Restful API. Most of what i need is a javascript query interfact to some data
ghostmoth has quit
brockhaywood has quit
acangiani joined the channel
rmwdeveloper_
does anyone use PyReact? How do I configure it to also transform es6->es5?
syphon7 joined the channel
sturm has quit
ckpoint has quit
mfcovington has quit
ElChoppo has quit
syphon7
hey everyone. I am having a really tough time right now getting request.data to come through to a serializer in 'django rest framework' using token auth. No matter what I do, I cannot seem to get the request to show the data inside the serializer. I can confirm that the message has the token and data with fiddler though
anyone have any ideas? Im pulling my hair out at this point
Zeograd joined the channel
rkjdid joined the channel
dtzitz joined the channel
mfcovington joined the channel
codeitloadit joined the channel
xterm has quit
codeitloadit has quit
schinckel
cnk: I even use forms in my WebSocket handlers.
Forms everywhere, man.
cnk
I am kind of digging them but it will be a while before I am that much of a fan
schinckel
(on both sides: I use forms for url query params generation in the browser, too)
ghostmoth joined the channel
AndyRez has quit
Audioburn_busy joined the channel
sturm joined the channel
dtzitz
interest
interesting, why not use pastebin.com?
tchalla joined the channel
schinckel
ads
AndyRez joined the channel
tchalla
hello, anyone here have any experience creating multiple, unrelated inlines in the admin?
dtzitz
eh alright
I have a noob question, i asked in ##learnpython but I don't think anyone is home. I think that settings.AUTH_USER_MODEL contains a username property?
dtzitz: settings.AUTH_USER_MODEL is a string reference to a Django model class
it is resolved to the actual class by the OneToOneField, and that class has a `username` field
mossplix_ has quit
pantsofchocolate has quit
dtzitz
ahh
mossplix joined the channel
schinckel
tchalla: You'll probably have better luck writing your own view and template
mossplix has quit
knbk
the setting allows you to swap in a custom model class, that´s why it´s a string reference
mossplix joined the channel
schinckel
tchalla: It is often far simpler to do that.
mossplix has quit
tchalla
dtzitz@ what knbk said. if you're extending from either AbstractBaseUser or AbstractUser, it will contain the 'username'. If you're not looking to change the Auth model, then AbstractUser is the way to go
mossplix_ joined the channel
garrypolley joined the channel
mossplix_ has quit
schinckel: thanks
dtzitz
yea I am not smart enough to start messing with the auth stuff
knbk
better finish the tutorial first ;)
Geet joined the channel
Geet
Hey #django
dtzitz
yea, so I am going to finish the tutorial and then I had the idea to just try to build something that has worked for me in the past with javascript stuff but I sort of failed with .net
Geet
Have a general django question -- when I acquire apps from elsewhere, should I install them to my site-packages directory and make my own app to generate views/models/etc.
dtzitz
you guys have any opinions on getting a book vs just trying to build something
Geet
or should I put them directly into my django project directory
knbk
Geet: you would generally install third-party apps to your site-packages directory
Geet
knbk: then generate my own models/views to use those apps?
tchalla
dtzitz: try the docs. there are nice examples there
knbk
dtzitz: I would just start building and look up the things you encounter in the docs
Geet
dtzitz: I've had luck just building after finishing the tutorial. There is so much information for Django out there on the web. I don't know that you'd need a book
dtzitz
awesome
solomonix joined the channel
knbk
Geet: depends on what the app does. If you need models/views to use it, sure, roll your own
garrypolley has quit
dtzitz
I was banging my head against the wall trying to just build something after the tutorial using model first EF in .net
schinckel
Geet: Make sure you are using a virtualenv for your project, and install them there using pip
tchalla
Geet: If you're sure the app is reusable, sure place it in site-packages
dtzitz
glad to hear django might not be as hard
schinckel
Geet: You'll then be able to use `pip freeze` to see what versions of packages you have installed.
Geet
I have not been using Virtualenv for anything... is it that necessary?
And would I have to start over to use it now?
schinckel
Not necessary, but very, very useful.
Not at ally.
all.
dtzitz
whoever added the blog post about the security update to the motd, thank you!
schinckel
It just builds a sandbox for this project, allowing you to not worry about polluting your global python site-packages.
Which means you can do things like have different versions of different packages per-project.
vranac joined the channel
Geet
ah, I see
Good to know
knbk
Geet: I´ve never seen anyone recommend to not use virtualenv. It´s an awesome tool, used by pretty much everyone
schinckel
Geet: I virtualenv all the things now: use pipsi for installing python-package-commands.
Geet
If I start a virtualenv now, would I need to reinstall the packages that are in my other python path?
or are those paths added to virtualenv's path?
schinckel
By default virtualenv does not have access to global site-packages now, but it's easy to see what is installed globally, put it into a requirements.txt and then install from there.
Alternatively, you can pip install -e <path> if it's a local git/hg checkout of a package (that you are still working on, for instance).
But run pip freeze to see what is installed, and stick this in a requirements.txt in your project (and then remove the bits you don't need).
Nemus_ has left the channel
sturm has quit
Quitta joined the channel
buzzzz has quit
Geet
the requirements.txt will tell the virtualenv to pull global packages?
or will ensure I download what I need?
rogue_scholar has quit
schinckel
Geet: pip install -r requirements.txt will install everything from that file (and any cascading dependencies)
Okay, thanks. So for the last app I was working on I installed it per instructions, which put it in my site-packages... I also put it in my Django directory, and then made another app that called its classes/methods.
schinckel
I'll often not have the virtualenv as the project directory now.
Geet
I see that when I do "haystack.__path__" i'm using the one in my Django project directory. If I delete it, will having 'haystack' in Installed_apps pull it from site-packages?
schinckel
Python really doesn't care _where_ a package is installed: as long as it's on the PYTHONPATH it's all good.
jtri joined the channel
jtri
anyone know if you can configure the placemnt of [source] links when using :autoclass: with sphinx ?
Zeograd has quit
schinckel
Geet: python -c "import sys; print sys.path"
or print(...) if you are python3-ing
ghostmoth has quit
Geet
interesting
my project idrectory is on there, but also everything else... so it doesn't matter where I put it
issackelly joined the channel
schinckel
It really only matters if there are multiple matches on a package: then the first source in the list containing that package is used.
Geet
so having an app listed in my settings.py, that app just needs to be somewhere on the path?
I thought it had to be in the local directory... this is great to know
schinckel
Yep. It's potentially worth putting your apps in a directory.
Geet
if I'm going to be editing them, I'm assuming?
or if I want to deploy an all-in-one type of package?
tchalla has quit
schinckel
It all depends on how you want to deploy.
Quitta has quit
Geet
so I cannot do "python manage.py startapp pip" if I wanted to, since this is on the path, for example
you inadvertently answered a lot of my questions... I thought everything needed to be a little more localized
I was confused when it was having me 'pip install' a django package