#django

/

      • jankowiak
        yup
      • daschel
        while im at it, does anyone know of a good django book in russian or whether the russian documentation is on par with the english?
      • _Qman joined the channel
      • okcomputer
        jankowiak: yeah its basically the standard smtp server, you can't go wrong with it
      • jankowiak
        If you need a cms go with mezzanine or django cms, I learned the hardway that there is no need to reinvent the wheel...
      • jhgaylor
        i used something called Zinnia once. that was a mistake
      • jankowiak
        now just need to figure out how to get around mails sent being flagged as spam...
      • yassine joined the channel
      • robottinosino joined the channel
      • vital101 has quit
      • markvandenborre
        I am modelling a shop in django's orm, a shop run jointly by two companies; one provides the product, the other the services around it
      • tbaxter
        jankowiak: well, django-cms is pretty opinionated. Not sure about mezzanine. I quite like the CMS I developed. It's worked well for two magazines and a fairly large paper. Sometimes reinventing the wheel is just what you need.
      • markvandenborre
        so I would like to associate most products with their related services
      • if a product has a related service, there is only one
      • okcomputer
        jankowiak: are you sending from a domain or somewhere else that would cause mail to be flagged?
      • uris has quit
      • natea joined the channel
      • jankowiak
        basically the mails get sent as the user filling out the contact form
      • markvandenborre
        how would I model that in django's orm? ForeignKey, unique=True?
      • OneToOneField?
      • okcomputer
        jankowiak: are you the receiver?
      • jankowiak
        The receiver is always the same: info@example.com
      • daschel
        im gonna run. thanks okcomputer and jhgaylor. im going to check the book out
      • strocknar_ is now known as strocknar-away
      • hassans has quit
      • okcomputer
        jankowiak: what i mean is, does the address belong to you
      • daschel has quit
      • jankowiak
        okcomputer: yes
      • darkstar| has quit
      • okcomputer
        jankowiak: so can't you just whitelist the domain in your email client?
      • tunafish has quit
      • SStoves
        IS there a way to configure Django to run on a shared hosting environment ?
      • rideh has quit
      • jankowiak
        the problems is that the from address is always different
      • it is always from the address the user sets in the contact form
      • lightstrike has quit
      • SStoves
        I only have FTP Access to the account but they say Python is supported.
      • leok joined the channel
      • jankowiak
        There used to be a way to fix that in PHP but I can't find my bookmark to check the headers...
      • pjs
        SStoves of course there is a way, but that's unique to your webhost
      • okcomputer
        jankowiak: i see. How about changing the form so the address is in the content and all mail gets sent from the same address?
      • jvdm has quit
      • jankowiak
        That would fix the issue for sure, not my favorite solution but it will work
      • thanks okcomputer
      • SStoves
        Is the preferrered method to just get it installed on the server itself versus hacking it to your folder the way you would perl modules ?
      • achew22
        jankowiak: just change the reply-to header in the email to be the real email and have it come from contact@yourdomain.com?
      • SStoves
        I can get anything installed on the server I want.. I just need to find out the easiest method
      • achew22
        jankowiak: that way when you hit reply in your mail client you can't forget to change the to
      • okcomputer
        SStoves: theres some django specific hosts, but if your host doesn't give you ssh access you might have problems
      • moneydouble joined the channel
      • SStoves
        okcomputer: What kind of problems would you have? My main brunt of python experience is addons for counterstrike and what not and those are FTP only.
      • faldridge joined the channel
      • jalstad has left the channel
      • okcomputer
        SStoves: just manually running commands
      • garrypol_ has quit
      • dray3 has quit
      • voidus joined the channel
      • garrypolley joined the channel
      • ErvisTusha joined the channel
      • markekramer has quit
      • m8 has quit
      • SStoves
        okcomputer: I'm coming from the world of PHP so I'm not used to manually running commands to test them. Just proper checks and balance usage. I'm going to be using Django for my personal website as a way to learn it
      • jankowiak
        achew22: thanks testing that out
      • okcomputer
        SStoves: like for example the django-admin app, i don't see how you can run that without the shell
      • mlavin has left the channel
      • tbaxter
        django-admin.py isn't an app. It's just a script.
      • okcomputer
        tbaxter: i know, my terminology sucks
      • achew22
        SStoves: if you just want to play with django, try running it off Heroku. It's stupidly easy. It isn't going to hold when you have a billion requests/sec but if you just want to play and don't want the hassle of figuring out how to set up a gunicorn daemon, try it out.
      • golodhrim has quit
      • tbaxter
        so does mine, most days.
      • caleb_ joined the channel
      • dmclain has quit
      • SStoves
        achew22: I'm looking to use python as a PHP replacement due to how much faster it processes things and uses less system resources overall. At least from what I can tell from comparisions and benchmarks. I was advised by a friend to look into Django and use that.
      • okcomputer
        SStoves: I tried django on a cheap host with no shell access and it was not possible to run the script to start the project so i cancelled after 1 day
      • SStoves
        okcomputer: I'm actually one of the owners of the small shared hosting company I'm on so I can get any/all access. We would just rather keep ssh locked down to just a few IP's
      • uris joined the channel
      • Maladio joined the channel
      • okcomputer: So gaining the access isn't the problem if its needed... Again, I'd just like to try and find ways to get it going w/o making it needed
      • jhgaylor
        for a lot of things you could deploy to a free heroku dyne
      • dyno* (stop auto correcting me mac!)
      • markekramer joined the channel
      • SStoves
        jhgaylor: LOL. What IRC Client are you using thats autocorrecting you? I always used Textual on my Mac
      • the_lord has quit
      • okcomputer
        SStoves: there are django specific hosting services like heroko, and something like cloudhost
      • Textual rocks
      • jhgaylor
        SStoves: chat azure, but i have a feeling thats gonna change soon. I'm not a big fan on it
      • xchat azure*
      • Maladio
        can I assign a formset to a model foreign key field, so instead of selecting an foreign key, I can create a new object and use the new object as the foreign key?
      • SStoves
        okcomputer: Using KVIrc right now on my Win 7... I would suggest going to Textual jhgaylor
      • jhgaylor
        SStoves: brb google
      • golodhrim joined the channel
      • SStoves
      • jhgaylor
        or rather, duckduckgo. burn in hell google!
      • dsb has quit
      • bullicon has quit
      • SStoves
        I really wish they would make a Windows Port :(
      • markekramer has quit
      • okcomputer
        textual reminds me of IrcII
      • m8 joined the channel
      • mayhew joined the channel
      • cebor has quit
      • I also use limechat
      • SStoves
        okcomputer: Can't you use manage.py on a web interface instead of using django-admin? Isn't it the same thing ?
      • I could be 100% wrong there :)
      • jasondotstar has quit
      • jhgaylor
        django-admin pretty much is the same as manage.py
      • moneydouble
        Hey guys. I'm working on a platform with Django and Python. I need to have two different kind of users with the django auth and user system. So I'm creating two logins. One for employees, One for customers. Whats the best way to do that since Django only allows one custom user model? A oneToOneField with the User for the user profile info?
      • Both employee and customers will store different related information.
      • jhgaylor
        moneydouble: you could just create 'Customer' and 'Employee' which both have an FK to a user.
      • markekramer joined the channel
      • glassresistor has quit
      • mattmcc
        Do the users actually have different fields?
      • tbaxter
        moneydouble: I would suggest one user, but they can be in an 'employee' group
      • moneydouble
        mattmcc, yeah they will have different kind of information
      • tbaxter
        how much different info, and how much of it is required?
      • Hazel- joined the channel
      • Hazel-
        i need to have two forms in the same view
      • markekramer has quit
      • caleb_ has quit
      • tbaxter
        Hazel-: pass the second one in context
      • Hazel-
        mmm
      • tbaxter
        moneydouble: better yet, employees are staff (already part of the user model)
      • Hazel-
        tbaxter: but how to tell which one has been submited?
      • caleb_ joined the channel
      • seagreen has quit
      • tbaxter
        Hazel-: map each one to a different view in the form action(s)
      • ErvisTusha has quit
      • markekramer joined the channel
      • dcrouch joined the channel
      • Hazel-
        tbaxter: so they need to point to different urls
      • glassresistor joined the channel
      • moneydouble
        tbaxter: All the info will be different. Like customers will store the mailing address, etc while employees will not.
      • okcomputer
        isn't django-admin a manage.py wrapper or something of the sort?
      • voidus has quit
      • moneydouble
        There will be another type of user later on also, so 3 total.
      • tbaxter
        moneydouble: if it were me, I'd have all the fields I need on one model extending auth.user, then I'd actually use the fields needed based on is_staff and/or a 'customer' group.
      • VeryBueno joined the channel
      • that's what groups are for: separating users into groups
      • Hazel-
        but i want them to be in the same url and view.. is it right to tell which one has been submited looking at the POST data?
      • mattmcc
        okcomputer: Kind of the other way around. django-admin just calls management commands directly, manage.py DJANGO_SETTINGS_MODULE and then calls the command.
      • ineedarobot joined the channel
      • okcomputer: So if you have that environment variable set, you don't even need manage.py.
      • moneydouble
        Well, I thought about doing 2 flags on a custom user model. is_customer, is_employee. Then creating a profile model that stores the specific related information.
      • creating a profile model for customer and one for employee.
      • SStoves has quit
      • dcrouch
        Hello everyone. I have a django web app I'm testing on a vm and for some reason randomly all my style sheets just disappears on the layout. I don't know what's causing that. This was occurring yesterday. I started up the VM a new IP was received problem cleared. Added a print statement and it's back.
      • okcomputer
        mattmcc: got it, i know i read it was advised to use django-admin in place of manage.py
      • robvdl joined the channel
      • moneydouble
        Does that sound ideal tbaxter? mattmcc?