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: 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: 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: Editing html templates from front end

2013-11-24 Thread Mario Gudelj
In this case you need to store templates in db which means you need to have a custom loader for your templates. I think that this app does what you need https://pypi.python.org/pypi/django-dbtemplates Cheers, M On 25/11/2013 1:39 AM, "Harjot Mann" wrote: > In django Is there any way through whi

Re: Anyone tried a pre-existing django blog app like wordpress to add to their site?

2013-12-03 Thread Mario Gudelj
I like Zinnia. It's a gun. I had issues understanding some of the code as it's all built in CBVs, but once you get your head around it it rocks. Has everything a blog should have and documentation is great. Even a WP import tool is in it! https://github.com/Fantomas42/django-blog-zinnia On 4 Dec

Re: Accessing attributes of the current view in Django middleware?

2013-12-28 Thread Mario Gudelj
Since the request is simply a dictionary, can you not append that attribute to it? On 28/12/2013 7:41 am, "alk...@gmail.com" wrote: > I'm trying to access an attribute of the current view instance in the > middleware layer. > > For example, given a class-based view like this: > > # views.pyclass

Re: Django manage.py returns ValueError: zero length field name in format

2014-01-05 Thread Mario Gudelj
Sounds like you need 2.7 or at least 3. Check out this answer on SO http://stackoverflow.com/questions/10054122/valueerror-zero-length-field-name-in-format-python Can't have print('Your environment is:"{}"'.format(os.environ['DJANGO_SETTINGS_MODULE'])) Should be *print('Your environment is:"{0}"'

Re: Anybody familiar with JavaScript: Page is empty

2014-01-10 Thread Mario Gudelj
It's hard to tell what the issue is from what you've posted, Igor. Have you looked at Chrome inspector to see if there are any js errors in it? Or have you tried inspecting the page to see if it's not some weird css issue? Try placing usb_data into html outside of js or console.log data var to see

Re: JSON serialization

2014-01-17 Thread Mario Gudelj
In your template try {{usb_data|safe}} On 18/01/2014 4:53 pm, "Igor Korot" wrote: > Hi, ALL, > I'd like someone to help me understand this situation. > Looking at the page: > https://docs.djangoproject.com/en/dev/topics/serialization/ the part > which says "Serialization formats->JSON" there is a

Re: csrf_token is not being set when using Jinja2

2014-01-18 Thread Mario Gudelj
Try {% csrf_token %} by itself On 19/01/2014 12:12 pm, "Chen Xu" wrote: > Hi everyone, > I am using Jinja2 instead of Django's own template engine, however I am > having an issue where csrf_token is empty, I included the following line in > my form: > > > > But csrf_token has no value. > > Can s

Re: Django friendly payment gateway ,what about Eway ?

2014-02-24 Thread Mario Gudelj
Eway is a great gateway for OZ and quite easy to integrate. Not sure how well it works with other currencies. On 25/02/2014 10:21 am, "lu zou" wrote: > Can someone please advise some payment gateway which is friendly with > mezzanine(cartridge) based project ,which is also easy to be implemented

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

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

<    1   2   3