Re: Wich OS for develop?

2018-01-02 Thread Mario Gudelj
Mac or Linux with PyCharm. Windows can be used but you may struggle with some Python packages which work well and are easily setup on nix. On Wed, 3 Jan 2018 at 8:40 am, Mike Morris wrote: > I've been linux only for many years - the last Windows I used was 2000 > Professional so you can gues

Re: authentication by ldap server

2017-12-01 Thread Mario Gudelj
You should use django-auth-ldap. It will give you the ability to bind ldap attributes with the attributes from your user model using a dict inside settings. It’ll also get the users’ groups and create those groups inside Django. So try plugging that in and come back if you get stuck. All you really

Re: How do I customize registration form HTML?

2017-12-01 Thread Mario Gudelj
I’d recommend you to look at crispy forms as well. On Sat, 2 Dec 2017 at 1:29 am, yingi keme wrote: > Hey, i made a mistake in the previous reply. Its widget and not widgets. > The correct code is: > > > Intead of rendering it with the as_p. You can render them individually. > ie > > {{form.name

Re: Supervisor FATAl Exited too quickly (process log may have details(About inet_http_server and unix_http_server)

2017-09-09 Thread Mario Gudelj
Does that Guniorn command run directly from the command line? What's gunicorn.pod? Make sure you can start gunicorn outside of supervisor and then stick that command into conf file. Cheers, M On Sun, 10 Sep 2017 at 2:28 am, Jonathan Cheng wrote: > I wrote a Django project and I use supervisor

Re: facing an error from many hours

2017-06-23 Thread Mario Gudelj
Or kill all python processes or try a different port in your config On Fri, 23 Jun 2017 at 11:41 pm, Matthew Pava wrote: > I’ve had this problem a few times. First, try updating PyCharm. I find > when I click on my runserver icon, I just keep clicking it until it works. > Not much of a fix, bu

Re: database update after paypal payment

2017-03-01 Thread Mario Gudelj
You should use Django-PayPal app. It has views for IPN and PDT, stores transaction details in DB, does TX verification and it fires of a signal when when a successful transaction comes in to your webhook. All you have to do is specify some URLs and settings. It'll even render that front end form f

Re: Minify HTML in Django

2016-11-01 Thread Mario Gudelj
Take a look at Django Compressor. On Tuesday, 1 November 2016, Web Architect wrote: > Hi, > > Is there an optimal and efficient way to minify HTML in Django? > > I tried using django-htmlmin but it's affecting the performance. > > Thanks. > > -- > You received this message because you are subscr

Re: How make Django sites look as professional as WordPress just as easily as WordPress is easy?

2016-08-14 Thread Mario Gudelj
It all depends what you want to do, Chris. I suggest you to find a html template on sites like template monster or theme forest, split it into base and extract page from it, make Django serve the static pages and then make those features that should be driven by database dynamic by creating models

Re: Help me!!! django

2016-06-30 Thread Mario Gudelj
There's a nice LDAP app for Django at https://pypi.python.org/pypi/django-auth-ldap/1.2.8 but I'm not sure if it's suitable for what you need to do. I think you need a Python LDAP module to create a connection, bind, perform a simple search and then parse the results to get those email addresses.

Re: Disappearing desktop icons

2016-04-21 Thread Mario Gudelj
I think you're posting this to a wrong list Gary. This od django list. On Friday, 22 April 2016, Gary Roach wrote: > Debian Stretch system > amd64 system > > A couple of weeks ago I updated my system and all of my desktop icons > start looking as shown in attachment. > > Anyone have an idea wha

Re: Fabric - Someone has a fabfile to build a Sentry server?

2016-04-05 Thread Mario Gudelj
Look for fabulous on GitHub. It sets up all of that on ec2. On Wednesday, 6 April 2016, Neto wrote: > I need a fabric to install Sentry, Redis, and configure the server with > nginx template, supervisor etc. > I have a Amazon Instance, and I want with a command install everything. > I have follo

Re: Django's search

2016-03-28 Thread Mario Gudelj
http://stackoverflow.com/questions/3538999/django-admin-search-how-to-override-the-default-handler On Monday, 28 March 2016, wrote: > I need know how change the search that come with Django's Admins. > > -- > You received this message because you are subscribed to the Google Groups > "Django use

Re: Alternative Amazon S3?

2016-02-25 Thread Mario Gudelj
Give cloudinary a go. It's really good especially for images and pdf On Friday, 26 February 2016, Andrew Pinkham wrote: > Heroku should be treated as the stateless portion of an app - do not store > long term data there! (Same goes with services like EC2 and Digital Ocean.) > > Rackspace and Mic

Re: django css: general query on CDNs and crispy forms

2016-02-23 Thread Mario Gudelj
You're missing a comma after my app inside installed_apps. You can load bootstrap from cdn inside head, before your custom style sheet. Not a problem there. Pip install crispy forms. They'll end up in your site-packages folder. No need to download it and put it inside your project. Run collectst

Re: Trouble with Django Tutorial Part 2

2015-12-09 Thread Mario Gudelj
Did you mix up https://docs.djangoproject.com/en/1.8/intro/tutorial01/ and https://docs.djangoproject.com/en/1.9/intro/tutorial01/? 1.9 has apps.py inside polls directory and 1.8 tutorial doesn't. So, I think you have INSTALLED_APPS setting from 1.9 tutorial inside 1.8.7 project... On Thu, 10 Dec

Re: Django deployment

2015-09-18 Thread Mario Gudelj
Try this guide http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/ On 18 Sep 2015 6:55 am, "Hugo Kitano" wrote: > What is the nginx config? And where do I find it? > > On Tuesday, September 15, 2015 at 12:46:40 PM UTC-7, Shawn Milochik wrote: >> >> It's very si

Re: What frontend-tools to use for a new CRM project? Shall I use Django OR switch to Meteor.js?

2015-09-09 Thread Mario Gudelj
+1 angular. Stack overflow is your friend and there's a lot of angular on it. You can do a lot with it with basic knowledge as well. And template syntax will make sense going to it from django On 10 Sep 2015 3:53 pm, "Gergely Polonkai" wrote: > Hello, > > this is a bit off topic here, and highly

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: 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: 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: 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-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: 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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: How to run background application via Django

2015-01-08 Thread Mario Gudelj
Look into celery. It's the best and easiest way to run bg jobs imo On 08/01/2015 9:10 pm, "Sugita Shinsuke" wrote: > Hi there. > > I'd like to run background application. > > I coded this code. > > I wrote the urls.py and I added in the view. > > def run_junix(request): > cmd = "cd app_path;n

Re: Select a single field from database (postgresql)

2014-12-21 Thread Mario Gudelj
Or use .latest() On 19/12/2014 11:00 pm, "aRkadeFR" wrote: > Hello Cássio, > > You first need to map your cars table with a Model in Django > (https://docs.djangoproject.com/en/1.7/topics/db/models/), > then you can construct your query something like this: > > Car.objects.order_by('-registered'

Re: Devils advocate question

2014-12-17 Thread Mario Gudelj
Deploying your Django site doesn't have to be that painful. You can do it in a single command with https://github.com/gcollazo/Fabulous. It'll take you about an hour to have a full stack running with a bit of tweaking. On 18 December 2014 at 11:11, James Schneider wrote: > > As a reformed PHP and

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

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: 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: 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: 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: 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: 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: 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: 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: 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-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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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
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 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: 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: 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: 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: 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: 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: 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: 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: Creating subusers

2014-07-01 Thread Mario Gudelj
Hey Jorge, I think you should extend the Abstract User instead of doing it the old way, which is creating that OneToOne relationship with a custom model. So, you'll end up with this: class IndependentAgent(AbstractBaseUser, PermissionsMixin): tipo_licencia = models.CharField(max_lenght=140)

Re: django user authenication form in modal form twitter bootstrap

2014-06-27 Thread Mario Gudelj
Sounds like you have a js issue now. Have a look inside chrome console for any errors and fix them. Modal not coming up wouldn't be a django issue. On 28/06/2014 5:41 am, "sarfaraz ahmed" wrote: > Hello, > > You were absolutely right.. the function was wrong. Please help me sort > out that.. as t

Re: Django image upload not saving

2014-06-26 Thread Mario Gudelj
I always follow a similar pattern for media uploads and it works, so here it is: in settings.py PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') in your model: file = models.ImageField(upload_to='wiki') say you upl

Re: How to store/model reachable data in django.

2014-06-25 Thread Mario Gudelj
You don't want to use a csv. Store them in a db table cell. Even if you have a million entries you'll be surprised how quick it will be. On 26/06/2014 12:45 am, "Subodh Nijsure" wrote: > Hello > > I have need to store data that can be graphed. Example I have mobile app > that collects temperature

Re: Static Analysis Tool

2014-06-23 Thread Mario Gudelj
PyCharm IDE does a lot of this stuff. It's great at pointing out bad code. But you can try https://chris-lamb.co.uk/projects/django-lint which is a wrapper around pylint On 24 June 2014 10:19, Mayur Sharma wrote: > Hi, > > I am looking for industry level Django Static Analysis tools. Most of th

Re: how to add additional data to that submitted by the user in a django form

2014-06-23 Thread Mario Gudelj
Use commit=False when saving the form, add all the other attributes and then call save(). E.g. obj = form.save(commit=False) obj.additional_stuff = additional obj.save() But some of that stuff such as creation date and time can be done automatically at the model with auto_now=True On 24 June 20

Re: OO in Django

2014-06-23 Thread Mario Gudelj
Ricardo is correct. But make sure you use abstract model for Customer in this case. I use the AbstractUser a lot because in most cases the customers need to be system users and have a log in etc. On 24 June 2014 02:08, Ricardo Daniel Quiroga wrote: > Hi > I think I would do as follows :P >

Re: Django Login/Session Not Sticking

2014-06-05 Thread Mario Gudelj
I know this may sound silly but is there some kind of JavaScript code that may be messing things up? Had a similar issue before and it was related to JavaScript stupidity. On 05/06/2014 10:39 pm, "Juergen Schackmann" wrote: > - all app servers are running the same code with same settings. > - DNS

Re: Supervisor alternative on Python 3.3.2?

2014-06-05 Thread Mario Gudelj
You can use init instead. On 06/06/2014 5:09 am, "Kwest Ambani" wrote: > Anyone know an alternative for Supervisor? I need something to keep > Gunicorn running in the background. My server is running Python 3.3.2. with > Nginx serving only static files. > > -- > You received this message because

Re: saving an istance of an object then trying to save it and it does not save

2014-05-16 Thread Mario Gudelj
That should work. Do you get any errors? On 16/05/2014 8:53 pm, "Coulson Thabo Kgathi" wrote: > if o get an object like this > > p = Plot.objects.get(plot_plot_identifier='123323423') > > then do > p.selected=1 > p.save() > > this does not save dont know why. > the is no where the field is being

Re: Django year month day

2014-05-13 Thread Mario Gudelj
Try instead. On 14 May 2014 13:26, hito koto wrote: > I'm also have the erroes > > Exception Type: NoReverseMatch Exception Value: > > u'article.views.main year|add' is not a registered namespace > > > > > 2014年5月14日水曜日 12時19分06秒 UTC+9 hito koto: > >> Hello, >> >> this time i have this the er

Re: How would you do this cleanly in Django (remembering the states of check boxes in multiple pages)

2014-05-09 Thread Mario Gudelj
So, you basically need a shopping cart. Use sessions. Other option would be to store everything in cookies and use js to manipulate the products. On 08/05/2014 11:25 pm, "Chi-Cheong Weng" wrote: > Hi guys, > > I have been using Django for a little more than a year now, but I still > cannot think

Re: About django round-up display function of time

2014-05-07 Thread Mario Gudelj
I assume you're using datetime object in which case you have a look at this SO answer http://stackoverflow.com/questions/3463930/how-to-round-the-minute-of-a-datetime-object-python On 7 May 2014 17:55, hito koto wrote: > Hi , good afternoon! > > I want to the round-up display function of time,

Re: where is base.html located?

2014-05-04 Thread Mario Gudelj
Usually in the same templates directory your publisher_list.html is in. On 05/05/2014 2:28 pm, "Venkat Subbiah" wrote: > Trying to follow the generic views from this tuotorial. Where would be > "base.html" be located. > > https://docs.djangoproject.com/en/1.6/topics/class-based-views/generic-disp

Re: Python/Django based Enterprise framowrk

2014-05-01 Thread Mario Gudelj
You'll need to create your own admin in that case. For 90% of my projects I've unfortunately had to do that. You can find a good admin console kit, perhaps something based on bootstrap and use the components to create whatever you want. I usually use one called Metronic. On 01/05/2014 7:43 pm, "Ken

Re: Subjectively Required Fields

2014-04-28 Thread Mario Gudelj
Your clean method needs to return cleaned_data I believe On 28/04/2014 10:02 pm, "Daniel Watkins" wrote: > Hello all, > > We're running in to an interesting validation problem. We have a model > which represents a (specific type of) date interval, bounded by a start > date and end date. Both fie

Re: Django

2014-04-19 Thread Mario Gudelj
Two scoops is not a beginner's book. Start with tutorials. The one on django site is a must, but there are lots of other tuts as well on the net. Tango with django is a good one. Also django book is awesome resource although somewhat outdated now. But I'd read first 7 chapters anyway On 20/04/2014

Re: What are the active Django e-commerce frameworks right now (2014)?

2014-04-15 Thread Mario Gudelj
I believe when you say framework you're referring to CMS with e-commerce. I in same dilemma recently and settled on Mezzanine + cartridge. When you install it it comes with a functioning cart and everything you need to get ahead early. It has good docs and it's just Django without much magic in it.

Re: How to remove an item from a queryset object list?

2014-04-09 Thread Mario Gudelj
Have you tried user_list.exclude(user=user)? On 10 April 2014 12:45, nobody wrote: > Hi, > > I tried following statement, but did not remove the item from the list, > appreciate any helps. > > user_list.exclude(user__username=user.username) > > Thank you. > > Kind regards. > > > -- > You recei

Re: Use custom HTML to render forms

2014-04-01 Thread Mario Gudelj
You can use {{form.field_name}} to render the input tag, {{form.field_name.label}} to render the label and {{form.field_name.errors}} to render field errors. Simple example: {{ reorder_form.comments.label }}

Re: Django python checkbox

2014-04-01 Thread Mario Gudelj
There are a few ways in which you can do this. One of them is to add some javascript to your code that will listen to onclick and check if your input button is selected. If it is it will submit the form that initiates your download. You can also do an Ajax post. Another way would be to create a lin

Re: Django RequestContext and JQuery.

2014-03-18 Thread Mario Gudelj
Return your context in json format, load it into js var and then use .each() on it. On 19/03/2014 3:27 am, "Kelechi Anyanwu" wrote: > Hi guys! > > How do i use JQuery to loop through a chunk of Django RequestContext being > returned to my template. > > Please i need response!! > > Thanks. > > --

Re: can anyone suggest me some host which is Australia based and also django friendly?

2014-03-03 Thread Mario Gudelj
Amazon now has a dc in Sydney. I believe that Gondor is au based as well. On 03/03/2014 10:44 pm, "lu zou" wrote: > As above, can anyone suggest me some host which is Australia based and > also django friendly?:) > > -- > You received this message because you are subscribed to the Google Groups >

Re: Using Django without templates?

2014-02-27 Thread Mario Gudelj
You do have to be careful with templates if you're using too many inclusions or if you have too much logic in them. There's a good django debug toolbar add-on that informs you about the time a template takes to compile. On 27/02/2014 9:47 am, "ApathyBear" wrote: > I was briefly talking with a dev

  1   2   3   >