Re: While going through django tutorial i found some errors when i tried to execute the python manage.py runserver.The error is attached below:

2018-05-06 Thread 'Anthony Flury' via Django users
It is ForeignKey (capital K). In your files you sent you missed the one file it was actually complaining about : On 06/05/18 18:09, Avitab Ayan Sarmah wrote: index.html: {% if latest_question_list %}     {% for question in latest_question_list %}     {{ question.question_text }}   {%

Re: Username same as user id

2018-05-06 Thread 'Anthony Flury' via Django users
I can't imagine having an application where username is optional ... On 06/05/18 17:48, lakshitha kumara wrote: hi anthony Thank you for reply on this site username field not required field for user  but its set as required field on backend so i need assing user id as as username if username

Re: Username same as user id

2018-05-07 Thread 'Anthony Flury' via Django users
Yes - but that is very different from what you are asking - Facebook have a two stage form - first set the details - and then set the user name. Their user name isn't optional - it is always mandatory - it is just set at stage two. You can assign any value to any variable you wish - this

Re: Username same as user id

2018-05-07 Thread 'Anthony Flury' via Django users
Of course there is : on the view which responds to your registration form (likely to be where you call authenticate) - you simply test if the username field has been set when the registration is posted - and if not set it to be whatever you want. Or - in your custom backend you can do the

Re: I canot upload files how can i fix it

2018-05-14 Thread 'Anthony Flury' via Django users
What does the form contain ? Does the web page you get give you an upload button ? Does the code in the view get triggered ? Do you get any errors ? On 13/05/18 04:23, carlos.davalo...@tectijuana.edu.mx wrote:  views def ArticuloFormA(request,Materiaid):     Articulos =

Re: Unit testing models.py

2018-05-14 Thread 'Anthony Flury' via Django users
I would agree with that - test any custom functionality - * Custom methods (including __str__ and __repr__) * custom managers * Triggers (that maybe save custom fields on update) * validations - testing to ensure that the right validation is performed on that field - i.e. you linked the

Re: sphinx is showing the django base views instead of my own views.py

2018-05-05 Thread 'Anthony Flury' via Django users
Can you be clear what you are trying to do ? Did you want your Sphinx Page to display an alternative Django documentation - i.e. a module reference for Django ? Or did you want your Sphinx Page to document your app  - if so the issue is that your rst just calls for the views module - and

Re: I got error when working on "Writing your first Django app, part 5" of tutorial

2018-05-05 Thread 'Anthony Flury' via Django users
ROOT_URLCONF ideally point to the top level project urls.py if you have one - if you point it to an app's urls.py - you have to them make sure you link that app back to all the other (which sort of defeats the point of the app) - and make sure that something you refers forward to the admin

Re: getting error while reloading the url"http://localhost:8000/polls/".The error is given below.Please tell my why i am seeing this error?

2018-05-22 Thread 'Anthony Flury' via Django users
In your MySite\urls.py : urlpatterns = [ path('', include('polls.urls')), path('admin/', admin.site.urls), ] should be urlpatterns = [ path('polls', include('polls.urls')), path('admin/', admin.site.urls), ] Django doesn't assume that the url should be /polls - just

Re:

2018-05-23 Thread 'Anthony Flury' via Django users
Does the file actually exist - it should be in : *my_site/polls/templates/polls/* https://docs.djangoproject.com/en/2.0/intro/tutorial03/#write-views-that-actually-do-something     Assuming you haven't changed the TEMPLATES settings in some way. -- -- Anthony Flury email :

Re: Temporal table in Django 1.6

2018-05-24 Thread 'Anthony Flury' via Django users
Although Django doesn't support the Temporal tables directly - it gives you all the tools you need to create one. And there are some installable extensions :     django-temporal-models : https://github.com/TyumenGortrans/django-temporal-models     You should be able to install it by        

Re: Reusable Code like Helper OR Component.

2018-06-12 Thread 'Anthony Flury' via Django users
Reusable components are exactly what separate apps are for; Give your resuable code a nice API - whether it adds new field types, new models, new templates etc, and then put that all in an app. Writing an entirely reusable app takes a lot of skill and thought in my experience; extra fields,

Re: saving django session data for anonymous user

2018-06-12 Thread 'Anthony Flury' via Django users
The only way I can think of is when your user goes to log in - check if their session id is already recorded. When they login - I assume that they get an new Session Id - and remap the data from their old session id to their new session Id. Would that work ? On 12/06/18 11:01, Siddharth

Re: what does the below mentioned error means and how do i resolve this error.something is wrong with my admin.py file.Please comment:

2018-06-08 Thread 'Anthony Flury' via Django users
The errors are relatively obvious to be frank - see the responses below ... On 08/06/18 14:56, Avitab Ayan Sarmah wrote: Can you tell me what is wrong in my admin.py file because from exception it seems that list_display() is having something wrong which I am not able to find out On Fri 8

Re: saving django session data for anonymous user

2018-06-15 Thread 'Anthony Flury' via Django users
How are you authenticating them ? Assuming you call :         authenicate( username, password) then before that call - store the sesssion key after that call - identify the new session key with the old and new session keys - now update the database - so that the cart gets associated with

Re: Is there a WYSIWYG app I can use for an inherited Django created website?

2018-05-26 Thread 'Anthony Flury' via Django users
Basically no. While there might be a WYSIWYG editor for the templates (which are basically HTML, JS and CSS with an embedded python like script) they will only edit the html within the template file and you won’t see the auto generated html for the individual Django fields, or the other

Re: Error while doing django tutorial part 2

2018-05-27 Thread 'Anthony Flury' via Django users
What is the code for your Choice model. The error message clearly states that the Choice model is the one with the problem. -- Anthony Flury email : anthony.fl...@btinternet.com Twitter : @TonyFlury > On 26 May 2018, at 18:47, Kranthi Kiran <1991.kran...@gmail.com> wrote: > > Text of error

Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread 'Anthony Flury' via Django users
On 04/06/18 12:01, Gerald Brown wrote: On Monday, June 4, 2018 at 6:58:39 PM UTC+8, Gerald Brown wrote: I have been using ./manage.py shell for awhile and now all of a sudden it has stopped working with the error "AttributeError: 'property' object has no attribute '__dict__'".  I

Re: Updating django database

2018-06-02 Thread 'Anthony Flury' via Django users
Is this a new or a update from the front end ? If new : 1 Extract json using : data = json.load( request.POST['json'] - this converts data to a dictionary (assuming that the json is in the 'json' field in the message. 2 Validate as necessary 3 Create instance : instance =

Re: Updating django database

2018-06-02 Thread 'Anthony Flury' via Django users
Is this a new or a update from the front end ? If new : 1 Extract json using : data = json.load( request.POST['json'] - this converts data to a dictionary (assuming that the json is in the 'json' field in the message. 2 Validate as necessary 3 Create instance : instance =

Re: Generating server-side off-line HTML of Django pages ...

2018-06-06 Thread 'Anthony Flury' via Django users
Does the test client execute javascript as well ? I can't remember. On 05/06/18 00:14, Bernd Wechner wrote: Thanks Melvyn, looks exactly like what I wanted! Will investigate. I had a feeling this could not be a novel or unique use case. Regards, Bernd. On Monday, 4 June 2018 20:09:25

Fwd: Re: relation “” does not exist in django for app name with mixed-case

2018-06-06 Thread 'Anthony Flury' via Django users
Forwarded Message Subject: Re: relation “” does not exist in django for app name with mixed-case Date: Wed, 6 Jun 2018 17:22:13 +0100 From: Anthony Flury To: Majid Hojati The problem isn't the name of the model. I doubt Django is going to have an issue with

Re: is this my correct results.html and detail.html code?i am only a beginer, please check

2018-06-06 Thread 'Anthony Flury' via Django users
I can't see anything necessarily wrong in terms of most browsers but it isn't strictly compliant with the HTML standards. To be strict HTML, your html files should be including *html* and *body* tags as a minimum. The *html* tag starts and end the html file - in theory browsers are entitled

Re: simple django application since im a beginner I'm unable to doit..

2018-06-27 Thread 'Anthony Flury' via Django users
On 25/06/18 15:57, mr.sathee...@gmail.com wrote: I want to know the IP is malicious or not by simple web application since I'm a beginner I unable to do it. help me Define malicious ? You would need to look  at how it is normally defined (normally companies use blacklists of IP address ranges -

Re: OperationalError

2018-05-02 Thread 'Anthony Flury' via Django users
At first glance it looks like you haven't applied a migration to this computer. at the command line on this computer  - in the man project directory : If you have not copied the migration scripts from your development machine do this first : $ python manage.py makemigrations and then do

Re: Need help: django-admin.py startproject [projectname] creates directory which I cannot access

2018-05-02 Thread 'Anthony Flury' via Django users
Lets troubleshoot: * Does the directory show up when you do a *dir* command in projectdir ? * Can you do anything on the *mysite* directory - can you rename it, or even delete it ? * Can you see it in File explorer * Can you manually create a directory in your *projectdir* ? * Can you

Re: Need help: django-admin.py startproject [projectname] creates directory which I cannot access

2018-05-03 Thread 'Anthony Flury' via Django users
On 03/05/18 06:59, Daisy wrote: Thank you very much for your reply, and here I my answers:   * Does the directory show up when you do a *dir* command in projectdir ? It does not show up, although it says that there are 2 directories (see attachment). Those two directories '.' & '..' are

Re: Crazy Idea: OOP for "Hyperlink"

2018-04-30 Thread 'Anthony Flury' via Django users
What is wrong with a special type of Field - which is a URL, but also have augmented data items which are stored on the model? As far as I know - there is no rule that states that each 'Field' on a model has to have one and only one field in the database. Even if you have one and only one

Re: Need help: django-admin.py startproject [projectname] creates directory which I cannot access

2018-05-03 Thread 'Anthony Flury' via Django users
On 03/05/18 08:06, Anthony Flury wrote: On Thursday, 03 May, 2018 03:25 PM, Daisy wrote: I tried what you suggested and got this: D:\projectdir>python create_dir.py Traceback (most recent call last):   File "create_dir.py", line 1, in     from os import mkdirs

Re: OperationalError

2018-05-03 Thread 'Anthony Flury' via Django users
Django 2.0 docs suggest using reportlab : https://docs.djangoproject.com/en/2.0/howto/outputting-pdf/ I had some success with : pupeteer - http://django-puppeteer-pdf.readthedocs.io/en/latest/ - which works by having a CBV type framework - so you subclass a PDF template view - and that will

Re: Need help: django-admin.py startproject [projectname] creates directory which I cannot access

2018-05-03 Thread 'Anthony Flury' via Django users
Serves me right for writing code without testing :-( It of course should be :             import os             top_dir = os.path.join(os.getcwd(), 'python_created_me')             os.makedirs(top_dir) Glad you have it sorted - and glad it turned out not to be Django ... On 03/05/18 17:06,

Re: Working through the Django tutorial and have run into a problem I cannot figure out. Help would be appreciated. What am I missing here? whenever is search the url "http://127.0.0.1:8000/polls/" th

2018-05-03 Thread 'Anthony Flury' via Django users
I think the root cause of the errors was due to an incorrect settings - but Fidel is right that your views.py wasn't great either. On 03/05/18 17:36, Avitab Ayan Sarmah wrote: thank you Fidel, and i will take care of it On Thu, May 3, 2018 at 9:57 PM, Fidel Leon

Re: Django--Making query use part of the matching name

2018-04-28 Thread 'Anthony Flury' via Django users
What are the rules - you say that a query string of '10FTK' should match '10FTH86RSK', but also '10FTK', '10F6TK', '10FTK4' I think the problem is that the rules aren't 100% clear. * For '10FTK' to match '10FTH' you actually only care about the first 4 characters ? * For '10FTK' to

Re: App structure : "One file - One object" - Is there a better way ?

2018-07-14 Thread 'Anthony Flury' via Django users
On 14/07/18 15:59, Mickael Barbo wrote: Hi Anthony  Michael Thanks for sharing your experience. "1 file one object doesn't mean what you think it means." I hope you get the meaning I described  I understand what you mean - I just don't agree with your analysis of one file one object

Re: App structure : "One file - One object" - Is there a better way ?

2018-07-14 Thread 'Anthony Flury' via Django users
On 14/07/18 15:59, Mickael Barbo wrote: Hi Anthony  Michael Thanks for sharing your experience. "1 file one object doesn't mean what you think it means." I hope you get the meaning I described  I understand what you mean - I just don't agree with your analysis of one file one object

Re: Beginner

2018-07-14 Thread 'Anthony Flury' via Django users
collections with the python developers. Documentation of the existing feature sets would be useful too. On Thu, Jul 12, 2018, 11:41 AM Harsh Rawat <mailto:harsh.rawa...@gmail.com>> wrote: Thanks a lot . On Thu, Jul 12, 2018, 3:11 AM 'Anthony Flury' via Django users mail

Re: Beginner

2018-07-11 Thread 'Anthony Flury' via Django users
On 10/07/18 14:06, Harsh Rawat wrote: Identifying a useful name means ? Well - say you have a set of packages which is useful as a Django friendly shopping cart. Would it be better to type :             pip install Django[shopping-cart] or             pip install Django[frooble] Clearly

Re: Beginner

2018-07-11 Thread 'Anthony Flury' via Django users
On 10/07/18 14:06, Harsh Rawat wrote: Identifying a useful name means ? Let's say you have identified a great group of packages which you can install and provides Django friendly Shopping cart. It would be better for that group of packages to be installed by :         pip install

Re: How start django server automatically using pytest-django

2018-07-11 Thread 'Anthony Flury' via Django users
On 07/07/18 13:16, prakash sharma wrote: RE:'do you want to test on development server' NO, Drone is running the test cases.I don't want to run the runserver command. But why do you need the server running - the Django Test client is able to test views and responses without having to have

Re: help

2018-07-09 Thread 'Anthony Flury' via Django users
On 05/07/18 12:49, Umar Kambala wrote: Please am sorry am new to django, I don't really understood what u mean I know that Tim has helped you in this occassion but  you really do need to  know how to find your way around a computer the commands 'ls' and 'cd ..' are nothing to do with

Re: help

2018-07-09 Thread 'Anthony Flury' via Django users
On 06/07/18 13:43, Umar Kambala wrote:   File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 347, in execute YOU need to add an on_delete argument to every ForeignKey definition - such as the one in line 13. Learning to

Re: Verify Emails

2018-04-07 Thread 'Anthony Flury' via Django users
why not use an email validator provided by Django ? https://docs.djangoproject.com/en/2.0/ref/validators/#emailvalidator The problem with the pypi module is that to validate that an email exists it simply looks for server in DNS (which is slightly better than the Django validator), but that

Re: ARGPARSE ERROR

2018-04-18 Thread 'Anthony Flury' via Django users
Are you using virtual environments ? I found an issues where it seemed like part of the standard library was missing - and it was due to my virtual environment having an old version of the Python 2 binary. Some time in the Python 2.7 lifecycle, there was a change as to how the standard

Re: Crazy Idea: OOP for "Hyperlink"

2018-04-25 Thread 'Anthony Flury' via Django users
Interestingly, I am thinking on something similar too - having a report/notifications/actions view that have an auto generated URL. The idea (on my concept) is that by getting this unique URL via email, a user can access the report/action without needing to actually login - the fact that a

Re: tutorial01 is not working

2018-04-24 Thread 'Anthony Flury' via Django users
The debug suggest that it only tried to match the admin pattern but nothing else, that sugggests to me that you missed this bit in the mysite/urls.py from django.contrib import admin from django.urls import include, path urlpatterns = [     path('polls/', include('polls.urls')),

Re: Beginner

2018-06-28 Thread 'Anthony Flury' via Django users
On 27/06/18 21:23, Harsh Rawat wrote: I have learnt Django a little bit. I need help regarding the ticket https://code.djangoproject.com/ticket/28905 .What should I learn in Django to be able to contribute via this ticket. It looks like this doesn't actually require any knowledge of Django