Re: what is the best IDE to use for Python / Django

2012-01-23 Thread Mario Gudelj
I've used gedit, sublime text 2, emacs, vi, but the best Django IDE by far is PyCharm. I'm seriously amazed at how awesome it is. It's worth every cent. On 23 January 2012 22:20, Sandro Dutra wrote: > The best IDE is that you fell comfortable using it. > > 2012/1/21 goosfancito : > > El 21/01/12

Re: User-specific sites

2012-01-28 Thread Mario Gudelj
It's all in queries. You assign the user to all your tables as a foreign key and make sure that all your quiries have user in them as a filter. You can also extend the user and assign a slug to it so that you have unique urls for all users. You can generate a slug from the username upon user creati

Re: how to show the text line number in the left of the textarea

2012-11-21 Thread Mario Gudelj
Use JS for that. You'll find a code snippet here that will do it http://www.dhtmlgoodies.com/forum/viewtopic.php?t=506 On 22 November 2012 01:27, jianhui chen wrote: > Hi all, > I was wondering how can I show the text line numbers in the left of > the text area. > The result is somehow

Re: how to include html in your text area

2012-12-06 Thread Mario Gudelj
HTML is not really stripped. It's just encoded. If you want to render it on the frontend you can use https://docs.djangoproject.com/en/dev/ref/templates/builtins/#std:templatefilter-escapeor safe filter e.g. {{ your_var|safe }} Cheers, -mario www.zenbookings.com On 7 December 2012 05:10, Jonath

Re:

2012-12-10 Thread Mario Gudelj
Make sure you have files 500.html and 404.html in your templates folder. If not create them. Or use django 1.5 Mario www.zenbookings.com On 10 Dec, 2012 5:14 PM, "vinoth kumar renganathan" < vinoth.vinothre...@gmail.com> wrote: > when i start to run python manage.py runserverto start the > DE

Re: IOError, Permission Denied using Amazon s3 w/ django-storage?

2012-12-10 Thread Mario Gudelj
I suspect you're on a Mac and your jpglib is not compiled properly. If you are on Mac make sure you look into that. Cheers, mario www.zenbookings.com On 10 Dec, 2012 4:20 PM, "easypie" wrote: > Yeah. It's uploaded and by using django-filebrowser I can upload image, > create folder and move them

Re: OnChange or OnBlur event in javascript to run python function in Django and return the results???

2012-12-12 Thread Mario Gudelj
Hey, First you need to add some id to that field and then use a jQuery selector to get the value from it on blur or input: $('#some_id).on("blur", function(){ //make your ajax call here }); To make the Ajax call you can use jQuery's .post() or .get(). I guess post method would make a bit more

Re: OnChange or OnBlur event in javascript to run python function in Django and return the results???

2012-12-13 Thread Mario Gudelj
'DataFromPage': DataFromPage, > } > else: > DataFromPage = "Nothing" > c = { > 'DataFromPage': DataFromPage, > } > > return render_to_response('testing.html', c) > > > Thanks, > Murta

Re: deploying a dejango app on AWS

2012-12-16 Thread Mario Gudelj
You need to enable debug in your settings file and provide the error you are getting. There is nothing to go by here... On 17 Dec, 2012 2:30 AM, "Nicholas Sonnenberg" < nicholas.sonnenb...@gmail.com> wrote: > Hello, > > Does anyone know what I need to do to get my django app to run on my > elastic

Re: new user

2012-12-21 Thread Mario Gudelj
Mate. What's up? On 22 Dec, 2012 10:08 AM, "hardik juneja" wrote: > > hello sir, > i m new to django and need some hep can u help me > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https:/

Re: dynamic, heterogeneous formset?

2012-12-27 Thread Mario Gudelj
Try django app called web forms builder. If you want to allow user to create custom fields i think that would be the way to go. On 28 Dec, 2012 10:29 AM, "Marco G." wrote: > Hello, > > I've just started using django for a relatively complex project, used > other frameworks in the past. > > I need

Re: Project Structure - Lots of scattered custom views

2013-01-07 Thread Mario Gudelj
There's no reason why you can't split these into separate apps, then create a templates directory and urls.py in each app folder, if this will help the site organisation. You'll have to make sure you add each app to settings.py, create __init__.py in every app folder. Just go for it. Get everyone w

Re: How can i use double login form in a django app redireting to two different pages

2013-01-07 Thread Mario Gudelj
Sounds like you need 2 types of users, those that have registered and those that haven't, and both have to be able to log in... Does this mean that you have two sets of usernames and passwords? Can you bypass the first login and simply send them to the reg form or do you have to check if the user i

Re: show an image in django

2013-01-08 Thread Mario Gudelj
Try removing .. from the path. Also make sure your static path is set correctly in settings.py On 9 Jan, 2013 1:42 AM, "jianhui chen" wrote: > Hi all, > I want to show an image in project in which the folder DIR looks like this: > images/a.jpg > templates/introduction.html > > In introduction.htm

Re: show an image in django

2013-01-10 Thread Mario Gudelj
Have you tried removing {{ STATIC_URL }} and replacing it with a slash (/)? Or try appending the slash to the end of "E:/code/python/djangoBook/django-testapp-develop/static" in STATICFILES_DIRS. You can also add DJANGO_ROOT = dirname(dirname(abspath(__file__))) to the top of your settings.py and

Re: Custom jQuery in admin

2013-01-11 Thread Mario Gudelj
Sounds like you have something else on that page using $, such as prototype library. Look up jquery's noconflict() if that's the case On 11 Jan, 2013 9:26 PM, "Daniele Procida" wrote: > I had a custom widget, which broke after some other things were updated. > > It was saying: > > TypeError:

Re: Django Calendar App Just Like Google Calendar

2013-01-12 Thread Mario Gudelj
I don't think there is one. I looked for one few months ago and ended up building one from scratch with fullcaledar.js, backbone and tastypie On 12 Jan, 2013 6:00 PM, "Kashif Ali" wrote: > Hello Guys, > > Is there any django app available that is a replica of google calendar? > I have checked dja

Re: Django Calendar App Just Like Google Calendar

2013-01-12 Thread Mario Gudelj
3 Jan, 2013 9:01 AM, "william ratcliff" wrote: > How did you find the integration? > > William > > > On Sat, Jan 12, 2013 at 4:52 PM, Mario Gudelj wrote: > >> I don't think there is one. I looked for one few months ago and ended up >> building one fr

Re: Payment method for systempay

2013-01-16 Thread Mario Gudelj
Use request.GET.getlist('myvar') or request.GET.get('myvar') for a single item On 17 January 2013 03:10, mouna abdennadher wrote: > Hi, > I implemented a PaymentMethodProcessor for sytempay. LFS send POST to the > bank successfully, Now I have to receive in LFS the POST from the bank,so i > cr

Re:

2013-01-16 Thread Mario Gudelj
Target the form filed using JS and populate it with JavaScript. You can make it a hidden field if you don't want the visitor to see it. On 17 January 2013 11:39, Randa Hisham wrote: > i want to pass value from javascript function to view in form submit > > -- > Randa Hesham > Software Developer

Re: Getting error 500 when using jquery/ajax

2013-01-18 Thread Mario Gudelj
Replicate this error in chrome, then go to network tab in dev tools, look at the request that gets 500 and check the response. You should be able to see the stack trace if debug is on. On 19 Jan, 2013 8:01 AM, "Dex" wrote: > Hi, I'm new to Django. I'm creating a game that has a 10x10 board and wh

Re: Looking for a session cart

2013-01-21 Thread Mario Gudelj
Use django-cart. It does store the cart content in db but it stores the session as well, so it will nicely match the user to their cart content according to the cart id stored inside a cookie. It's a breeze to implement with any product model. I highly recommend it. On 22 Jan, 2013 7:43 AM, "frocco

Re: ignore field during form validation

2013-01-21 Thread Mario Gudelj
Add required=False to the form field and it won't be validated. On 22 Jan, 2013 2:30 AM, "Jonathan D. Baker" wrote: > Hi Sarfraz, > > If your form class inherits from ModelForm, you can use a subset of fields > within your form per the following documentation: > https://docs.djangoproject.com/en

Re: Calculate availability based on Events

2013-01-21 Thread Mario Gudelj
I'm not sure I fully understand your requirement, but I did something similar recently where I need to calculate the first available time slot for a service for a given staff and create an appointment for that time slot if the customer wants it. The staff model in this case has the availability aga

Re: get_absolute_url with custom extra parameter

2013-01-30 Thread Mario Gudelj
You can't pass parameters to model functions from within a template. What exactly are you trying to achieve? On 30 January 2013 21:34, Sammael wrote: > Hello friends, > > Is the any way to pass an extra parameter to get_absolute_url method of a > model instance from template? > > Thank you for

Re: On the fly image resize

2013-02-02 Thread Mario Gudelj
Try cloudinary and their python api plugin. On 3 Feb, 2013 7:44 AM, "nYmo" wrote: > Hi all, > I'm new to django and also python but have already some programming > experience. I'm currently creating my first application in django and get > stucked because I'm looking for the best way to resize up

Re: Python problem

2013-03-23 Thread Mario Gudelj
Looks like you are trying to run terminal commands inside python shell. Don't go to pyhon shell to run them. Run them in DOS On 24 Mar, 2013 9:38 AM, "James" wrote: > haha sorry for got to post, > > windows 7 running on activepython 2.7.2.5 > (path is under python27) > > Microsoft Windows [Versio

Re: django-sagepay example

2013-04-09 Thread Mario Gudelj
Hey sparky, I hope this helps: Create your checkout form and if the form is valid populate the following dict with the form data: data = { 'VPSProtocol': settings.VPS_PROTOCOL, 'TxType': settings.TXTYPE, 'VendorTxCode': b32encode(uuid.uuid4().bytes

Re: django-sagepay example

2013-04-09 Thread Mario Gudelj
s/whosounds_checkout.html', context, context_instance=RequestContext(request) ) Note that I'm looking for "REGISTERED" here because I'm doing pre-auths, but your response may differ depending on "TXTYPE".

Re: django-sagepay example

2013-04-10 Thread Mario Gudelj
dge, patience, and diligence to >> securely handle credit card information. >> >> Services like Authorize.Net are the way to go. >> >> >> On Tue, Apr 9, 2013 at 7:54 PM, Mario Gudelj wrote: >> >>> Hey sparky, >>> >>> I hope this hel

Re: Possible Basic kwargs question.

2013-04-16 Thread Mario Gudelj
I think this might be a useful article for you http://agiliq.com/blog/2012/06/understanding-args-and-kwargs/ On 17 April 2013 15:45, Brad Pitcher wrote: > I see what you're saying. Maybe you're looking for something more like > this? > > def method1(self, param1=sensible_default, param2=sensibl

Re: Upload csv file

2013-04-23 Thread Mario Gudelj
Have you looked at http://django-csv-importer.readthedocs.org/en/latest/? On 24 April 2013 05:38, Hélio Miranda wrote: > I have a Django application that interacts with the mongodb data entry. > But now he wanted to be able to insert data from a csv file upload. > > Someone can help me? > > -

Re: Understanding an existing big web application written in Django

2013-06-05 Thread Mario Gudelj
I always start from urls.py. Then proceed to views. Then inside views you can see which modules and templates are used and so on. But the URLs are the starting point... _M On 6 June 2013 14:50, Sergiy Khohlov wrote: > What is mean big application ? > 1) Write an idea > 2) Write a plan > 3) Wri

Re: django-simple-multitenant

2013-07-03 Thread Mario Gudelj
Depends what you need. Do you want to have users access data via www.domain.com/user_acccount/ or http://user_account.domain.com? If it's www.domain.com/user_acccount/ just foreign key your models to user model and in your queries always include user as a filter. The other option is somewhat harder

Re: django-simple-multitenant

2013-07-04 Thread Mario Gudelj
Legg > 07914 740972 > http://twitter.com/nigellegg > http://uk.linkedin.com/in/nigellegg > > > > On 4 July 2013 00:36, Mario Gudelj wrote: > >> Depends what you need. Do you want to have users access data via >> www.domain.com/user_acccount/ or http://user_account.do

Re: What client side html layout tools are people using to speed up template development?

2013-07-29 Thread Mario Gudelj
Use http://twitter.github.io/bootstrap/ framework for your frontend. If you google "django bootstrap" you'll find some apps that will help. For fonts i usually pick Google font that looks good. If you want to use web safe font go to http://cssfontstack.com/ As for colors, try https://kuler.adobe.

Re: PDF generator in Django

2013-08-06 Thread Mario Gudelj
https://code.google.com/p/wkhtmltopdf/ does a good job for us. We just call the shell script from python. On 6 August 2013 22:27, Gustavo Andrés Angulo wrote: > Hi, > > > Which is best tool to generate PDF in python django > > > > Is hard to say which is better, please make a selection and > ch

Re: Mezzanine Gunicorn Problem

2013-09-09 Thread Mario Gudelj
What's the issue Kelvin? Is the gunicorn process dying? I remember having some issues with starting gunicorn and mezzanine and it was due to locale. Make sure you have a correct locale in the settings. You can run the locale command in the shell to obtain it it for the machine you're on: $ locale

Re: CMS base to start with?

2013-09-27 Thread Mario Gudelj
Hey Anton, >From my experience if it's a 2 year project you're building don't use a CMS. Start with a plain Django project and then add apps you need. All these CMSs will just lock you in and become more of a hinderance then help. I also recommend building your own admin before you invest too muc

Re: Beginner to Django

2013-10-03 Thread Mario Gudelj
Hey champ! Watch this video on installation on windaz www.youtube.com/watch?v=rIVwVOpwpsA Then tackle this tutorial https://docs.djangoproject.com/en/dev/intro/tutorial01/ On 3 October 2013 20:20, Manimaran R wrote: > hai everyone!! > > im a beginner to django,dont have prior knownledge about

Re: Image browsing in django

2013-10-16 Thread Mario Gudelj
I reckon you're not passing request.FILES to your form class together with request.POST inside your view. Hopefully that's enough info. Typing from a phone. On 16/10/2013 6:46 PM, "Harjot Mann" wrote: > On Wed, Oct 16, 2013 at 1:06 PM, Harjot Mann > wrote: > > > > No same problem,please help me.

Re: DJANGO and SOAP

2013-10-16 Thread Mario Gudelj
Go with suds from fedora. I found it easy to use and it's worked with every soap api I connect to. On 17/10/2013 1:18 AM, "Domagoj Kovač" wrote: > I actually need a client library, not server library. > > -- > You received this message because you are subscribed to the Google Groups > "Django use

Re: Django tables 2 with django-autocomplete-light

2013-11-15 Thread Mario Gudelj
I have used datatables js for editable tables. Look up datatables jQuery and you'll find a nice demo and a code example of how to implement them. They also provide Ajax post when you press enter key, so all you have to do is to hook it into your django view. Writing on phone so can't supply links a

Re: django-registration - stuck at Required templates topic

2011-08-04 Thread Mario Gudelj
Hey Bob, You can download some basic templates for this page http://devdoodles.wordpress.com/2009/02/16/user-authentication-with-django-registration/ Cheers, On 5 August 2011 12:42, bob gailer wrote: > I followed the installation & configuration of django-registration up > to the start of th

Re: Disorientated by too many google-maps django packages

2015-01-26 Thread Mario Gudelj
Hey Victor, Here's some basic JS I've used in a project to plot client locations, and to show their name and phone when the marker is clicked: var locations = {{ locations|safe }}; var map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 11, center: new google.maps.La

Re: Django Auth\Auth

2015-02-02 Thread Mario Gudelj
Here's the link to docs https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#specifying-a-custom-user-model which will guide you through that. On 2 February 2015 at 14:30, Ajay M wrote: > Hi, > I'm a new bee to Django, I need to use signup/login facilities in my > project > How do I cu

Re: html response to be loaded in a div

2015-02-18 Thread Mario Gudelj
You may need to use | safe filter in your tag since your output is being encoded. E.g. {{output|safe}} Cheers, M On 19 February 2015 at 07:37, João Marques wrote: > This is what is being sent to the view: > > > %5B%5B%5B%275E%27,%20%2710A%27,%20%278D%27%5D,%20%5B%278B%27,%20%2711B%27,%20%271

Re: how to handle race conditions?

2015-02-18 Thread Mario Gudelj
Great reply. You're a champion, Carl! On 19 February 2015 at 05:31, Carl Meyer wrote: > Hi Abraham, > > On 02/17/2015 10:01 PM, Abraham Varricatt wrote: > > I'm trying to make an app where folks can order X quantity of an item. > > The condition is that the order should only be made if inventory

Re: Question about form security.

2015-02-19 Thread Mario Gudelj
Because the user must be logged in to update their username you can get the current user from the request. You don't need to have their id inside the form. On 20/02/2015 9:49 am, "Chen Xu" wrote: > Hi > I am implementing a feature while building a website using Django, > basically, I want user to

Re: Edx LDAP Auth setting

2015-02-24 Thread Mario Gudelj
To check the version go to shell and run this: >>> import django_auth_ldap >>> django_auth_ldap.version (1, 1, 2) >>> As for virtualenv, it's a good practice but it's not necessary. By the way, have you tried performing a simple search on the LDAP server? I think that your best bet is to star

Re: Import error - No module named http

2015-03-18 Thread Mario Gudelj
And you should probably use suds for soap based apis. On 19/03/2015 4:24 am, "Andrew Farrell" wrote: > Actually, please listen to Guilherme over me; He seems to have correctly > spotted the omission. > > On Wed, Mar 18, 2015 at 11:45 AM, Andrew Farrell > wrote: > >> So it seems like the problem

Re: Host a web application

2015-04-22 Thread Mario Gudelj
Sign up for AWS, fire up a free micro instance and host on that. You can have it up there in no time with something like https://github.com/gcollazo/Fabulous On 23 April 2015 at 00:52, Mario R. Osorio wrote: > > > www.pythonanywhere.com made it easier for me to deploy than heroku > > On Wednesda

Re: Best practice for passing JSON objects to a template

2015-04-22 Thread Mario Gudelj
I often use method 2. I don't see a problem with it. On 10 April 2015 at 02:08, Eric Plumb wrote: > Hi Djangoers! > > Sometimes in the course of human events it becomes necessary to encode a > JSON object directly into a template. We all prefer AJAX and REST APIs and > the rest of the TOFLAs, b

Re: importing csv data into database

2015-04-26 Thread Mario Gudelj
Remove comma from each line inside the for loop. On 27/04/2015 10:44 am, "sum abiut" wrote: > Hi Andrew, > Thanks heaps. do you mine explaining how to fix that. > > cheers, > > On Mon, Apr 27, 2015 at 4:26 AM, Andrew Farrell > wrote: > >> What I'm saying that you are defining data.LastName as a

Re: Fields outside Aggregation functions

2015-05-04 Thread Mario Gudelj
Can you perhaps order by price and get first and last items? On 4 May 2015 8:48 pm, "Alex-droid AD" wrote: > > > There is example in Django documentation about using Aggregate and > Annotate clauses > > The same rules apply to the aggregate() clause. If you wanted to know the > lowest and highest

Re: Use 3rd party django package in my own project (PYTHONPATH)

2015-05-11 Thread Mario Gudelj
Have you looked at https://django-model-report.readthedocs.org/en/latest/installation.html ? After you add it to "INSTALLED_APPS" (I guess that's what you meant by adding it to 'Installed_Packages') you need to create reports.py etc. The instructions on RTD are pretty good... On 12 May 2015 at 05

Re: What is the ideal web server to use with Django?

2015-05-12 Thread Mario Gudelj
The most common setups I came across are Nginx + Gunicorn and Nginx + uWSGI. Nginx + Gunicorn is really easy to setup and it will probably be sufficient. You just need to have enough Gunicorn workers running for your amount of traffic. I really like this setup http://michal.karzynski.pl/blog/2013/0

Re: How to go about building complicated web apps with django?

2015-05-12 Thread Mario Gudelj
"Should I start building a basic web app and then iteratively" <<< This. Then buy this book https://highperformancedjango.com/ after you've done things like these http://www.revsys.com/blog/2015/may/06/django-performance-simple-things/ On 13 May 2015 at 11:04, akshat wrote: > I am new to django

Re: django-allauth without username, login with facebook doesn't work

2015-05-12 Thread Mario Gudelj
What do you mean by nothing happens? Do you get taken to FB? Here's what I have in my setup which may help: The template link looks like this: Facebook Make sure you have the following line in your urls.py: url('', include('social.apps.django_app.urls', namespace='social')) settings.py: SOCI

Re: Django model inheritance: create sub-instance of existing instance (downcast)?

2015-05-12 Thread Mario Gudelj
Have you had a look at http://django-model-utils.readthedocs.org/en/latest/managers.html#inheritancemanager? I'm not sure if it will help but it's kind of related to what you've posted. On 12 May 2015 at 23:10, guettli wrote: > Hi, > > this ticket is seven years old > > https://code.djangoprojec

Re: django-allauth without username, login with facebook doesn't work

2015-05-13 Thread Mario Gudelj
wordpress.com/ <http://fhbash.wordpress.com/>* > *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* > *Twitter: @fh_bash* > > On Wed, May 13, 2015 at 12:26 AM, Mario Gudelj > wrote: > >> What do you mean by nothing happens? Do you get taken to FB? >&

RE: new to Django having models/views/templates question

2015-06-03 Thread Mario Gudelj
By creating a foreign key to it. On 3 Jun 2015 8:07 pm, "Chris Strasser" wrote: > Hi James, Thanks again for responding. > > I didn’t post my actual models as they are quite large and my problem is > more about understanding proper technique than anything. Self.name did fix > my immediate proble

Re: Django plugin

2015-06-15 Thread Mario Gudelj
You can use celery and periodic tasks to scan for new orders every 5 minutes and send email notification of the new order is there. On 12 Jun 2015 6:59 pm, "'Tom Evans' via Django users" < django-users@googlegroups.com> wrote: > On Thu, Jun 11, 2015 at 8:02 PM, Andreas Kuhne > wrote: > > Hi all,

Re: DateField(blank=True), null?

2015-06-25 Thread Mario Gudelj
Did you migrate? You don't have to manually edit your schema. Use migrations or south if you're using 1.6 or below. On 26 Jun 2015 8:41 am, "Sidh Tanna" wrote: > Its not work dear, ou have any other solution? > > On Monday, August 14, 2006 at 12:09:53 PM UTC+5:30, Bryan Chow wrote: >> >> Hi Ray,

Re: Try Django 1.8 Tutorial 37 on Youtube - Bootstrap Design Falls Apart In Production

2015-07-19 Thread Mario Gudelj
Your static assets aren't loading. Normally in production you'd setup nginx or apache to do this job. Have you done that? On 17 Jul 2015 7:24 am, "Chris Nowak" wrote: > I'm following this Youtube tutorial as I'm learning Django, and around the > 11 minute mark, after the author sets DEBUG = False

Re: How to making a query which filtters objects having a Null field

2014-07-06 Thread Mario Gudelj
something__null=True On 07/07/2014 6:31 am, "Utkarsh Dixit" wrote: > I have a datetime field in my model. Initially when an object is created > of this model the datetime field is set as NULL (I've defined Null=True and > blank=True) > > Now I want to change make a query which filters all the obj

Re: django beginner

2014-07-10 Thread Mario Gudelj
You mentioned that you haven't completed a tutorial. You should because this stuff is in it. Your questions are too broad and covered in docs and other material on the web. Google is your bro :) On 10/07/2014 5:52 pm, "ngangsia akumbo" wrote: > it is not working thanks bro > > > > > i have one mo

Re: Introducing myself and my first question

2014-07-21 Thread Mario Gudelj
Hey Martin, I can guarantee you that PyCharm is totally worth buying. It will speed up your development drastically and it works really well with Django. Autocompletion both in Python and template code, syntax highlighting in both, easy Option+Enter imports, navigation through code, refactoring. Y

Re: psycopg2

2014-07-24 Thread Mario Gudelj
Install this first: sudo apt-get install python-dev Then try installing that package again. On 25 July 2014 09:55, Henrique Oliveira wrote: > > > > > > *Hi All,I am trying to install psycopg2 but I am getting this error:*I > already installed python3-dev and libpq-devAny idea?* > > Downloadin

Re: psycopg2

2014-07-24 Thread Mario Gudelj
ira wrote: > Hi Mario, > > I already installed python-dev > On Jul 24, 2014 9:11 PM, "Mario Gudelj" wrote: > >> Install this first: >> >> sudo apt-get install python-dev >> >> Then try installing that package again. >> >> >> On

Re: Official tutorial part 4

2014-07-25 Thread Mario Gudelj
Please post the url for your detail view. On 26/07/2014 2:42 pm, "Juliano Resende" wrote: > Hi, > > i have a problem in part 4 of official django tutorial, somebody can help > me? > > Error: > > *Reverse for 'polls.detail' with arguments '(4,)' and keyword arguments '{}' > not found. 0 pattern(s

Re: images umpload prob

2014-07-29 Thread Mario Gudelj
Use the url it gives you inside src attribute inside img tag. On 30/07/2014 1:19 pm, "ngangsia akumbo" wrote: > i have the following > > MODEL > > from django.db import models > > class Timer(models.Model): > title = models.CharField(max_length=100) > slug = models.SlugField(unique=True)

Re: Question about email sending with Google Apps

2014-08-19 Thread Mario Gudelj
Every email account will have a username and password. Unless it's an alias, in which case you can't use it. Sounds like you've set up an alias here. You can still use it as a from email address, but can't use it to authenticate with smtp On 19/08/2014 6:13 pm, "Chen Xu" wrote: > Hi Everyone, > I

Re: Question about email sending with Google Apps

2014-08-19 Thread Mario Gudelj
purpose? > > Thanks > > > On Tue, Aug 19, 2014 at 6:37 AM, Mario Gudelj > wrote: > >> Every email account will have a username and password. Unless it's an >> alias, in which case you can't use it. Sounds like you've set up an alias >> here. You

Re: Question on creating a contact form app using bootstrap template

2014-08-19 Thread Mario Gudelj
Some other options: - Install https://github.com/dyve/django-bootstrap-toolkit and use {{ form|as_bootstrap }}. See the docs for more options. - http://django-crispy-forms.readthedocs.org/en/latest/ Crispy Forms is amazing BTW (by the way) - Render your labels with {{form.field_name.label}} and

Re: Question about email sending with Google Apps

2014-08-19 Thread Mario Gudelj
. On 20/08/2014 7:16 am, "Chen Xu" wrote: > I think my expected behavior of an no-reply email is a "Delivery Failure" > when people try to reply. Can google apps do it if I create no reply user. > > > On Tue, Aug 19, 2014 at 6:49 AM, Mario Gudelj > wrote

Re: Problem 'duplicating' object instance

2014-08-21 Thread Mario Gudelj
I think you can use deepcopy.copy set the id none then save On 22/08/2014 10:58 am, "luciusoso" wrote: > Hi everyone, as the title says i have a problem when trying to copy a > model instance. > > Basically when i try in my tests to duplicate an object by setting its pk > and id to None, i get no

Re: Change color of table cell based in another cell value django-tables2

2014-08-21 Thread Mario Gudelj
I have never used "django-tables2" package but traditionally you'd do something like class="color_{{item.reception_status}}" which will render class="color_3" or class="color_1" and then use CSS to style it. What does cell render? Can you access reception_status from it as in {{ cell.reception_stat

Re: cms web buyilding

2014-08-22 Thread Mario Gudelj
There's nothing else to be said mate On 22/08/2014 6:35 pm, "ngangsia akumbo" wrote: > Then i should be very comfortable with my django. > > Any more comments on that? > > On Tuesday, August 19, 2014 11:23:07 AM UTC+1, Tom Evans wrote: >> >> On Mon, Aug 18, 2014 at 9:00 AM, ngangsia akumbo >> wr

Re: Model - def __unicode__(self) - doesn't work

2014-08-25 Thread Mario Gudelj
Your problem is in the add view. Post your view code On 26/08/2014 7:20 am, "Przemek Ciborowski" wrote: > Hello guys, > > I'm really beginner in django. > I have extremely simple example: > > class Vlan(models.Model): > name = models.CharField(max_length=30, name='Vlan name') > number = m

Re: User to Model relationship- implement a "like" feature on a Model

2014-08-25 Thread Mario Gudelj
The other way would be to simply wire a cookie to user's browser and use js to disable the the like button if the cookie is present if you can get away with it. Not sure if you need to store that info against the user to see which items they liked... On 26/08/2014 8:41 am, "amarshall" wrote: > Hi

Re: Three Django forms in different tabs in one template?

2014-09-11 Thread Mario Gudelj
K. Another option would be to render all the forms in GET and then use Ajax and 3 different views to process POST requests from those forms. Or you can add different values to each of the form's submit button and check which form form is being submitted by that value. That's if you want to use the

Re: static files in Django 1.7 ; Anything was change?

2014-09-14 Thread Mario Gudelj
What are you using to serve static files? You normally setup your server e.g. Nginx to take care of this. Here's an example of Nginx setup file which serves static files from /webapps/hello_django/static/: server { listen 80; server_name example.com; client_max_body_size 4G;

Re: Generic way to create forms (not admin forms)

2014-09-17 Thread Mario Gudelj
Look at how mezzanine CMS does it. I think Stephen called it form for forms at one stage. It uses standard relational schema for everything. On 18/09/2014 1:07 am, "Collin Anderson" wrote: > We store the field structure using JSON and then use that information to > construct a django ModelField

Re: Ldap authentication using django_auth_ldap

2014-09-25 Thread Mario Gudelj
If that's the actual file it certainly won't work. You don't even have ldap server address setup. And those dots in dn, what is that? On 25/09/2014 9:09 pm, "RDN" wrote: > This is my settings.py file. I am trying to create an application where > the user will be able to login using their windows

Re: Ldap authentication using django_auth_ldap

2014-09-25 Thread Mario Gudelj
u have extended AbstractUser or if you're using email for authentication. Good luck! I hope you don't spend too much time setting this up and I hope this helps. On 25 September 2014 22:56, Mario Gudelj wrote: > If that's the actual file it certainly won't work. You don

Re: Upload file IN DJANGO

2014-10-15 Thread Mario Gudelj
https://docs.djangoproject.com/en/dev/topics/http/file-uploads/#handling-uploaded-files-with-a-model cheers! On 15/10/2014 9:38 pm, "Devin Cky" wrote: > > please help me i want to upload a file in my django application > > how to save in a database(postgresql) an upload file in django ... thank

Re: Unable to store static

2014-10-16 Thread Mario Gudelj
Try {% load staticfiles %} instead of {% load static %} On 16 October 2014 20:21, Sachin Tiwari wrote: > Hi, > > I created templates and static directory in parallel with my project > directory like below but only html part is visible to me css and js part > are not visible, > > //templates/ho

Rendering TabuarInline inside ModelAdmin without a foreign key

2014-10-28 Thread Mario Gudelj
Hi list, I have a table of orders where one of the columns is a IntegerField containing the id of a user who created the order. Since it's not a FK field django admin can't display these orders inline inside the user details page. I would normally use something like: class OrderInline(admin.Tab

Re: Rendering TabuarInline inside ModelAdmin without a foreign key

2014-10-29 Thread Mario Gudelj
I did not produce the original model so I wouldn't know. My thinking is that the order model had to be independent of the user model so that the deletion of the user doesn't cascade down to orders. It's a mezzanine site and that's how it handles fk from orders to users. On 29/10/2014 9:27 pm, "Dani

Re: Rendering TabuarInline inside ModelAdmin without a foreign key

2014-10-29 Thread Mario Gudelj
status = models.IntegerField("Order Status", choices=ORDER_STATUS_CHOICES, null=True, default=1) user_id = models.IntegerField("User ID", null=True, blank=True) ... Thanks for all your help on SO and this list by the way. I seem to come across your answers a lot

Re: Rendering TabuarInline inside ModelAdmin without a foreign key

2014-11-02 Thread Mario Gudelj
Thanks Collin. That's the path I've had to take. On 03/11/2014 11:55 am, "Collin Anderson" wrote: > Hi Mario, > > If you are able to edit the model replacing the IntegerField with this > should do what you want: > user = models.ForeignKey(CRMUser, null=True, blank=True, > on_delete=DO_NOTHING) >

Re: Newbie: How to implement a app/module, which I can include from my html?

2014-11-27 Thread Mario Gudelj
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#inclusion-tags here you go chief On 27/11/2014 8:04 pm, "ThomasTheDjangoFan" < stefan.eichholz.ber...@googlemail.com> wrote: > Oh ok. > > so it would be something like: > > in home.html > {% include 'category-list.html' %} > > in ca

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-06 Thread Mario Gudelj
Django ORM is the best thing since sliced bread! On 07/12/2014 8:17 am, "Cal Leeming" wrote: > Hi Artie, > > First, I would strongly recommend reading some of the work by David Mytton > at Server Density, he and his team have been using MongoDB extensively for > many years and they have shared a

Re: Connect django project with sharepoint 2013

2014-12-06 Thread Mario Gudelj
Urllib2 can't open the url http:// portal:8080. I assume that you can't visit that url from the browser either On 07/12/2014 3:46 pm, "Hossein Rashnoo" wrote: > I need this connection for adding list items and save my users data on > sharepoint database. I ran it in command line and when i write

Re: Connect django project with sharepoint 2013

2014-12-07 Thread Mario Gudelj
Well your python code is trying access that url so the url must work On 07/12/2014 4:47 pm, "Hossein Rashnoo" wrote: > I can access to http://portal:8080/ in my browser when i set our office > proxy and port. And my linux server that i run django on it, is local. Do i > need to set proxy to acces

Re: django template auto format tool?

2014-12-14 Thread Mario Gudelj
PyCharm ide does a great job for all those file types. On 14/12/2014 2:00 pm, "Abraham Varricatt" wrote: > Hello, > > Is there any command-line based tool which would let one auto-format > Django template files? Ideally, the tool should also be used to format > HTML, CSS and .JS files too. > > I'

Re: Django don't load css

2014-12-14 Thread Mario Gudelj
You may have an error in your css file if the link isn't 404ring when you look at your console or the chrome tab... On 15/12/2014 1:36 pm, "Jovana Andjelkovic" wrote: > I am trying to run a site on Django development server but my css don't > load. When I open dev tools in Chrome I see in network

Re: Models not appearing in db. Am I missing something?

2014-12-15 Thread Mario Gudelj
What's the output of your makemigrations command? If those models are inside core/models.py and your app is inside installed apps in settings this should totally work. The default name for the table will be appname_modelname. Do you get an error when accessing the model? How are you checking the db

Re: Models not appearing in db. Am I missing something?

2014-12-16 Thread Mario Gudelj
Pgadmin3 is the bomb. Try that gui tool On 16/12/2014 4:40 pm, "Shazwi Suwandi" wrote: > Hey guys, > > I figured it was a problem with the app I'm using for the db. I went to > use another app and now the tables are showing. Silly me. Thanks Mario and > David for your helpful advice. :) > > On Tu

<    1   2   3   >