Re: How can I send a password recovery e-mail to a Customer/User in Django?

2016-09-25 Thread Gergely Polonkai
Hello, the trick is not in the email sending, but in resetting the password. Assuming you don't use any user managing apps (as you didn't state it), you will have to implement some parts, but the built-in auth module[1] already covers a lot of this. Best, Gergely [1] https://docs.djangoproject.

Re: How to populate a JqGrid in Django with data obtained from a query (queryset)

2016-09-25 Thread Gergely Polonkai
Hello, do you already know how to do it without Django, e.g with a static dataset? Because, from the HTML page's view, you will exactly do that. I don't know JqGrid, but I assume it needs an array of objects, like gridData = [ { firstColumn: 1, secondColumn: "data" },

Re: Django and Lynda.com

2016-10-13 Thread Gergely Polonkai
Hello, assuming you created the models.py file and filled it with model classes, the only thing I can think of is you haven't added your own app to the INSTALLED_APPS variable in settings.py Hope that helps. Best, Gergely On Fri, Oct 14, 2016, 03:37 Paul Handley wrote: > I am taking the Djang

Re: Running django on demand via my PyQt4 Standalone app

2016-10-24 Thread Gergely Polonkai
Hello, I think installing Django purely for its ORM is a huge overkill. Why not, for example, SQLAlchemy? Or Qt's own DB layer (I'm making an educated guess here; if GTK has one, maybe Qt has its own, too.) If you actually want to use the web framework functionality, though, that's another story,

Re: Using FormMixin with DetailView

2015-07-27 Thread Gergely Polonkai
Hello, could you show us the relevant part of your urls.py file? I suspect view parameters to cause the trouble but I'd like to be sure. Best, Gergely On 28 Jul 2015 00:46, "Ioannis Latousakis" wrote: > I am on the exact same situation as the one described in the documentation > here: > https:/

Re: Using FormMixin with DetailView

2015-07-27 Thread Gergely Polonkai
Forgot to add, the full backtrace would be helpful, too. It should be present on the same error page. On 28 Jul 2015 08:52, "Gergely Polonkai" wrote: > Hello, > > could you show us the relevant part of your urls.py file? I suspect view > parameters to cause the trouble b

Re: Console Routes With Django ??

2015-08-11 Thread Gergely Polonkai
Hello, as far as I know, Django doesn't have thin functionality built in. I would be interested in such an app, though… Best, Gergely On 11 Aug 2015 21:30, "Prabath Peiris" wrote: > Hi > > I am new to (kind of) Django framework and just finish the > Django-REST-framework tutorials and it looks

Re: Console Routes With Django ??

2015-08-11 Thread Gergely Polonkai
Not really. Management commands available in Django can't modify database content as console routes does. Think about them as having a CRUD view set that you can only call via a management command. On 12 Aug 2015 01:23, "Tom Lockhart" wrote: > > On Aug 11, 2015, at 12:29, Prabath Peiris > wrote:

Re: how to access the parent instance from the Inline model admin?

2015-08-23 Thread Gergely Polonkai
Whose parent do you want to get? The inline, the model, or, less likely, the form? On 23 Aug 2015 16:48, "Michael" wrote: > How can I access the parent instance from the inline model admin? > > My goal is to allow to add a child object only when the status of the > parent is equal to 1 so I'm try

Re: Django Live Site to Localhost (Testing)

2015-08-25 Thread Gergely Polonkai
If this is a Django-only thing, you can use manage.py to dump and load your data, without the SQL dump. The code, I guess, is available from somewhere, e.g. in a VCS so you just have to clone/checkout. On 20 Aug 2015 16:40, wrote: > We have a completely developed Django Site running on live, But

Re: Notify Customer Support of Request Failures

2015-08-30 Thread Gergely Polonkai
Hello, in a default Django installation the 500 responses are handled by the logger, not a middleware. It is possible to write a middleware that captures all error responses, and sends a mail about each of them (or only if they are relevant). I don't know of any that is already written, but based

Re: What are the disadvantages of using a custom user model?

2015-08-30 Thread Gergely Polonkai
Hello, is it the fields or the functionality you don't need? If it is really the functionality, you shouldn't bother; just don't use it. If some of the fields, then it worths an evaluation on why you don't need them, if you will have only a few users (e.g. a company internal app), then again, don'

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

2015-09-08 Thread Gergely Polonkai
Hello, this all depends: if I'm a JS expert, I'd go with Meteor or another JS framework. If I'm a Python expert, I'd go with Django or another Python framework. Meteor's strength is in the fact that (almost) the same code runs on the server and in the browser (wether it's good or not is another s

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

2015-09-09 Thread Gergely Polonkai
a website that consists of > both an application part and an static website.* > > > > > *What do you guys think of Django in combination with React.js?Are there > good tutorials out there to make it work and get me started?Or is there > another framework you can recon?* > Ki

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

2015-09-09 Thread Gergely Polonkai
Hello, this is a bit off topic here, and highly opinion based, but here are my two cents: I got along very well with both Bootstrap and Angular, but never tried React before. However, a quick Google search shows that React is barely supported yet (in terms of available Django apps). Best, Gergely

Re:

2015-09-19 Thread Gergely Polonkai
Hello, 0) learn to use Google. Getting the following two links took about 12 seconds 1) if you want to contribute to Open Source in general, go to [1] 2) if you want to contribute to Django specifically, go to [1], then go to [2] 3) profit! Best, Gergely [1] http://developer.com/open/how-to-star

Re: Best way to trigger javascript function when returning a page from django view

2015-09-19 Thread Gergely Polonkai
Hello, I can't see the use case here. If you are submitting the form with AJAX, why would you store it? Or, if I misunderstood you and you submit in the non-AJAX way, Django will send give you back your filled form with the validation errors. Best, Gergely On 19 Sep 2015 10:09, "Martin Torre Cast

Re: Django error report not being sent through email

2015-09-19 Thread Gergely Polonkai
Hello, BrokenLinkEmailsMiddleware sends error reports about 404 errors. 500 errors are reported via logging. Have you overridden the LOGGING setting? Best, Gergely 2015-09-19 13:49 GMT+02:00 Xin Ji : > I'm using apache + django + mod_wsgi to serve my app. > My apache version is 2.4.7 and my dj

Re: Django error report not being sent through email

2015-09-19 Thread Gergely Polonkai
It belongs to settings.py, as everything else. However, if you haven't overridden it, it should send yeu the emails. Are you sure your e-mail sender settings are set properly? Best, Gergely On 19 Sep 2015 14:27, "Xin Ji" wrote: > No, I haven't. > How should I override? And Which file should I pu

Re: custom setting provided by myapp

2015-09-23 Thread Gergely Polonkai
Hello, Most apps I know don't do such things. They write everything needed for them to work in their docs, and if something is not set, they either work with a sane default, or raise ImproperlyConfigured. I do the same myself. Also, Python does this in general; it assumes you read the manual befo

Re: Create a view form capable of saving data into models through FK

2015-09-24 Thread Gergely Polonkai
Hello, The most beautiful way (IMHO) is to create a widget type for this. See this answer on SO[1]. I wonder why this is not part of Django yet… [1] http://stackoverflow.com/a/5155576/1305139 On 25 Sep 2015 01:53, "eli" wrote: > Hi Guys, > A noob here, > > I have two models, > > class Students(

Re: NOOB exposes CSRF token. Now what?

2015-09-25 Thread Gergely Polonkai
Hello, you may force-push a new commit that removes the settings file from the GitHub repo, but if you are really paranoid, you may want to change your CSRF token in production immediately. It may cause some temporary annoyance to your users, but nothing long-term. Best, Gergely 2015-09-25 8:03

Re: NoReverseMatch error in django 1.8

2015-09-27 Thread Gergely Polonkai
Hello, the bookp route requires a user and a book_id parameter. Unless you supply that, your {% url %} tag won't match. Best, Gergely On 27 Sep 2015 12:49, "hossein" wrote: > this is my views and url.py > as long as use tag in my template show error > > url > > urlpatterns = [ > url(r'^boo

Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Gergely Polonkai
Hello, that message is clear: line 45 in your settings.py has a syntax error. That line, however, seem OK, so I guess the previous one is that; maybe a comma is missing. Best, Gergely On 27 Sep 2015 14:26, "Cai Gengyang" wrote: > Hi Tom, > > Following your latest instructions , I have posted my

Re: django query, order results such that th128 > th99

2015-09-27 Thread Gergely Polonkai
Hello, what you want to achieve is called "natural order sorting" which is not built into any common SQL implementation I know. You have to do it manually from code, or, if you have to do pagination, add a sorting column that is numeric (and indexed). Best, Gergely On 28 Sep 2015 08:42, "gintare"

Re: Admin: Unknown fields

2015-09-28 Thread Gergely Polonkai
Hello, I suspect you didn't make/run migrations: python manage.py makemigrations python manage.py migrate The first command creat the so-called migration files that are required to update the database by adding new tables and fields, while the second one does the actual upgrade. Also, allow me

Re: Foreign key in sqlite3

2015-09-30 Thread Gergely Polonkai
Assuming you are using Django and it's ORM, the same way as in any other database: fieldname = models.ForeignKey(AnotherModel) On 30 Sep 2015 15:18, "Bhanu Kathuria" <001kathuriabh...@gmail.com> wrote: > I am using sqlite3 database. > How can I add foreign key between two tables. > > -- > You

Re: Foriegn key error--> no such column: eduplus_choice.question_id

2015-09-30 Thread Gergely Polonkai
Did you run your migrations? On 30 Sep 2015 15:35, "Bhanu Kathuria" <001kathuriabh...@gmail.com> wrote: > Settings,admin and model file are attached. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop

Re: How to run all tests in INSTALLED_APPS with the new test runner 1.6?

2015-10-06 Thread Gergely Polonkai
Hello, do you mean the integrated unittest module, or the Django test runners? However, both needs to be fetched from old history, and I daresay it won't be an easy fetch. 1.6 code will more than likely be incompatible with 1.8, so even if you backmerge it, you will have to do a lot of patching.

Re: How to run all tests in INSTALLED_APPS with the new test runner 1.6?

2015-10-06 Thread Gergely Polonkai
is accomplished by grabbing the old > django.test.simple.DjangoTestSuiteRunner from git history or by any other > means. > > On Tuesday, October 6, 2015 at 4:24:00 PM UTC-4, Gergely Polonkai wrote: >> >> Hello, >> >> do you mean the integrated unittest module, o

Reverse access model through a “double” ForeignKey

2015-10-14 Thread Gergely Polonkai
Hello, I have three models: • Build • BuildGrouping, with a ForeignKey “build” pointing to Build • Value, with a ForeignKey “grouping” that points to BuildGrouping Right now, I also have Value.build, which is a ForeignKey to Build, so I can access the list of Values directly from a Build. This

Re: Reverse access model through a “double” ForeignKey

2015-10-14 Thread Gergely Polonkai
to change my templates and such. Thanks for the tips, though! Best, Gergely 2015-10-14 15:09 GMT+02:00 Carsten Fuchs : > Am 14.10.2015 um 11:11 schrieb Gergely Polonkai: > >> This setup, though, doesn’t feel right, as it contains redundancy. Is >> there a way to >> a

Re: Importing models from another app?

2015-10-17 Thread Gergely Polonkai
How does it fail, what is the error message? My first guess is that you should omit "mysite" from your import line, but without the exact message it's hard to tell. Best, Gergely On 17 Oct 2015 15:52, "svewa" wrote: > Hello everyone, > > I have a question about the model interaction between diff

Re: Keep object along a session.

2015-10-20 Thread Gergely Polonkai
Hello, in the runserver environment, each request is served by the same instance, so whatever object you create and leave referenced somehow (good luck on that) will stay alive until runserver is running. However, as soon as you move to a production environment, be it Apache's mod_python, gunicorn

Running migrations on the non-default database fails

2015-10-28 Thread Gergely Polonkai
Hello, I have an application which, due to low usage, used SQLite in production. Now the demand has risen for the app, and SQLite can't really keep up with with all the new users. We decided to move to PostgreSQL. The DB is now up and running, but to cause as short downtime as possible, I added a

Re: [1.8] Odd error on makemigrations when moving model to another application

2015-11-02 Thread Gergely Polonkai
On 3 Nov 2015 06:07, "Mike Dewhirst" wrote: > > On 3/11/2015 9:55 AM, Alex Heyden wrote: >> >> I tried putting the model back in its original module with some much smaller changes, but I'm getting the same error. The error is nonsense in the current context. >> >> Is there some intermediate state

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-03 Thread Gergely Polonkai
On 4 Nov 2015 05:45, "kk" wrote: > > > > On Tuesday 03 November 2015 08:35 PM, Remco Gerlich wrote: >> >> Django code is just normal Python. Python can call REST APIs, sure (a nice library is Requests: docs.python-requests.org/en/latest/ ) >> > I got to see this, thanks, had a quick look and it e

Re: can I write Django a client consuming RESTfull api from elsewhere

2015-11-04 Thread Gergely Polonkai
On 4 Nov 2015 17:31, "kk" wrote: > > > Ok one question, > I would like to store a client connection in some kind of a global place for my entire Django frontend. > So that the request object can be used from any view. > Can you suggest some guideline to do this? > Happy hacking. > Krishnakant.

Re: Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Gergely Polonkai
An even more fine grained solution may be using an HTML parser like beautifulsoup. However, if your site's functionality depends on client side features like JavaScript, Selenium may be a better alternative. On 4 Nov 2015 18:33, "Dheerendra Rathor" wrote: > You can use unittest.TestCase.assertReg

Re: How do I relate two tables using field name instead of id?

2015-11-04 Thread Gergely Polonkai
This really depends on the structure of your models. In this case you will most likely have a ForeignKey in one of your models; if the referenced model has an __str__() method, the admin site (and also any other forms) will display names instead of the text "OtherModel object". On 4 Nov 2015 17:19,

Re: How do I relate two tables using field name instead of id?

2015-11-05 Thread Gergely Polonkai
It is possible, but in an SQL database it may become ineffective. For this, you will have to make the name field unique, and put an index on it (uniqueness also creates an index, by the way). For the admin site to display names, though, you still have to define the __str__() method that does only

Re: How do I relate two tables using field name instead of id?

2015-11-05 Thread Gergely Polonkai
If you go with the current solution, you will have to add the to_field keyword argument to ForeignKey: clinician = models.ForeignKey(Clinician, to_field='name') Best, Gergely 2015-11-05 15:47 GMT+01:00 frocco : > Thanks, I will look into adding id > > If I just do this, clinician = models.Forei

Re: coding in template

2015-11-07 Thread Gergely Polonkai
Hello, I guess seems that your template is saved in LATIN2 encoding (in which 0xb3 is ł). Save it in UTF-8, or set up Django to use LATIN2 as the encoding instead of Unicode (I suggest to go with the first option, though). Best, Gergely 2015-11-07 21:44 GMT+01:00 Dariusz Mysior : > I try use po

Re: coding in template

2015-11-07 Thread Gergely Polonkai
That depends on your text editor. Most of them make it possible to choose an encoding in the save dialog. 2015-11-07 21:56 GMT+01:00 Dariusz Mysior : > How can I save in other coding, I had only option "save as" and name of > file index.html > > W dniu sobota, 7 listopada 2015 21:44:25 UTC+1 użyt

Re: Managing and synchronising users on multiple sites

2015-11-08 Thread Gergely Polonkai
How about an SSO solution hosted at one of the sites? When the user logs in, the site authenticates them against the SSO, and fetches user data. See Stack Exchange sites (Stack Overflow, Server Fault, etc) as an example. On 8 Nov 2015 18:24, "Stodge" wrote: > I have several Django sites and I nee

Re: finding information on modules, imports, etc.

2015-11-08 Thread Gergely Polonkai
It's a bit unclear what you want to do. Could you write a use case? I'm afraid of an XY problem here… On 8 Nov 2015 18:25, "Gary Roach" wrote: > I can't seem to find a "dictionary" of modules? or what ever on the use of: > > import os or other possible imports > > from django.contrib import admi

Re: Managing and synchronising users on multiple sites

2015-11-08 Thread Gergely Polonkai
separate one would be the best) On 8 Nov 2015 21:09, "Stodge" wrote: > The servers are in DMZs in different cities. I don't control the firewall > configuration and I'm not allowed to open extra ports. > > On Sunday, 8 November 2015 14:18:37 UTC-5, Gergely Polon

Re: Django on CentOS

2015-11-08 Thread Gergely Polonkai
Hello, no, the problem is here: [Sun Nov 08 14:46:43 2015] [error] [client 109.10.154.52] ImportError: Could not import settings 'pizzaclub.settings' (Is it on sys.path?): No module named pizzaclub.settings, referer:http ://212.227.107.82/ It see

Re: Django on CentOS

2015-11-09 Thread Gergely Polonkai
Hello, there’s a lot that is not clear for me in your included config: • Why are all those paths in WSGIPythonPath? • Are there Python modules in those directories? • Do I get it right that your application is installed under /var/www (which is generally a bad idea)? • Is pizzaclub/settings.py av

Re: Fixed column width in admin interface?

2015-11-14 Thread Gergely Polonkai
Or you can apply a CSS with overflow: ellipsis; whichever fits you. On 14 Nov 2015 17:10, "Simon Charette" wrote: > Hi Jorgue, > > You can simply define a `list_display` method > > that truncat

Recursion error after upgrading from 1.8 to 1.9

2015-12-02 Thread Gergely Polonkai
I have upgraded Django from 1.8.5 to 1.9. Running my tests fails with this: RuntimeError: maximum recursion depth exceeded while calling a Python object My INSTALLED_APPS: INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.con

Re: Recursion error after upgrading from 1.8 to 1.9

2015-12-02 Thread Gergely Polonkai
New info: I have removed everything after django.contrib.staticfiles, but the problem still persists. 2015-12-02 11:57 GMT+01:00 Gergely Polonkai : > I have upgraded Django from 1.8.5 to 1.9. Running my tests fails with this: > > RuntimeError: maximum recursion depth exceeded while

Re: Problem Working with forms.Form

2015-12-06 Thread Gergely Polonkai
Hello, you should use ModelForm; if the only problem you have is the CSS properties, you may assign custom CSS classes to your widgets, and use templates to render your fields individually. Best, Gergely On Dec 6, 2015 5:33 PM, "Teddy McZieuwa" wrote: > Hi, > please, I am new to django, I just

Re: calling html file from within javascript

2015-12-13 Thread Gergely Polonkai
Hello, although this is barelyDjango related, here are some notes. >From MDN[1]: Note: as* document.write* writes to the document *stream*, calling *document.write* on a closed (loaded) document automatically calls *document.open* which will clear the document

Re: calling html file from within javascript

2015-12-13 Thread Gergely Polonkai
Best, Gergely On Dec 14, 2015 7:52 AM, "Gergely Polonkai" wrote: > Hello, > > although this is barelyDjango related, here are some notes. > > From MDN[1]: Note: as* document.write* writes to the document *stream*, > calling *document.write* on a closed (loaded) document aut

Re: testing django migrations

2015-12-27 Thread Gergely Polonkai
I'm also interested in that, except that I'd like to test RunPython steps. On Dec 28, 2015 12:32 AM, "Dan Tagg" wrote: > Hi, > > I used this: > https://github.com/plumdog/django_migration_testcase > > It's only worth writing tests if you are modifying code created by > makemigrations. > > Dan > >

Re: Migrating older 1.4 project to 1.9

2016-03-30 Thread Gergely Polonkai
I have already suggested this approach to someone with a similar problem: upgrade one version at a time. I’m sure it is possible to find older versions; 1. upgrade to the next minor release (1.4 => 1.5, etc), 2. do the necessary adjustments, 3. goto 1. It may be a lot of work, but at the end of th

Re: Can not read request.body from a POST request

2016-04-20 Thread Gergely Polonkai
read its body? Best, Gergely They aree [image: --] Gergely Polonkai [image: https://]about.me/gergely.polonkai <https://about.me/gergely.polonkai?promo=email_sig&utm_source=email_sig&utm_medium=external_link&utm_campaign=chrome_ext> Gergely Polonkai [image: https://]about.m

Re: remove ./ from commands

2016-04-21 Thread Gergely Polonkai
oject/lives:$PATH" After this one, you can enter plain manage.py Gergely Polonkai [image: https://]about.me/gergely.polonkai <https://about.me/gergely.polonkai?promo=email_sig&utm_source=email_sig&utm_medium=email_sig&utm_campaign=external_links> 2016-04-21 6:46 GMT+02:00

Re: Can not read request.body from a POST request

2016-04-21 Thread Gergely Polonkai
A JSON/XML payload, for example. If you use plain Django (on DRF and other extensions), then request.body is the only way to access said payload. Best, Gergely Gergely Polonkai [image: https://]about.me/gergely.polonkai <https://about.me/gergely.polonkai?promo=email_sig&utm_source=em

<    1   2