Re: Recommendations for hosting service?

2015-01-06 Thread Kristofer Pettijohn
Also +1 for AWS. You can start out small for free for your first year, and grow to the size of Pinterest over time. All of the other tools they provide are helpful as well: RDS so you don't have to manage your own database, Caching Service, Queuing Service, etc. From: "Fred Stluka"

Re: Default UserCreationForm and UserChangeForm hard-coded to User; is this required?

2015-01-06 Thread Joel Burton
James – Thanks for the reply. I'd agree that the docs suggest you have things to do if you replace the User with a custom user mode—but the docs also say to use get_user_model() versus hardcoding User ;) It's true that the built-in user form makes assumptions about the length of the username

Re: Serving static files and media in Django 1.7.1

2015-01-06 Thread Sithembewena Lloyd Dube
Thanks @Vijay! Can't believe that caught me out like that. Regards, Sithu On Wed, Jan 7, 2015 at 1:34 AM, Vijay Khemlani wrote: > the static tag should be > > {% static 'mainsite/bootstrap.css' %} > > according to the layout you said > > On Tue, Jan 6, 2015 at 8:30 PM,

Re: Recommendations for hosting service?

2015-01-06 Thread Fred Stluka
+1 for AWS. Been using it for years. Keeps getting cheaper and better. --Fred Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/ Bristle Software, Inc -- http://bristle.com -- Glad to be of service! Open

Re: Serving static files and media in Django 1.7.1

2015-01-06 Thread Vijay Khemlani
the static tag should be {% static 'mainsite/bootstrap.css' %} according to the layout you said On Tue, Jan 6, 2015 at 8:30 PM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a Django 1.7.1 project structured as per documentation. In it, I > have an app called

Serving static files and media in Django 1.7.1

2015-01-06 Thread Sithembewena Lloyd Dube
Hi everyone, I have a Django 1.7.1 project structured as per documentation. In it, I have an app called "mainsite". In mainsite, I have templates/mainsite/index.html and static/mainsite/bootstrap.css. In the index template, I use {% load staticfiles %} and then for css I have the following link:

Re: Re: prob. with non-related objects deleted

2015-01-06 Thread James Schneider
No problem. If you are happy with the functionality, then keep it simple and go with what you know. However, I would highly, highly recommend that you do not rely on system level packages for application development (such as those installed as .deb packages). I would move your entire project into

Aw: Re: prob. with non-related objects deleted

2015-01-06 Thread sneaky56
thank you for your answer, james.   i had a quick look, but unfortunatly, both are not readily available as .deb packages for python3, so i just just had some tries and came away with the following solution. in the previously mentioned "removeEntry" method, i changed the "with" block to the

Re: Django - trying to access User model column field from a view

2015-01-06 Thread Henry Versemann
Thanks James. You were right and its all there. Thanks again. Henry On Tuesday, January 6, 2015 2:54:42 PM UTC-6, James Schneider wrote: > Not sure what you mean. The User model will act just like any other model. > > $ python manage.py shell > >>> from django.contrib.auth.models import User >

Re: Django - trying to access User model column field from a view

2015-01-06 Thread Babatunde Akinyanmi
James said it all. I'll just add that you really need to brush up on your python. Django is pure python. I've all been there before. On 6 Jan 2015 21:10, "Henry Versemann" wrote: > I tried what you suggested and printed from the view what the type command > returned and it

Re: Class Based Views tutorials

2015-01-06 Thread Lachlan Musicman
To answer the unanswered q's: Meta is where you define things about the class, but are not in the class. If you can imagine a space created that *all* classes would need, mine as well as yours, this is in Meta. It's "Meta". IE. How does this class sort? Should a couple of fields be "unique

Re: Django - trying to access User model column field from a view

2015-01-06 Thread James Schneider
Not sure what you mean. The User model will act just like any other model. $ python manage.py shell >>> from django.contrib.auth.models import User >>> >>> userobj = User.objects.get(username='jrschneider') >>> >>> userobj >>> >>> type(userobj) >>> >>> userobj.username u'jrschneider' >>> >>>

Re: Class Based Views tutorials

2015-01-06 Thread Sergiy Khohlov
Add function get() and post() to the view class. Code is near to same not class view 6 січ. 2015 18:45, користувач "Brad Rice" написав: > > When I was working with formsets, it seemed to me best to just use a single UpdateView with post and get functions defined rather than

Re: Django - trying to access User model column field from a view

2015-01-06 Thread Henry Versemann
I tried what you suggested and printed from the view what the type command returned and it looks like this: type(userobj)=() so that part of it does seem to be working. So why can't I see the other values within the object then displayed in normal object notation instead of just seeing this:

Re: Django - trying to access User model column field from a view

2015-01-06 Thread Babatunde Akinyanmi
userobj = User.objects.get(username=myuser) Will get you a User object or throw an error if it can't find anything. The string representation of the User object is the string contained its username field. Try this to confirm: type(userobj) On 6 Jan 2015 18:48, "Henry Versemann"

Re: Matching logic is case sensitive when I want it case insensitive

2015-01-06 Thread joboppsgpp
This worked beautifully. Thanks Vijay! (ps thanks for the suggestions regarding a long-term solution). -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Matching logic is case sensitive when I want it case insensitive

2015-01-06 Thread Vijay Khemlani
on line 12 you would need a more complex logic try: obj = SocialAccount.objects.get(social_profile=profile, service=service, value__iexact=value) except SocialAccount.DoesNotExist: obj = SocialAccount.objects.create(social_profile=profile, service=service, value=value) (assuming "value"

Django - trying to access User model column field from a view

2015-01-06 Thread Henry Versemann
I currently using Python 2.7.7 and Django 1.7 as I build a new application. I need to retrieve an entire User object from the authentication User Model, but when I do the following: userobj = User.objects.get(username=myuser) all I'm getting returned is just the same username value (contained

Matching logic is case sensitive when I want it case insensitive

2015-01-06 Thread joboppsgpp
Hi, I have a bug where when I upload data from a csv into my database into a model that houses social accounts (eg a twitter value, a facebook value etc) it is adding new social account objects if there's a discrepency between the casing of the value in the csv and the value that is already in

Class Based Views tutorials

2015-01-06 Thread Jim Wombles
Two Scoops of Django is definitely the book you are looking for. I don't know if it's out for 1.7 yet, but I purchased the book for Django 1.6 and it covers l of the best practices that you won't read about just from the Django docs. -- You received this message because you are subscribed to

Re: Class Based Views tutorials

2015-01-06 Thread Brad Rice
When I was working with formsets, it seemed to me best to just use a single UpdateView with post and get functions defined rather than having a separate CreateView class. Seemed to handle both create and update ok. On Tuesday, January 6, 2015 9:39:49 AM UTC-5, Sergiy Khohlov wrote: > > Diff is

Re: Recommendations for hosting service?

2015-01-06 Thread Jeff Kerr
I'm a total noob, but I was able to get a basic Django app (Postgresql as DB) running on DigitalOcean without much trouble. It wasn't *easy--*in fact, I was ready to throw my computer out the window a few times--but I'm happy that I now have that skill. DigitalOcean also has a great interface

Re: Recommendations for hosting service?

2015-01-06 Thread Richard Brockie
I'm using webfaction also - though still shared, they (and others) are much, much better than commodity shared hosting. Apart from the above, the reasons I chose webfaction: 1. Django support, plus: 2. php/MySQL for my existing codebase R. On Tuesday, January 6, 2015 5:44:40 AM UTC-8,

Re: Recommendations for hosting service?

2015-01-06 Thread Mark Phillips
+1 for Linode and Digital Ocean. Also, you can get 2 Virtual Private Servers on AWS EC2 for free for the first year. http://aws.amazon.com/free/ Mark On Tue, Jan 6, 2015 at 7:21 AM, claudiomet wrote: > I have digitalocean and no problems > > 2015-01-06 11:05 GMT-03:00

Question on Template placement in file system

2015-01-06 Thread Tobias Dacoir
I have been working through the official Django 1.7 tutorial and also Tango with Django but I'm confused as to where put my templates - I want to follow best practices as much as possible. Now currently I only plan to develop a single project with a single app, but I might want to include 3rd

Re: Class Based Views tutorials

2015-01-06 Thread Sergiy Khohlov
Diff is simple : UpdateView is using for changing already created object. CreateView is using for creating new object. I have few simpleast class for your request. But I have not commented yet. Many thanks, Serge +380 636150445 skype: skhohlov On Tue, Jan 6, 2015 at 3:49 PM, Brad Rice

Re: Recommendations for hosting service?

2015-01-06 Thread claudiomet
I have digitalocean and no problems 2015-01-06 11:05 GMT-03:00 Vijay Khemlani : > I like Linode, and DigitalOcean is also a great choice. > > Both require low-level configuration of the server but I prefer that over > the pre-packaged solutions. > > On Tue, Jan 6, 2015 at

Re: Recommendations for hosting service?

2015-01-06 Thread Vijay Khemlani
I like Linode, and DigitalOcean is also a great choice. Both require low-level configuration of the server but I prefer that over the pre-packaged solutions. On Tue, Jan 6, 2015 at 10:44 AM, Brad Rice wrote: > I like webfaction, too. I think they would have all the stuff

Re: Error: No module named polls

2015-01-06 Thread tita
Hi, thanks for your answer... here is the path of my site, that i called "primerdjango": C:\xampp\htdocs\primerdjango\ inside of that folder i have: polls\ primerdjango\ db.sqlite3 manage.py Vista.py then inside of - polls - i have:

Re: CSRF verification failed when I use smart phone

2015-01-06 Thread Vijay Khemlani
¿Did you include de {% csrf_token %} tag in the form? ¿Is it generating the corresponding hidden input tag in the html? On Tue, Jan 6, 2015 at 6:09 AM, Sugita Shinsuke wrote: > Hello. > > When I use Django via my smart phone Android and iOS. > The error sometimes occurred. >

Class Based Views tutorials

2015-01-06 Thread Brad Rice
Does anyone have a recommendation for intermediate reading to understand Class Based Views? It seems most of the Django books were written when function based views were prevalent. I'm still having trouble understanding what the differences are between CreateView and UpdateView and what Meta is

Re: Recommendations for hosting service?

2015-01-06 Thread Brad Rice
I like webfaction, too. I think they would have all the stuff you list as well as more. On Tuesday, January 6, 2015 6:30:18 AM UTC-5, Bobby Mozumder wrote: > > Anyone have recommendations for hosting services that can do Django, > Node.js, Postgreqsl, python3, as well as PHP/MySQL for legacy

Re: Problem with for and if

2015-01-06 Thread Erik Cederstrand
> Den 05/01/2015 kl. 22.45 skrev Dariusz Mysior : > > I try develop this code to get a number of position this letter in word, and > I have it but for example if i search letter "t" I get "1, 5, b", why I get b > instead of 11??? > > def gen2(): >count=0 >

Re: Recommendations for hosting service?

2015-01-06 Thread Avraham Serour
I like webfaction, https://www.webfaction.com/?aid=43671 (shameless link with affiliate or here for affiliateless link https://www.webfaction.com/) it is a shared hosting, you get shell access and 8 cores, you can compile your own stuff as needed or use their click and install for django

Re: Recommendations for hosting service?

2015-01-06 Thread Daniele Procida
On Mon, Jan 5, 2015, Bobby Mozumder wrote: >Anyone have recommendations for hosting services that can do Django, >Node.js, Postgreqsl, python3, as well as PHP/MySQL for legacy stuff? >I'm also looking to have IMAP email. This would be for several domains, >with maybe 100GB

Re: prob. with non-related objects deleted

2015-01-06 Thread James Schneider
This looks a lot like a basic MPTT tree. Have you looked at django-mptt or django-treebeard? Either of those packages could probably save you a ton of headache here, assuming that your lists contain all of the same type of model, which it appears they do.

Re: what's different between {% static %} and {{ STATIC_URL}}

2015-01-06 Thread Andreas Kuhne
Hi, The difference is the age of the django project you are looking at. {% load staticfiles %} the {% static %} is the current way to load and use static files. It also has the option to do other things (like MD5 hashes for versions) automatically and should be used. If you create a project in

prob. with non-related objects deleted

2015-01-06 Thread sneaky56
hello all, my problem is the following (the models.py is attached): i want to implement a double-linked list (type BasicEntry) with the first entry having an empty name. each entry has two attributes prev_entry and next_entry to its neigbours. the first entry is created automaticaly and should

Recommendations for hosting service?

2015-01-06 Thread Bobby Mozumder
Anyone have recommendations for hosting services that can do Django, Node.js, Postgreqsl, python3, as well as PHP/MySQL for legacy stuff? I’m also looking to have IMAP email. This would be for several domains, with maybe 100GB of data. -bobby -- You received this message because you are

Couldn't get django-compressor/assets to work on Heroku

2015-01-06 Thread Po Chen
Hi there, I've been trying to get some automatic assets handling setup in my tiny django app. I've tried django-compressor and django-assets, no success so far. Both of the libraries seem to fail to create files in the staticfiles directory on Heroku. Both of them work locally with/without

Django-compressor/assets not working on Heroku

2015-01-06 Thread Po Chen
Hi there, I've been trying to get some automatic assets handling setup in my tiny django app. I've tried django-compressor and django-assets, no success so far. Both of the libraries seem to fail to create files in the staticfiles directory on Heroku. Both of them work locally with/without

what's different between {% static %} and {{ STATIC_URL}}

2015-01-06 Thread 老张
hi,guys i'm new to django。when I write my first app, there are 2 options to access static files, 1 using {{ STATIC_URL}} 2 using {% load staticfiles%} then {% static %} what 's different between the 2 options, and ,when I migrate from development to production env which one is conveniency ?

CSRF verification failed when I use smart phone

2015-01-06 Thread Sugita Shinsuke
Hello. When I use Django via my smart phone Android and iOS. The error sometimes occurred. Forbidden (403) CSRF verification failed. Request aborted. Help Reason given for failure: CSRF token missing or incorrect. In general, this can occur when there is a genuine Cross Site Request Forgery,

Re: how can I choose option price from checkbox option and calculate the sum.

2015-01-06 Thread rdyact
Oh, thanks a lot, I'll try it anyway. ~~ 2015년 1월 6일 화요일 오후 12시 45분 49초 UTC+9, Collin Anderson 님의 말: > > Hi, > > You probably need to use javascript to make the total price auto-update > when you check or uncheck each box. Check out jQuery if you haven't. > > Once you have that, then, yes,