Re: Complex content type

2016-05-02 Thread ludovic coues
I have some trouble trying to understand what you means by "content type". That terms refer to the content of a file. For exemple, text/plain for plain text file or image/png for an image encoded as png. What you show look like a standard form. If you need basic pointer on how to use a form, saving

Re: Complex content type

2016-05-02 Thread ludovic coues
text of an answer > 0302 text of an answer > > > > > On Monday, May 2, 2016 at 3:25:06 PM UTC+6, ludovic coues wrote: >> >> I have some trouble trying to understand what you means by "content type". >&

Re: Trying to make a POST call to a Django view

2016-05-02 Thread ludovic coues
I would use the browser developer tools to look at what JQuery is sending to django in the submit event. 2016-05-02 18:01 GMT+02:00 carloratm : > hello everyone, > I am a frontend developer studying Django, so please forgive my noobish > question... > I am trying to make a simple ajax call working

Re: Complex content type

2016-05-02 Thread ludovic coues
> On Monday, May 2, 2016 at 4:25:13 PM UTC+6, ludovic coues wrote: >> >> You might want to add a foreign key in the answer model pointing to >> the question. >> Then in the view to show the form, create an answer object with it's >> question FK assigned to the

Re: Having a problem loading images and other content for some reason..

2016-05-09 Thread ludovic coues
Look like you aren't using the static tag for image and javascript url. 2016-05-06 19:20 GMT+02:00 Yakir Gabay : > Hello I'm very new to Django and very confused > I have basic familiarity with HTML. > Hosted a website on my localhost, the CSS loads like I wanted however the > images refuse to loa

Re: Set field on related table

2016-05-09 Thread ludovic coues
If you hare a beginner, you should definitely take a good look at the django tutorial. It's full of details you need to know to be effective with django like ForeignKeyField, which let you write user.Badge.Available = 0 2016-05-09 10:34 GMT+02:00 Biase D'Agostino : > Hello, > sorry for the questio

Re: installation steps for django and virtualenv setup.

2016-05-13 Thread ludovic coues
First virtualenv. The easiest way for you is to install Linux mint package python-virtualenv. Then you can use `virtualenv ~/.config/django_env` to setup your virtual env. To use it, you need to activate it with the command `source ~/.config/django_env/bin/activate`. You need that command each tim

Re: Reverse for 'reg/{{post.pk}}/' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

2016-05-24 Thread ludovic coues
It should work better this way: Save the url template tag take a route name, not an url as it first argument. 2016-05-24 10:19 GMT+02:00 meInvent bbird : > Reverse for 'reg/{{post.pk}}/' with arguments '()' and keyword arguments > '{}' not found. 0 pattern(s) tried: [] > > i follow django girl we

Re: Reverse for 'reg/{{post.pk}}/' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

2016-05-26 Thread ludovic coues
chapter about form. [1] http://tutorial.djangogirls.org/en/django_forms/ 2016-05-26 3:46 GMT+02:00 meInvent bbird : > https://drive.google.com/file/d/0Bxs_ao6uuBDUQm5jOEdCOFowa0U/view?usp=sharing > > On Tuesday, May 24, 2016 at 9:07:25 PM UTC+8, ludovic coues wrote: >> >> It should

Re: Reverse for 'reg/{{post.pk}}/' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

2016-05-27 Thread ludovic coues
#x27;businessType': post.BusinessType, 'company': post.Company,}) > > > > > On Thursday, May 26, 2016 at 10:24:44 PM UTC+8, ludovic coues wrote: >> >> Have you done the django tutorial ? It help a lot when starting with >> django. >> >> Yo

Re: Allow users to vote up, down or nothing

2016-06-06 Thread ludovic coues
I will assume user can vote a specific article. I would go for another model, like that class VoteForArticle(models.Model): DOWN = 0 NEUTRAL = 1 UP = 2 VOTES = ((DOWN, "down"), (NEUTRAL, "neutral)", (UP, "up")) user = models.ForeignKey(settings.AUTH_USER_MODEL) article = mo

Re: Network scan tool.

2016-06-07 Thread ludovic coues
There is two way to monitor the data. Either passively, listening for each host saying hello on the network or actively, probing for host at regular interval [1]. First way look like difficult as in requiring cooperation from diverse host and relying on protocol like SNMP. Or you could listen for

Re: User Registration

2016-06-08 Thread ludovic coues
Have you looked at the django documentation ? There is a builtin form for creating a new user, working with user model shipped with django. https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.forms.UserCreationForm 2016-06-08 10:46 GMT+02:00 Arshpreet Singh : > I am im

Re: Adding Tinymce to Admin

2016-06-09 Thread ludovic coues
I'm pretty sure you can specify a widget to use in admin for each model and field. Part 7 of the tutorial will show you how to alter the admin without changing the file in the virtualenv. The documentation on ModelAdmin have an example of what you are trying to do :) +33614874342 On 8 Jun 2016 6:

Re: Django and jQuery, I don't get it

2016-06-10 Thread ludovic coues
> (function($) { > 'use strict'; > > })(django.jQuery); This syntax is called a closure. First you declare a function so you don't contaminate the global scope with your local declared variable. Then you execute your function. I will assume django.JQuery is the version of JQuery shipp

Re: Absolute beginner step by step

2016-06-13 Thread ludovic coues
The django girls tutorial is also a very good ressource for beginner. http://tutorial.djangogirls.org/ 2016-06-11 23:45 GMT+02:00 Lee Hinde : > https://leanpub.com/tangowithdjango19/ > > > On Jun 11, 2016, at 2:07 PM, Gary Roach wrote: > > If you don't mind working with Python2.7 and Django 1.7 y

Re: Recommended courses/materials for Python/Django course...

2016-06-16 Thread ludovic coues
The "Python Crash Course" aim to teach python from nothing in the first half and to put that knowledge in application in the second half through 3 projects. These are a 2D game, some data visualization technique from diverse source and a django application. Some people have some difficulty with th

Re: how to use view function in another function of view in django

2016-06-16 Thread ludovic coues
I don't understand what you are trying to do. base(request) create a response for the browser using j and a to render base.html. If you want to have access to j and a in both index.html and list.html, try this: def base(request): j = Job.objects.all() a = Ab.objects.all() return {'j':j

Re: Absolute beginner step by step

2016-06-16 Thread ludovic coues
that's the expected result at this point. 2016-06-16 7:43 GMT+02:00 Tushar Shukla : > iam doing this tutorial and i cant get the final result no matter what i do > > iam using pycharm. please help i have attached the error page > > On Saturday, 11 June 2016 23:57:33 UTC+5:30, Derek wrote: >> >> Th

Re: Python NoReverseMatch when Viewing the Page

2016-06-18 Thread ludovic coues
Can you post the INSTALLED_APPS part of your settings.py ? 2016-06-17 21:01 GMT+02:00 'antanas skiudulas' via Django users : > I'm a newbie trying to make a wiki page with Django, however, I keep running > into this very annoying problem: > > NoReverseMatch at /wiki/page/Start/ Reverse for '' with

Re: choices field language

2016-06-21 Thread ludovic coues
Python 3 have a better support of international alphabet. 2016-06-20 23:44 GMT+02:00 Xristos Xristoou : > hello i want to use choices in my field but not work if i write in my > language(greek) only work in the england language. > if i writing choices in my language show me error message in the ad

Re: Django/Ajax update existing template page

2016-06-22 Thread ludovic coues
Have you tried {{item1|pprint}} ? Or to check the raw page, not the one displayed by the brother ? I got bitten more than once by brother not displaying variable whose value looked like 2016-06-22 20:31 GMT+02:00 : > Hello everyone, > > I am trying to do the following: > > Grab Year/Month values

Re: Password hasher for vBulletin?

2016-06-23 Thread ludovic coues
Do you have extra good reason to call hashlib function with a variable called password ? If you simply want to hash user password, django provide a few function for that job [1]. it's used like that: >>> from django.contrib.auth.hashers import make_password, >>> check_password >>> pwd = make_pass

Re: python manage.py runserver error

2016-06-25 Thread ludovic coues
Django 1.9.7 is compatible with python 2. Django 1.11 is planned to be last version supporting python 2, the last version for django 1 and will be on long term support. Only django 2 will drop support for python 2. For the original question, the issue seems related to salute. The content of setti

Re: install with package manager or pip

2016-06-25 Thread ludovic coues
virtualenv venv source venv/bin/activate pip install django pip freeze > requirements.txt django-admin startproject tutorial cd tutorial && python manage.py runserver Assuming you have python and virtualenv installed on your machine. At this point, you have: * a virtualenv inside the folder venv

Re: install with package manager or pip

2016-06-26 Thread ludovic coues
The virtualenv folder should not be your root folder. It's a separate folder. You can keep them all in a single location or put each of them in a subdir of your projet. You start using a virtualenv with "source venv/bin/activate". After this, the current terminal will use the virtualenv in the fol

Re: install with package manager or pip

2016-06-26 Thread ludovic coues
; > On Sunday, June 26, 2016 at 11:13:20 AM UTC-5, ludovic coues wrote: >> >> The virtualenv folder should not be your root folder. > > > it's not. VirtEnv is base. VirtEnv/mysite is the virtualenv. this is > where manage.py is located then VirtEnv/mysite/mysite and

Re: Serving static files

2016-06-27 Thread ludovic coues
It's not that the framework will come to an halt. It's that a server serving static file directly would be an order of magnitude faster. https://unix4lyfe.org/time/hn.html is a nice article on how server react to heavy load when serving static file. 2016-06-27 18:26 GMT+02:00 Ankush Thakur : > I

Re: Implementing user alias in django.

2016-06-28 Thread ludovic coues
I would separate user and account. User is one person and is used to connect. Account have newsfeed and follow other user. Each user can manage as many account as he want. Many user can manage the same account. All that can be transparent to your user if you setup an account matching the user for

Re: Contribute to Django - Python 3 or Python 2

2016-07-01 Thread ludovic coues
https://docs.djangoproject.com/en/dev/releases/1.11/ "The Django 1.11.x series is the last to support Python 2. The next major release, Django 2.0, will only support Python 3.5+." But your point remains valid. It make more sense to use python 3 as it will be the only option available soon and som

Re: the Django test client - https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client

2016-07-02 Thread ludovic coues
We can't help you because we have to watch a gif at least 5 seconds long and the error message stay on screen less than half a second. If you could past the content of your term at the end of the gif, we could help you. thanks. 2016-07-02 12:59 GMT+02:00 Ricardo Valério : > *I'm following the o

Re: Installing Django Problem.

2016-07-04 Thread ludovic coues
I could ask you what error you get when running syncdb. I could tell you to use manage.py createsuperuser. But the best advice anyone can give you is to do a tutorial about django. The django girls one is really great. The one from the official documentation is shorter. Either one will give you a s

Re: Create navbar dropdown menu list with url tags

2016-07-06 Thread ludovic coues
try to add that ## {{ airlines|pprint }} If it show `## ''` in the page, airlines is not defined in the template context. 2016-07-06 12:21 GMT+02:00 : > Hi, > I have a model and whould like to create a dropdown menu from the fields > generated. > Unfortunately no dropdown list is showed: > >

Re: Best Practices URL Patterns

2016-07-06 Thread ludovic coues
You want a value to identify a specific job, different from the job_id, to put in the url. I would add a slug field in the model and use that. The slug could be derived from the job title, maybe concatenated to an UUID for uniqueness or simply an UUID different from the id. If you are using views

Re: Create navbar dropdown menu list with url tags

2016-07-07 Thread ludovic coues
"## {{ airlines|pprint }}" can't display a dropdown menu. It's a debug tool. It's supposed to show two # symbol so you know you are editing the right template then it should display a python representation of what airlines is. If things work as expected, you should have something like that in the p

Re: how should i make a non downloadable image in my django website

2016-07-09 Thread ludovic coues
If the image is displayed, the user can use a screen capture tool to get it. You can make it harder for your user to get the image by putting a transparent image on top of the displayed image. You can put the image as a background on a div. You can cut the image in many part and display a grid of

Re: NoReverseMatch at /accounts/accounts/auth/

2016-07-09 Thread ludovic coues
A full stacktrace and the content of urls.py would be nice. 2016-07-09 13:46 GMT+02:00 : > I tried my best to solve this but i couldn't please help me > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and s

Re: no django reverse match

2016-07-09 Thread ludovic coues
After reading your message, I don't know what the app should do, and what happen currently. I don't know if there is an error or not. Some part are missing like the imports, app_name in urls.py or the url for message_board:list. As a sidenote, I will suggest you to look the authentication views [

Re: Django - Populating more than one model from the same form ?

2016-07-09 Thread ludovic coues
Have you done the django tutorial ? Part 7 [1] Should answer your question. [1] https://docs.djangoproject.com/en/1.9/intro/tutorial07/ 2016-07-09 18:03 GMT+02:00 : > I have a 2 Models, Product and Image. Image has a foreign key to Product. > > In the form I want to appear information from both

Re: Django - Populating more than one model from the same form ?

2016-07-09 Thread ludovic coues
forms/modelforms/#inline-formsets 2016-07-09 21:47 GMT+02:00 ludovic coues : > Have you done the django tutorial ? > > Part 7 [1] Should answer your question. > > [1] https://docs.djangoproject.com/en/1.9/intro/tutorial07/ > > 2016-07-09 18:03 GMT+02:00 : >> I have a 2

Re: How to made import a js file with my function as pytonic method "from module_name import function_name"?

2016-07-10 Thread ludovic coues
What are you trying to do ? Where do you want to import your js code ? Why do you want to do it ? What are you trying to achieve ? 2016-07-10 15:06 GMT+02:00 Seti Volkylany : > After googling in the Web, I don`t found clean solution for it. > > -- > You received this message because you are subscr

Re: Reverse for 'resetPasswordSendMail' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'$resetPasswordSendMail/$']

2016-07-10 Thread ludovic coues
Have you checked you didn't put a space between 'account: and resetPasswordSendMail' ? 2016-07-10 6:49 GMT+02:00 Ajo Thomas : > I am getting the error mentioned in the heading. The reverse url is > working perfectly everywhere in the html code except in the form action > part. The code works per

Re: Creating an application form

2016-07-10 Thread ludovic coues
First, you need a model to store the data in the database. Then, you can use a CreateView as explained at [1]. You should have something like that at the end. models.py: from django.db import models class User(models.Model): name = models.CharField(max_length=128) newsletter = models.Bool

Re: dynamic WAV file??

2016-07-11 Thread ludovic coues
My go to solution for that king of problem is to append a query argument. If the browser have a cached version of sound.wav?v=1 but you serve sound.wav?v=2, the browser should grab the last version, even if the file is still named sound.wav. For your second point, you could use BytesIO, from the i

Re: Slow Django dev server reload

2016-07-11 Thread ludovic coues
Any chance the big time difference come from the difference between SSD and mechanical drive ? 2016-07-11 7:00 GMT+02:00 Krishna Bharadwaj : > Fred, > > That's very good to know. At least it tells me that the number of imports > could be one of the main reasons for the slow down. And I apologise f

Re: static files suspicious operation, os error, and list of paths

2016-07-11 Thread ludovic coues
Do you define BASE_DIR and STATIC_URL in your settings.py file ? 2016-07-11 23:56 GMT+02:00 Malik Rumi : > Well, I'm stuck again. I am still trying to get my dev site to work with > this new bootstrap theme. Debug toolbar is telling me over 1,000 staticfiles > have been found, but none were used.

Re: install of django 1.9

2016-07-13 Thread ludovic coues
Assuming you have created a virtual env with `virtualenv myvenv` * activate the virtualenv: `source myvenv/bin/activate` * install django: `pip install django` * create a django project: `djang-admin startproject myproject` * move into that project: `cd myproject` * create an app for your pr

Re: django_bootstrap_calendar and admin backend

2016-07-13 Thread ludovic coues
Code would be more useful to understand what is happening. Or you can use the django test client [1] to see what the view is returning as context. The list of event might be empty. [1] https://docs.djangoproject.com/en/1.9/intro/tutorial05/#the-django-test-client 2016-07-12 16:49 GMT+02:00 Cron

Re: django_bootstrap_calendar and admin backend

2016-07-14 Thread ludovic coues
If you are using https://github.com/sandlbn/django-bootstrap-calendar/, I assume you have changed some things. For exemple, the module don't come with an admin.py file. All your change would be nice so we can replicate your problem :) 2016-07-13 22:33 GMT+02:00 Cronos Cto : > Hello Ludovic, what p

Re: Easiest way to ajax enable django forms

2016-07-14 Thread ludovic coues
A JS library like Jquery or plain javascript. Listen to event, intercept & cancel them, make the query to django, insert or remove the appropriate item. 2016-07-13 20:25 GMT+02:00 J Singh : > I want functionality such as add/delete line items to an order , do not want > a form resubmit every time

Re: django_bootstrap_calendar and admin backend

2016-07-14 Thread ludovic coues
I haven't managed to reproduce your error. In fact, I managed to make it working. What output do you get when you hit http://localhost:8000/calendar/json/?from=146532400&to=149000240 ? Adjust the hostname and port to your dev server. 2016-07-14 11:54 GMT+02:00 Cronos Cto : > > > > Yes htt

Re: Jet Admin Backend Prob with Google Analytics

2016-07-14 Thread ludovic coues
You have no variable named PROJECT_DIR your file pressmedia/pm/settings.py. You might want to remove os.path.join as you already specify the full path. 2016-07-14 17:16 GMT+02:00 Michael Schintler : > Hi all , > > I m sorry but new to Django and after some learning i came to Jet Admin > Backend. A

Re: Help with django form an ajax, error 500

2016-07-16 Thread ludovic coues
The error should come with a backtrace. Providing the backtrace will help a lot in finding the error. 2016-07-15 19:52 GMT+02:00 Elros Romeo : > Hi, i hope you can help me, im trying to make a django post form without > reloading the page using ajax, but im getting error 500 when submit, can you >

Re: AttributeError: 'Post' object has no attribute 'get_absolute_url'

2016-07-18 Thread ludovic coues
The code of your model would be more interesting. According to the error, Post have no method get_absolute_url. That method isn't provided by models.Model, you have to write it. A way to do it is like that: from django.db import models from django.urls import reverse class Item(models

Re: Django with node js

2016-07-18 Thread ludovic coues
It depends on how django and node JS interact together, what they are used for, etc... 2016-07-18 18:58 GMT+02:00 Arindam sarkar : > I have a situation where I want to use django with node JS my problem is how > do I share user session data among django and notes server? > > -- > You received this

Re: Django with node js

2016-07-18 Thread ludovic coues
o > for the logged in user > > > On Jul 18, 2016 10:39 PM, "ludovic coues" wrote: >> >> It depends on how django and node JS interact together, what they are >> used for, etc... >> >> 2016-07-18 18:58 GMT+02:00 Arindam sarkar : >> >

Re: Getting an error when I try to make an html page on django

2016-07-19 Thread ludovic coues
How do you "open the webpage" ? 2016-07-19 6:10 GMT+02:00 Jose : > I was watching a Django tutorial video and on the video the guy writes the > exact same code I have on the picture. In the video whats inside of his > curly brackets turns to purple. Mine does not turn purple and there is > somethi

Re: Getting an error when I try to make an html page on django

2016-07-19 Thread ludovic coues
Also, a copy of the error would help us a lot to help you. 2016-07-19 14:52 GMT+02:00 ludovic coues : > How do you "open the webpage" ? > > 2016-07-19 6:10 GMT+02:00 Jose : >> I was watching a Django tutorial video and on the video the guy writes the >> exact same

Re: Django simple Captacha

2016-07-20 Thread ludovic coues
This kind of captcha is easier for bot than it is for human. This one is especially weak. Single font, Single color for the text. And the more noise you add on the text, the harder it will be for human. https://github.com/ptigas/simple-captcha-solver is a basic tool for solving these. I strongly

Re: Getting an error when I try to make an html page on django

2016-07-20 Thread ludovic coues
Like it have been said, it look like there is no object with id 2. If you want more details, you'll need to share the content of your view function. 2016-07-19 20:21 GMT+02:00 Sergiy Khohlov : > Looks like you have deleted artist with Id#2. > > > 19 лип. 2016 18:21 "Jose" пише: > >> >> >> On Tu

Re: django_bootstrap_calendar and admin backend

2016-07-20 Thread ludovic coues
You might have noticed, the calendar view is a generic template view. It only display an html page. All the work is done with js. If everything work fine, it fetch the list of even for the period with ajax and add the event in the calendar. /calendar/json should return the list of event. As you ca

Re: django_bootstrap_calendar and admin backend

2016-07-20 Thread ludovic coues
it shouldn't be too hard to port it to python3. The module is mainly javascript, not python. Once the app can return json, it should work fine. 2016-07-20 20:40 GMT+02:00 Cronos Cto : > That explains alot of the issues I am having. Since it is a compatibility > issue, I am guessing there is no

Re: Generic Foreign Key

2016-07-21 Thread ludovic coues
Generic Foreign Key solve a very specific problem. Foreign key to arbitrary models. Like a tagging system, with the ability to set a tag to user, article, comment, media in a blog. For your use, as long as no models can link to notes or counties and not both, simple foreign key are fine. And even

Re: Generic Foreign Key

2016-07-21 Thread ludovic coues
ally if I am using the county Foreign key in a few different models > I am fine. I am not sure what you meant by this > "as long as no models can link to notes or counties and > not both, simple foreign key are fine." > > > On 21 July 2016 at 11:13, ludovic coues wrot

Re: Django Email Model

2016-07-21 Thread ludovic coues
https://docs.djangoproject.com/en/1.9/topics/db/examples/many_to_many/ Each student can subscribe to more than one newsletter Each newsletter have many of students. 2016-07-21 15:20 GMT+02:00 Ant : > Being a Django "newcomer" I am hoping someone can help us with this simple > problem. > > We h

Re: Installation de Django dans un environnement virtuel.

2016-07-24 Thread ludovic coues
Est-ce que l'erreur survient aussi si la commande est lancé sans sudo ? Dans un virtualenv, sudo ne devrait pas etre utilisé, on travail avec des fichiers que l'on a crée, dans notre dossier personnel. 2016-07-24 16:17 GMT+02:00 : > Can You, please, in English describe what a problem You have? I

Re: TypeError: $.get is not a function

2016-07-25 Thread ludovic coues
$.get look a lot like Jquery. Do you mind to share what version you are using ? You can find out with `alert($.fn.jquery)` 2016-07-25 16:34 GMT+02:00 Gergely Polonkai : > This sounds to be a JavaScript problem, which is not part of Django in any > ways. > > My idea, however, is that you don’t im

Re: How to add logo to django header

2016-07-28 Thread ludovic coues
You are suggesting to alter the django library directly. This as two immediate bad effect. First, it make upgrading to newer and more secure version of django harder as the change will be overwritten by the upgrade. Second, if you want to keep your track of your change, using git for exemple, you

Re: django 1.9, migrations SUCK

2016-07-29 Thread ludovic coues
In /home/ariatel_web/dashboard.ariatel.com.co/apps/did/forms.py, replacing country = forms.ChoiceField(choices=[ (d.country_name, d.country_name) for d in DidCountry.objects.filter(is_active=True) ] with country = forms.ChoiceField(choices=lambda: [ (d.country_name, d.country_name) for d i

Testing if a view have an html element with at least one attribute

2016-07-31 Thread ludovic coues
Hello, I am trying to test if a view is displaying a form with an input element with name=username. Currently, I have tried a lot of variation around `self.assertContains( response, "", html=True)` but none work. I assume that doesn't work because the view have a field input with name=username bu

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread ludovic coues
ldset = """ """ self.assertInHTML('', fieldset) self.assertInHTML('', fieldset) First input is to have a working exemple, second is taken as is from my view. Not closing the input in assertInHTML give an error `Couldn't find ':

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread ludovic coues
html element, not the raw content returned by the view. I'm quite uneasy to have the test failing if a class is added or removed from the element. But yes, your solution work for the current state of the application. 2016-07-31 14:46 GMT+02:00 Andreas Kuhne : > 2016-07-31 13:56 GMT+02:00 ludov

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread ludovic coues
/accounts/login') self.assertEqual(response.status_code, 200) doc = etree.HTML(response.content) self.assertEqual(len(doc.findall('.//input[@name="username"]')), 1) 2016-07-31 17:46 GMT+02:00 Andreas Kuhne : > 2016-07-31 15:59 GMT+0

Re: Testing an object

2016-08-01 Thread ludovic coues
Look like you forget to indent the method inside your class. 2016-08-01 13:43 GMT+02:00 Neil Hunt : > I've read and reread the tutorial and I'm working on writing a very simple > banking app by copying and modifying what's in the tutorial. I've started a > new project and copied what was on the fi

Re: Better style: from django.db import models vs from django.db.models import ...

2016-08-01 Thread ludovic coues
A models file might use a lot of class from the django.db.models module and importing each class lead to lengthy import line. That's might be one reason. The better reason might be that a lot of these class are named the same in django.forms and django.db.models. When you type models.CharField, you

Re: selectively requiring login

2016-08-01 Thread ludovic coues
You could use an alternative way to login the user, transparent to the user. Like giving a token to the app when it login. 2016-08-01 18:17 GMT+02:00 Larry Martell : > I have a view that is accessed both from the browser and from a > non-browser app. The request from the non browser app come from

Re: selectively requiring login

2016-08-01 Thread ludovic coues
The session cookie ? Or you could use another decorator or a middle-ware doing authentication based on the ip and some information passed as get argument. Like a token returned by django when you auth the user. The request hit the new decorator, the decorator notice the user isn't logged in and t

Re: django 1.9, migrations SUCK

2016-08-03 Thread ludovic coues
Or, you could read either this thread or the doc and take advantage of the django taking care of you. Quoting the doc: "If the [choice] argument is a callable, it is evaluated each time the field’s form is initialized." That's why I suggested to add "lambda: " before the list comprehension. To turn

Re: redirect NoReverseMatch Django error

2016-08-05 Thread ludovic coues
Have you added your app to the INSTALLED_APPS setting ? 2016-08-05 10:05 GMT+02:00 Dimitris Tsiktsiris : > Here are my view and urls > app url > app_name = 'profs' > urlpatterns = [ > url(r'^$', views.index, name='index'), > url(r'^contact/', views.contact, name='contact'), > url(r'^ch

Re: Adding custom Template downloaded

2016-08-08 Thread ludovic coues
If you haven't done a django tutorial, I highly recommend doing one. http://tutorial.djangogirls.org/ is really friendly for beginner but you can do the official one at https://docs.djangoproject.com/en/1.10/intro/tutorial01/. if you want more help than that, sharing what you have tried is a good

Re: Django 1.10

2016-08-09 Thread ludovic coues
What you are writing is not valid python syntax. Here is the problematic code: urlpatterns += urlpatterns['matricula.views.Courses', url('^courses$', list_courses, name='courses'), url('^course/(?P\d+)$', view_course, name='course'),

Re: How to create Xlm file in specific folder ?

2016-08-10 Thread ludovic coues
That sound like a python problem. How to open a file and write in it. 2016-08-10 12:46 GMT+02:00 Asad ur Rehman : > I want to create xlm file in django in this path > "etc/freeswitch/sip_profiles/external" . > > Gateway.objects.values_list('name') > > this should be included in file. How can i cre

Re: How to create Xlm file in specific folder ?

2016-08-10 Thread ludovic coues
I'm pretty sure talking about telepathy was rude, outside the django's code of conduct and some excuses would be nice. The question make a lot more sense with an exemple :) I assume Gateway is a django model (I missed that first time, sorry) and you want to fill an xml file. Do you mind to share

Re: Creating a new Project in Django

2016-08-10 Thread ludovic coues
these files should be in the directory learning_log (inner) inside another learning_log (outer) directory. manager.py should be in the outer directory. 2016-08-10 17:40 GMT+02:00 Lov Verma : > In order to create a new project, I'm using this command: > > django-admin.py startproject learning_log

Re: how to integrate django framework in android app ????

2016-08-14 Thread ludovic coues
Could you detail a bit more what you are trying to achieve ? What do you mean by "integrating" ? What step have you tried ? Are you new as in "have never read a single page of the documentation" or new as in "have only done a pair of small test site" ? I have trouble do understand what you are tr

Re: Django 1.10 How to Take form Inputs (ie field one + field two = field three) and auto update before submitting the form.

2016-08-14 Thread ludovic coues
if what you are doing is a quote, you don't need to get the total from the user. I would go one step further, don't get price from the user. Form can be altered. I would do the model like that: class Invoice(models.Model): user = models.ForeignKey(User, models.CASCADE) date =

Re: friends dont let django suck

2016-08-15 Thread ludovic coues
Or it is just you ;) Why don't you use a less baity title and tell us what is your problem. What are you trying to do, what have you tried, what is the result, what does the models look like... Sometimes, all you need is someone new looking at you code. 2016-08-15 11:03 GMT+02:00 Daniele Procida

Re: friends dont let django suck

2016-08-15 Thread ludovic coues
This is the doc you are looking for https://docs.djangoproject.com/en/1.10/ref/csrf/#ajax 2016-08-15 12:42 GMT+02:00 Saeon Tao : > LoL, thank you everyone! please forgive, i was just having a moment with > django... you understand, im a real makebelieve hotshot when it comes to > php, but now with

Re: Migrations for forms fields

2016-08-16 Thread ludovic coues
forms.Form are python class representing an HTML form. You use them to ask data to your user. Nothing more. models.Model are python class representing an entry in your database. You create them in python, always. Sometimes, you use a form by itself. For exemple, a login form will ask data, search

Re: Implementing django auth system with relational models

2016-08-17 Thread ludovic coues
Do you have any error with the code you posted ? It look like you already have a foreign key to your user. 2016-08-17 15:33 GMT+02:00 Shamaila Moazzam : > Hi, > > I am a beginner and please forgive me if my question is not up to the > standard. I've got two models one is Product which is saved in

Re: Implementing django auth system with relational models

2016-08-17 Thread ludovic coues
Could you share your admin.py file ? You might be interested into this part of the documentation: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_foreignkey 2016-08-17 17:20 GMT+02:00 Shamaila Moazzam : > @Ludovic there is no error. Just I d

Re: Implementing django auth system with relational models

2016-08-17 Thread ludovic coues
.register(ProductImage) > > > admin.site.register(Category) > > > admin.site.register(ProductFeatured) > > admin.site.register(color_product) > > admin.site.register(size_product) > > On Wednesday, August 17, 2016

Re: Implementing django auth system with relational models

2016-08-18 Thread ludovic coues
r this? > > Just curious. > > Regards, > Mudassar > > > > > > > On Wed, Aug 17, 2016 at 2:37 PM, ludovic coues wrote: >> >> Ok, sorry, I made a off by one error on the link :) >> >> Try that: >> >> # shops/admin.py >> from djan

Re: Using hashids in django template

2016-08-18 Thread ludovic coues
You might be looking for this https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/ 2016-08-18 12:57 GMT+02:00 Paul Aswa : > Is there means of encoding an id using hashids in django templates? > > -- > You received this message because you are subscribed to the Google Groups > "Django

Re: manage or manage.py

2016-08-18 Thread ludovic coues
Who did you created this ? Have you run `django-admin startproject mysite` ? 2016-08-18 10:41 GMT+02:00 Ziggo mail : > Hi There > > I’m busy with starting with django. > > My first mysite shows me this: > > mysite/ > > manage > > mysite/ > > __pycache__ > > __init__ > >

Re: Using hashids in django template

2016-08-18 Thread ludovic coues
template. The doc have more information on the subject. 2016-08-18 19:37 GMT+02:00 Paul Aswa : > Being a newbie to python and django, this seems to be giving me problems > > On Thursday, August 18, 2016 at 2:57:56 PM UTC+3, ludovic coues wrote: >> >> You might be look

Re: How to have Multiple models in Admin View

2016-08-18 Thread ludovic coues
You should add a foreign key to language on translation. To save the language from the dropbox. Then I would create a ModelAdmin and set the form value. If I remember correctly, the save method is on the form and you could save new objet for each word at the same time as saving the translation obj

Re: Odd problem: some database updates do not appear on other pages until server restart

2016-08-19 Thread ludovic coues
You were calling the method in the class definition. The class is "defined" when the module is imported. That's why things where "cached". Module is imported only once. The init method on the other hand is called every time an instance of the class is created. I believe that method will be called i

Re: How can I capture two slugs in one URL pattern?

2016-08-21 Thread ludovic coues
You need to check somewhere that the category exist and that your item belong to the category. The get object method seems like a good place to do it. Something like that should do the trick def get_object(self, queryset=None): """ Return a 404 code if * no link with given

Re: beginner . problem simple form.

2016-08-21 Thread ludovic coues
Do you have any message in the console where you run "python manage.py runserver" ? 2016-08-21 12:16 GMT+02:00 Jordi Fernandez : > hi, > > I have my firts application django it's fine. . But! I have a problem with a > simple form. I think this is a problem the my experience of all entorn ( > htm

  1   2   3   4   >