Re: table bank_app_bank has no column named DOB

2023-08-19 Thread Joe Reitman
You can not use all caps as a field name. Some other restrictions are: - A field name cannot be a Python reserved word. - A field name cannot contain more than one underscore in a row. - A field name cannot start with an underscore. On Friday, August 18, 2023 at 2:05:57 PM UTC-5 meenu

Re: President of India: Save Nallamala Forest from Uranium Mining @rashtrapatibhvn @TelanganaCMO

2019-09-15 Thread Joe Reitman
I flagged this as spam. This is a Django forum. On Friday, September 13, 2019 at 11:11:10 PM UTC-5, pardhu.s...@gmail.com wrote: > > Hey, > > I just signed the petition "President of India: Save Nallamala Forest from > Uranium Mining @rashtrapatibhvn @TelanganaCMO" and wanted to see if you >

Re: How to change the label for username to 'username/email' in login page in Django

2019-08-30 Thread Joe Reitman
You can use a label or help text. https://docs.djangoproject.com/en/2.2/ref/forms/fields/#label https://docs.djangoproject.com/en/2.2/ref/forms/fields/#help-text On Friday, August 30, 2019 at 12:28:47 PM UTC-5, Sandip Nath wrote: > > I am building a car rental website with Django. Currently

Re: I think I've found a bug in the Dev server

2019-08-02 Thread Joe Reitman
Anyway. If you think there is a bug, you should visit the Django github community and raise the issue there. On Thursday, August 1, 2019 at 10:00:29 AM UTC-7, Isaac Way wrote: > > If I send a request to an invalid URL, the NEXT request sent to that URL > is processed incorrectly by Django. I've

Re: I think I've found a bug in the Dev server

2019-08-02 Thread Joe Reitman
Have you tested it with a production server? The dev server is for testing not suitable for production. On Thursday, August 1, 2019 at 10:00:29 AM UTC-7, Isaac Way wrote: > > If I send a request to an invalid URL, the NEXT request sent to that URL > is processed incorrectly by Django. I've

Re: SQLite 3.8.3 or later is required (found 3.7.17).

2019-07-20 Thread Joe Reitman
I had the same problem. To fix it I used Python 3.6 and Django 2.1. On Friday, July 19, 2019 at 7:37:06 AM UTC-5, Anchal Agarwal wrote: > > Hello Django users, > i am trying to deploy my django on AWS > I am following this >

Re: how to see the list of created tables in sqlite

2019-07-18 Thread Joe Reitman
A good way to view your tables is to use https://sqlitebrowser.org/ On Thursday, July 18, 2019 at 8:28:31 AM UTC-5, yasar arafath Kajamydeen wrote: > > Hi all, > > After executing the command - python manage.py migrate > the command is successful and then i would like to see the list of

Re: python manage.py runserver error

2019-07-13 Thread Joe Reitman
ModuleNotFoundError: No module named 'hello_world' This is a big clue. On Saturday, July 13, 2019 at 6:35:31 AM UTC-5, Jack Bergemann wrote: > > (venv) C:\Users\Chas\rp-portfolio\personal_portfolio>python manage.py > runserver > Watching for file changes with StatReloader > Exception in thread

Re: Followed 'Writing custom django-admin commands' - 'Apps aren't loaded yet.'!

2019-07-13 Thread Joe Reitman
Try following this tutorial: https://simpleisbetterthancomplex.com/tutorial/2018/08/27/how-to-create-custom-django-management-commands.html It looks like you don't have apps registered in INSTALLED APPS. Also, I always use the 'python manage.py ' not the 'django-admin ' On Thursday, July 11,

Re: DeprecationWarning in Django 1.11.22 with Python 3.7

2019-07-08 Thread Joe Reitman
Looks like a bug in pyparsing.py https://github.com/pyparsing/pyparsing/pull/16 On Monday, July 8, 2019 at 1:09:16 PM UTC-5, Uri Even-Chen wrote: > > Hi, > > I tested Django 1.11.22 (or any version from 1.11.17 to 1.11.22) with > Python 3.7, and found out that when running tests with

Re: Django Interview Questions

2019-07-08 Thread Joe Reitman
Error 522 Ray ID: 4f324c909f05d29a • 2019-07-08 13:11:05 UTCConnection timed out On Monday, November 2, 2009 at 9:36:41 AM UTC-6, Dimitri Gnidash wrote: > > Hey guys, > > For all those of you interviewing or being interviewed, I created a > quick list of sample interview questions. > While not

Re: How to convert files from .bin to .png with Python or Django

2019-07-05 Thread Joe Reitman
Try using the Pillow library. On Wednesday, July 3, 2019 at 6:52:35 PM UTC-5, Fernando Garrido Villalobos wrote: > > How to create a function that have like argument the path of a .bin file > and returns a .png file ... > I need your help, > thank you so much. > -- You received this message

Re: Connecting to SQL Server

2019-07-05 Thread Joe Reitman
When does this error occur? During runserver or when executing a commit from your model? On Thursday, July 4, 2019 at 11:48:40 AM UTC-5, John Burke wrote: > > For this particular instance, I don't need the port number. > > On Thu, Jul 4, 2019 at 11:47 AM Joe Reitman > wrote: >

Re: help

2019-07-04 Thread Joe Reitman
I would suggest not using locals(). You only have three variables to pass through to your template. On Wednesday, July 3, 2019 at 6:26:22 PM UTC-5, Tosin Ayoola wrote: > > Good day guyz > sorry i'm working on a django e-commerce project which i am new to, and > i'm stuck, i wan have a page

Re: Deploying a static website

2019-07-04 Thread Joe Reitman
Just to clarify static vs dynamic There are basically two main types of *website* - *static* and *dynamic*. A *static site* is one that is usually written in plain HTML and what is in the code of the page is what is displayed to the user. A *dynamic site* is one that is written using a

Re: Connecting to SQL Server

2019-07-04 Thread Joe Reitman
Don't you need to assign a port number? On Wednesday, July 3, 2019 at 6:52:35 PM UTC-5, John Burke wrote: > > Trying to connect to SQL Server from Django > > DATABASES = { > 'default': { > 'ENGINE': 'sql_server.pyodbc', > 'NAME': 'dbname', > 'HOST': 'hostname', >

Re: login page not working

2019-07-03 Thread Joe Reitman
Try debugging your view with a print statement. Print the username and password to see if those values are getting passed in. On Wednesday, July 3, 2019 at 6:02:52 AM UTC-5, KUMBHAGIRI SIVAKRISHNA wrote: > > I entered username and password ,and click submit ,then it directs same > login page

Re: Polls app not showing?

2019-07-02 Thread Joe Reitman
like I'm missing > something really simple here. > > On Sunday, June 30, 2019 at 11:06:54 PM UTC-4, Joe Reitman wrote: >> >> What does your project directory look like? >> >> >> >> On Sunday, June 30, 2019 at 8:29:02 PM UTC-5, Scott Winter wrote: >>&g

Re: order of loading css-files

2019-07-02 Thread Joe Reitman
You have a 404 error meaning the browser can not find the file on the server. The 304 error code means the file is already loaded in the browser and is the same as the file on the server so it won't be modified. On Tuesday, July 2, 2019 at 7:14:38 AM UTC-5, bengoshi wrote: > > Hi: > > I tried

Re: django form not saving items to database

2019-07-01 Thread Joe Reitman
Try this: def sell(request): if request.method == 'POST': form = ProductsForm(request.POST) if form.is_valid(): print('form is valid') form.save() return redirect('home') else: form = ProductsForm()

Re: Polls app not showing?

2019-06-30 Thread Joe Reitman
What does your project directory look like? On Sunday, June 30, 2019 at 8:29:02 PM UTC-5, Scott Winter wrote: > > Sorry, you'll have to be clearer than that. Not sure how to do that nor > how it relates to the issue > > On Friday, June 28, 2019 at 12:28:33 AM UTC-4, karthikvignesh28 wrote: >>

Re: Nested dictionaries

2019-06-30 Thread Joe Reitman
I use the JSON module to encode and decode JSON. On Sunday, June 30, 2019 at 9:26:04 AM UTC-5, David Elphee wrote: > > I guess I don’t even need Django or models to do what I described. But > yes, for future functionality, I’d like to be able to store JSON to a > database. > -- You

Re: deploy django on AWS

2019-06-30 Thread Joe Reitman
https://www.zappa.io/ It's not easy to configure but it does work well when up and running. On Sunday, June 30, 2019 at 11:37:20 AM UTC-5, Harshit wrote: > > Hello Django users, > I want to host my django website on aws, This is first time that i am > hosting a website. Can u suggest any good

Re: deploy django on AWS

2019-06-30 Thread Joe Reitman
https://www.zappa.io/ On Sunday, June 30, 2019 at 11:37:20 AM UTC-5, Harshit wrote: > > Hello Django users, > I want to host my django website on aws, This is first time that i am > hosting a website. Can u suggest any good resource from which i can learn? > > Thank you > -- You received this

Re: Nested dictionaries

2019-06-30 Thread Joe Reitman
You want to save JSON data to a database? On Saturday, June 29, 2019 at 8:47:38 PM UTC-5, David Elphee wrote: > > Hello, > I am new at django and in over my head I think. I am trying to create a > kind of shim that will accept JSON from a webhook POST, work with the data > using Python, and

Re: Help

2019-06-30 Thread Joe Reitman
? On Sunday, June 30, 2019 at 7:54:43 AM UTC-5, pramod wrote: > > I wrote a js for that wer it display the results of addition > automatically through id > If I use like this {{form. Full}} How do I pass the Id to the js? > > On Jun 30, 2019 6:19 PM, "Joe Reitman&quo

Re: Help

2019-06-30 Thread Joe Reitman
Don't use an 'input' element to display your form field. Try something like this: {{ form.date }} On Sunday, June 30, 2019 at 7:35:42 AM UTC-5, pramod wrote: > > The give to get the input from the user in table? > -- You received this message because you are subscribed to the Google

Re: .model class not added in localhost:8000/admin

2019-06-29 Thread Joe Reitman
In your Destination class you have to return a string representation of the fields you to display in Admin. https://docs.djangoproject.com/en/2.2/ref/models/instances/#other-model-instance-methods On Saturday, June 29, 2019 at 7:36:17 AM UTC-5, KUMBHAGIRI SIVAKRISHNA wrote: > > 'Destination'

Re: what's a good approach for building a product model in a django multi-vendor eCommerce system?

2019-06-29 Thread Joe Reitman
You can use Choices - https://docs.djangoproject.com/en/2.2/ref/models/fields/#choices On Saturday, June 29, 2019 at 3:17:04 AM UTC-5, Arya wrote: > > as you know eCommerce websites consist of various types of products and > attributes. > there are digital products as well as physical products.

Re: need help - following django tutorial to create polls database - missing "on delete cascade" - using django 2.2.1 with mysql 8.0

2019-06-28 Thread Joe Reitman
The notes say: - The exact output will vary depending on the database you are using. The example above is generated for* PostgreSQL.* Are you using the default SQLite? You could try running migrate and then checking the tables to see if the constraint was added using a DB admin viewer.

Re: Error when displaying videos on iOS and Safari, but fine in Chrome

2019-06-28 Thread Joe Reitman
What is the format of the video? iOS and Safari won't play back WebM. On Thursday, June 27, 2019 at 9:16:35 PM UTC-5, Walker Obrien wrote: > > I have a social media application in the early stages of deployment, and > when videos are uploaded they are getting displayed perfectly fine when >

Re: Polls app not showing?

2019-06-27 Thread Joe Reitman
Did you create a project first with the 'startproject' command? On Wednesday, June 26, 2019 at 9:34:39 PM UTC-5, ScottW wrote: > > Hi, > > I'm attempting to get started with Django and very first part of the polls > app. When I type "python manage.py startapp polls" into the Windows >

Re: Website advice/ Django packages

2019-06-27 Thread Joe Reitman
probably not. I would assume the store price info, etc in a database On Thursday, June 27, 2019 at 7:10:07 AM UTC-5, Django Dojo wrote: > > I’m looking to develop similar to: > https://www.northwestregisteredagent.com but I’m confused on how the > prices change for each state. Is there a

Re: How to connect Django with Hbase

2019-06-27 Thread Joe Reitman
Django only supports a few relational databases out of the box. Oracle, mysql, postgres and sqlite. There may be some 3rd party packages out there via google search. The other option is to write your own db backend. On Wednesday, June 26, 2019 at 9:59:46 AM UTC-5, Varun Kumar wrote: > >

Re: [novice question] Render a list of objects

2019-06-22 Thread Joe Reitman
The example code you provided will create a on the first iteration of the loop and tag every 4th iteration of the loop. This cycle will continue resulting in a table with 4 columns of data. Example: results = [ 1, 2, 3, 4, 5, 6, 7, 8 ] 1 2 3 4 5 6 7

Re: my file uploads missing/deleted

2019-06-15 Thread Joe Reitman
'goal_for', 'goal_against', 'goal_diff'] > logo = AdminThumbnail(image_field='image') > readonly_fields = ('total_points', 'goal_diff',) > > admin.site.register(Club, ClubAdmin) > admin.site.register(Match) > thanks joe > > On Friday, June 14, 2019 at 12:31:31 PM UTC+2, Joe Reitman

Re: Create View not saving form data to database

2019-06-14 Thread Joe Reitman
Your passing strings as the first argument in your many-to-many fields. Shouldn't they be classes? Doc On Thursday, June 13, 2019 at 8:31:29 PM UTC-5, curtly critchlow wrote: > > CreateView class not saving data to

Re: my file uploads missing/deleted

2019-06-14 Thread Joe Reitman
te access token ?? > DROPBOX_ROOT_PATH = your root path to store media > did you mean link to Dropbox app folder ? > thanks > On Thursday, June 13, 2019 at 6:15:02 PM UTC+2, Joe Reitman wrote: >> >> Omar, >> >> You should not be configuring views for Dropbox. DJANG

Re: my file uploads missing/deleted

2019-06-13 Thread Joe Reitman
Omar, You should not be configuring views for Dropbox. DJANGO-STORAGES does all the back end coding for you. Follow these steps from DJANGO-STORAGES documentation after removing the code changes you made to views. I'm assuming your using pip. 1. pip install django-storages 2. pip install

Re: my file uploads missing/deleted

2019-06-12 Thread Joe Reitman
Omar, To upload images from the Admin panel, you will have to configure your apps' admin.py file. I use the django-imagekit package to manipulate user uploaded images. This package also provides the ability to upload images via the Admin panel with a couple lines of code. Here is my Admin.py

Re: my file uploads missing/deleted

2019-06-11 Thread Joe Reitman
ral ( that's mean image clubs appear and > after one hour it disappear ) > i want to use something like Dropbox (permenant) but i don't know how to > make it my media folder > > > On Monday, June 10, 2019 at 10:57:23 AM UTC+2, Joe Reitman wrote: >> >> A couple

Re: my file uploads missing/deleted

2019-06-10 Thread Joe Reitman
utes disappear > i don't mean files uploaded by the users ( but by me in admin dashboard) > > On Sunday, June 9, 2019 at 11:16:19 PM UTC+2, Joe Reitman wrote: >> >> Omar, >> >> Looking at your original request I misunderstood what you wanted to do. I >>

Re: my file uploads missing/deleted

2019-06-09 Thread Joe Reitman
are good for testing and development. On Sunday, June 9, 2019 at 9:07:01 AM UTC-5, omar ahmed wrote: > > i installed Dropbox for django environment > but how to link an account and adjust settings > tutorial is not clear > thanks > > On Saturday, June 8, 2019 at 8:23:08 PM UTC

Re: my file uploads missing/deleted

2019-06-08 Thread Joe Reitman
9 at 2:59:20 AM UTC+2, Joe Reitman wrote: >> >> Omar, >> >> I use Dropbox which is free up to 2GB. I installed django-storages >> library to make setting up Dropbox easy. >> >> On Friday, June 7, 2019 at 6:32:21 PM UTC-5, omar ahmed wrote: >>>

Re: my file uploads missing/deleted

2019-06-07 Thread Joe Reitman
Omar, I use Dropbox which is free up to 2GB. I installed django-storages library to make setting up Dropbox easy. On Friday, June 7, 2019 at 6:32:21 PM UTC-5, omar ahmed wrote: > > hii .. > i deployed my first django app on Heroku https://arena3.herokuapp.com/ > but my media files ( like club

Re: Form with CheckBoxSelectMultiple not validating

2019-06-07 Thread Joe Reitman
Can you show the code? On Friday, June 7, 2019 at 1:57:23 PM UTC-5, Dube Software wrote: > > I have a form with a CheckBoxSelectMultiple widget. When I select choices > and submit the form, `is_valid()` returns False. What could be the cause? > > Kind regards, > Lloyd > > *Sent with Shift >

Re: DateInput not accepting format argument

2019-06-07 Thread Joe Reitman
Or a better option is to use a third party app such as https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/index.html On Friday, June 7, 2019 at 1:05:04 PM UTC-5, Joe Reitman wrote: > > Try this: > > in settings.py > > USE_L10N = False > > USE_TZ = Tru

Re: DateInput not accepting format argument

2019-06-07 Thread Joe Reitman
Try this: in settings.py USE_L10N = False USE_TZ = True DATE_INPUT_FORMATS = ['%B %d, %Y'] In forms.py start_date = forms.DateField( widget=forms.DateInput(attrs={'placeholder': 'October 24, 2019'}), ) On Friday, June 7, 2019 at 5:36:30 AM UTC-5, Dube Software wrote: > > Hi, > > I

Re: How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-06 Thread Joe Reitman
and code your view to handle it based on the button value. On Thursday, June 6, 2019 at 11:07:18 PM UTC-5, Joe Reitman wrote: > > Interesting problem. It won't display because the form is inside a > for-loop. Django Template language looks at variables inside a for-loop >

Re: How to fix: Django forms: {{ form }} is not working in a dynamic html page

2019-06-06 Thread Joe Reitman
Interesting problem. It won't display because the form is inside a for-loop. Django Template language looks at variables inside a for-loop differently. Basically it looks for a collection. Since {{ form }} is not a collection, it just ignores it. I'm not sure how you can create multiple forms

Re: Import circular

2019-06-06 Thread Joe Reitman
Can you post your views.py, urls.py and template? On Thursday, June 6, 2019 at 9:18:22 AM UTC-5, Fabio O da silva wrote: > > django.core.exceptions.ImproperlyConfigured: The included URLconf > 'simplemooc.urls' does not appear to have any patterns in it. If you see > valid patterns in the file

Re: While registering the user with django form, it gives "UNIQUE constraint failed: auth_user.username" error

2019-06-05 Thread Joe Reitman
ssue and trying to figure it out. > @Jaydeep Did you get to solve the issue somehow? > > Thanks! > > On Saturday, 18 May 2019 04:01:56 UTC+5:30, Joe Reitman wrote: >> >> I'm not sure what your objective is but you don't need to create another >> model to store user data

Re: advantage of angular js with django??

2019-05-31 Thread Joe Reitman
AngularJS is a Single Page App (SPA) framework. You can use Django along with Django Rest API package as the backend to your Angular app. The biggest advantage is you can create, change or have multiple frontend systems on different platforms without having to make changes to your Django

Re: problem with form

2019-05-29 Thread Joe Reitman
Can you post the error? On Tuesday, May 28, 2019 at 6:22:30 PM UTC-5, Saeed Pooladzadeh wrote: > > Hi > > I'm trying to make a simple crud applicatio and learn from it. I wonder > why my form can't save the data. Here cames my view: > > from django.shortcuts import render > from saeed.forms

Re: Template not showing my post details

2019-05-29 Thread Joe Reitman
What does your view look like? On Wednesday, May 29, 2019 at 4:26:55 AM UTC-5, cixtus anyanwu wrote: > > Help me out here. Whats wrong with django? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: URL conf error

2019-05-29 Thread Joe Reitman
The problem is probably with your view or a naming issue. You also have problems pointed out by others with the syntax in your urls. Good luck. On Wednesday, May 29, 2019 at 7:17:23 AM UTC-5, Madhur Kabra wrote: > > Thanks for your answer, I have imported the views correctly, and made the >

Re: URL conf error

2019-05-28 Thread Joe Reitman
What do your views look like? I see you have an app named 'music' in your project URL Config that includes 'music.urls'. Your music app URL Config has a single view that calls the index view. When you type 127.0.0.1/music/ in the browser address bar you should see your index page. Is the index

Re: Display image in template

2019-05-28 Thread Joe Reitman
Have you looked in inspector on your browser to see if the URL is correctly rendered in IMG SRC? Have you installed Pillow? ImageField requires python Pillow. On Tuesday, May 28, 2019 at 1:38:49 PM UTC-5, Anchal Agarwal wrote: > > Thanks for the answer but I have already set the MEDIA path >

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Joe Reitman
Fellipe, Here is an example of decorating class based views from the documentation : from django.contrib.auth.decorators import login_requiredfrom django.utils.decorators import

Re: What's wrong with this model

2019-05-28 Thread Joe Reitman
By default CharField is not Nullable meaning it can't be created with out some data in it. You have two options: Make field nullable: blank=True Or add a default: default=default_text On Monday, May 27, 2019 at 4:52:19 PM UTC-5, Saeed Pooladzadeh wrote: > > Hello > > I made this model and

Re: deploy to Heroku " collectstatic --noinput "

2019-05-27 Thread Joe Reitman
Is there a question here? I will point out what I see wrong in Settings.py. Allowed_hosts is empty. Need the host domain. Missing Port number for your database Did you migrate your models? Secret key should be stored in environment variable On Sunday, May 26, 2019 at 4:34:54 PM UTC-5, omar

Re: Unwelcome error!

2019-05-20 Thread Joe Reitman
You need to run makemigrations and migrate to create the tables django uses. On Monday, May 20, 2019 at 5:22:08 PM UTC-5, Stephen Owen wrote: > > Hi, all, > I am creating a blog in Django, following lectures on You Tube. > Everything was working fine and then an error occurred that I could >

Re: Customising django user model

2019-05-20 Thread Joe Reitman
You can customize the user table by extending AbstractUser and add the fields you want to add (gender, phone) I have a custom user example adding age field: from django.db import models from django.contrib.auth.models import AbstractUser class CustomUser(AbstractUser): age =

Re: Migrations File too Large preventing Migrate

2019-05-20 Thread Joe Reitman
Can you show us the model your trying to migrate? On Sunday, May 19, 2019 at 9:11:47 PM UTC-5, Yoo wrote: > > In Django 2.2, I run makemigrations then migrate. I wait approx. 5-7 > minutes and then I get "Fatal Python error: Cannot recover from stack > overflow." "Current thread 0x0002094 (most

Re: While registering the user with django form, it gives "UNIQUE constraint failed: auth_user.username" error

2019-05-17 Thread Joe Reitman
I'm not sure what your objective is but you don't need to create another model to store user data. User data is stored in the auth.models. It has fields already available for what your trying to accomplish. On Saturday, October 6, 2018 at 8:28:09 AM UTC-5, Jaydeep Borkar wrote: > > When I try

Re: Django Model Forms.

2019-05-17 Thread Joe Reitman
In your template you can identify each field by its name and use a table to render them in columns. e.g. table table row table data {{ form.username }} table data {{ form.password }} On Friday, May 17, 2019 at 2:23:14 AM UTC-5, kimeualexis wrote: > > Hello, guys. > Is there a way to

Re: i am new i want full details of Django

2019-05-16 Thread Joe Reitman
This book really helped me get started. "Django for Beginners: Build websites with Python and Django" by William S. Vincent.

Re: Any open source project for beginner to start with ?

2019-05-16 Thread Joe Reitman
Looks good on mobile. Nice job. On Thursday, May 16, 2019 at 9:00:18 AM UTC-5, himanshu chouhan wrote: > > I've already hosted it on heroku - > http://bit.ly/2VHL3Iu > > On Thu, May 16, 2019 at 6:58 AM Joe Reitman > wrote: > >> Do you have your website

Re: Any open source project for beginner to start with ?

2019-05-15 Thread Joe Reitman
Do you have your website available to see on github? On Wednesday, May 15, 2019 at 3:44:30 PM UTC-5, himanshu chouhan wrote: > > Hi All, > > I know this ppl discuss really important issue here, I'm trying my luck in > django, if anyone could suggest me any open-source project to start with or >

Re: How to reengage pycharm command line to run >'py manage.py migrate'?

2019-05-14 Thread Joe Reitman
Open up another terminal by clicking the '+' sign. On Tuesday, May 14, 2019 at 12:31:32 PM UTC-5, jos.jwj wrote: > > Hello fellow community members, > > I am a fresher working on a project in pycharm on a Lenovo system. > Everything seems to be going as django wold indicate however after running

Re: formfield_overrides doesn't work

2019-05-12 Thread Joe Reitman
Tim, I found this in the Django source code on Github searching for 'formfield_overrides'. It is in a test module testing formfield_overrides functionality. I'm assuming you imported TextInput from forms? This should work to change your *admin* display. Are trying to change your Admin panel

Re: formfield_overrides doesn't work

2019-05-12 Thread Joe Reitman
Tim, Here is an example of a custom form field limiting the input to 100 characters. The model is defined to accept 255 chars. BTW, the text widget 'attrs' sets the HTML form element attributes. class SearchForm(forms.Form): search_for = forms.CharField( label='', label_suffix='',

Re: Static files won't match the path given

2019-05-12 Thread Joe Reitman
Configuring static files can be a headache. I personally use Whitenoise to serve my static files. It is self contained and can be configured in Django settings after installation. A couple of advantages of Whitenoise: 1. During development you can

Re: How to use Django with python-requests to fetch data from google api?

2019-05-10 Thread Joe Reitman
Krystian, I got this work by changing the template tag name variables and removing the if statement. Since 'authors' is a list, you could send the entire list to the template and do a for-loop to render all the authors. def api(request): query = request.GET response =

Re: How to use Django with python-requests to fetch data from google api?

2019-05-09 Thread Joe Reitman
Krystian, To extract the Title and Author from your API call you need: return render(request, 'books/api.html', { 'title': book['volumeInfo']['title'], 'authors': book['volumeInfo']['authors'][0] }) 'authors' is stored in an array(list) so if you want to pass all the

Re: Unit conversions between model field value and form field value

2019-05-07 Thread Joe Reitman
Hi Tim, There is a 'Best Practices' guide for Django that recommends making models fat, https://django-best-practices.readthedocs.io/en/latest/applications.html#models. With that it would be logical to do both conversions in the model. Regards, Joe On Tuesday, May 7, 2019 at 5:24:09 PM

Re: Serving Files with Django

2019-05-05 Thread Joe Reitman
Greetings, Django can do all the file handling internally. You can create a model (database) with a FileField() as Kayode suggested. Using a CreateView class you can allow users to upload files from an input form. The model does not store the actual files. It stores a file path to where the