Disable the admin of "Site"

2024-01-03 Thread 'Thomas Lionel Smets' via Django users
The admin console always displays the admin of "Site" page while this should be hidden for the people on a specific site (they should not be aware of the fact that there are multiple sites) ! When I add the admin.py the following line ``` admin.site.unregister(Site) ``` The (debug) server

Re: htmx progress indicator problem - might be caching

2023-12-01 Thread Thomas Couch
item. That'll allow your initial htmx post to return without being blocked. The htmx endpoint for the progress bar can then check completed count for the task group. On Thursday, November 30, 2023 at 3:42:39 AM UTC Mike Dewhirst wrote: > On 29/11/2023 9:56 pm, Thomas Couch wrote: > >

Re: htmx progress indicator problem - might be caching

2023-11-29 Thread Thomas Couch
Not sure if it's related, but you've got a div inside a p element there: That'll probably get corrected by the browser to: Another thing is, it doesn't look like there's anything linking the submit button click to the initial htmx request, and there's no htmx in the response. Have you

Re: Simple Ajax Search

2023-11-23 Thread Thomas Couch
I think Select2 is a well trodden path for this sort of thing (unless I'm mistaken, it's already available in the admin interface). Have a look at the django-select2 package: https://django-select2.readthedocs.io/en/latest/ On Thursday, November 23, 2023 at 12:36:23 PM UTC lone...@gmail.com

Best practice colour picker

2023-08-25 Thread Thomas Gaylard
I've searched for this but found very little. I'm looking for a good/best practice approach for storing colour information in the database and rendering a colour picker in a form which makes best use of Django's built-in form support. -- You received this message because you are subscribed

Re: Calculations

2023-07-10 Thread Thomas Couch
Ah ok, looks like aggregate always returns a dictionary. This should work: outstanding_balance = loan.amount_to_pay - loan.payments_set.aggregate(paid=Sum("amount"))['paid'] On Monday, July 10, 2023 at 11:03:06 AM UTC+1 Abdou KARAMBIZI wrote: > Hello Thomas > > I h

Re: Calculations

2023-07-07 Thread Thomas Couch
Or, you can combine annotations and expressions to do something like this: qs = LoanInformation.objects.annotate(outstanding=F("amount_to_pay") - Func(F("payments__amount"), function="SUM)) loan = qs.get(id=loan_id) loan.outstanding On Friday, July 7, 2023 at 4:03:09 PM

Re: Calculations

2023-07-07 Thread Thomas Couch
Hi Abdou, have a look at aggregation (https://docs.djangoproject.com/en/4.2/topics/db/aggregation/) In this case I think you'll want something like: ``` from django.db.models import Sum # Where loan = the LoanInformation instance you're interested in outstanding_balance = loan.amount_to_pay -

Django Deployment.

2023-06-24 Thread Thomas Mutavi
Hello team, Please recommend an article or a tutorial on Django deployment on windows server 2016 using either IIS or Apache. If you know the whole process you can also share. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Django date time picker

2023-05-29 Thread Thomas Mutavi
Hello, how can i implement a form with several date fields which have date and time picker in django? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Runtime decision on language support

2023-04-25 Thread Shawn Thomas
Thank you so much for your incredibly thorough response, Emmanuel! That is exactly the kind of insight I was hoping for. Best, Shawn From: django-users@googlegroups.com on behalf of ASAMOAH EMMANUEL Date: Monday, April 24, 2023 at 10:22 PM To: django-users@googlegroups.com Subject: Re:

Runtime decision on language support

2023-04-24 Thread Shawn Thomas
Hi, I've searched online for an answer to this but couldn't find anything. I have a multi-tenant Django app that supports multiple languages, both in code (django.po/django.mo) and for customer data. However, not every customer wants to translate their data into every language we support

Django .values() / SQL table fields wildcards

2023-02-02 Thread Thomas Schmidt
, t2 and t3 are serializable as models in the ORM) Is this possible? So far, I looked at `values` and `values_list` but there doesn't seem to be a documented way to do this. Any help appreciated, I know this group is helpful, -- Thomas -- You received this message because you are subscribed

Re: getting unique id

2022-11-23 Thread Thomas Lockhart
Why not use the existing Django AutoField? - Tom > On Nov 23, 2022, at 8:56 AM, Larry Martell wrote: > > I have an app that needs to get a unique ID. Many threads run at the > same time that need one. I would like the IDs to be sequential. When I > need a unique ID I do this: > > with

Re: Anyone help?

2022-10-15 Thread Thomas Lockhart
You don’t run model files directly, but rather through manage.py which references your settings.py file. ./manage.py hth - Tom > On Oct 15, 2022, at 1:07 PM, It's ShAdAn wrote: > > Got error > > > /usr/bin/python3.9 > /home/user/PycharmProjects/pythonProject4/mycham/abcd/models.py >

Re: Adding csv as models

2022-09-23 Thread Thomas Lockhart
This is a very broad question so perhaps you are the stage of choosing the tools. The workflow, handling historical data, managing updates and replacement data, etc are things to consider for a production system so you’ll need to deal with those design questions. For my most recent system I

Re: JSON files. How is it done?

2022-09-22 Thread Thomas Lockhart
This will create a JSON file of the specified name for data from a time range specified in the URL. Re-reading your post, it seems that perhaps you don’t actually want a physical file but rather some JSON data to populate your browser window.Then Django Rest Framework will do what you want

Re: Averaging timestamp deltas with Django ORM

2022-09-07 Thread Thomas Lockhart
Something like qs.aggregate(delay=Avg(F(“approved_at”) - F(“created_at”)))[“delay”] where I cribbed the technique from https://stackoverflow.com/questions/50219652/django-queryset-get-avg-of-2-fields hth -

Re: Negative Stock Prevention

2022-08-30 Thread Thomas Couch
I don't see where you define the quantity variable, should that be instance.quantity? Also, presumably you want to check if quantity is greater than or equal to qu rather than 0. Try changing `if quantity > 0` to `if instance.quantity >= qu` On Tuesday, August 30, 2022 at 3:44:51 PM UTC+1 Ryan

Re: Two list on one page

2022-08-24 Thread Thomas Lockhart
Lay out your template to include both lists, then define get_context_data() in your view to have two lists of objects to show in your template. Get farther along and it will be easier for us to answer specific questions. hth - Tom > On Aug 24, 2022, at 12:34 PM, Matheus Bon wrote: > > What

Re: Setting up Celery with Python

2022-08-06 Thread Thomas Lockhart
Django and celery need a message server to communicate. You’ve configured one but it does not seem to be running. - Tom > On Aug 5, 2022, at 8:56 PM, Madhusudhan Reddy wrote: > > Hi Team, > > What's wrong...? > 09-19-34.png> 2022-08-06 09-18-44.png> > > -- > You received this message

Re: Search option in website

2022-07-23 Thread Thomas Lockhart
You can implement a robust search using something like elastic search or whatever seems to be the best choice currently (haven’t done one in a few years). Hth - Tom > On Jul 23, 2022, at 9:39 AM, Mahendra wrote: > > Hi to all, > How to implement Search option in website.please any one guide

Re: Need help on reducing cognitive complexity

2022-07-21 Thread Michael Thomas
Personally I think the code has a very weird "smell"... Assuming you don't have any way of rewriting the calling code and are stuck with editing this single method, I'd suggest something along the lines of: @staticmethod def in_circle_check(obj_type, item, uuid): if obj_type not in ['trees',

Re: DRF question

2022-07-20 Thread Michael Thomas
ews/ >>> >>> On Tue, 19 Jul 2022 at 06:38, Nikhil Chawla >>> wrote: >>> >>>> Don't clutter the django views with DRF requests. Keep them separate, >>>> available at, say `api` endpoints. >>>> >>>> On Tue, 19

Re: DRF question

2022-07-18 Thread Michael Thomas
and serializers mentioned above, as well as any additional actions that didn't fit within the normal REST verbs 4) Created a router and registered the viewsets with it 5) Added the router's urls into the projects url configuration I hope that's useful :) Kind Regards, Michael Thomas On Tue, Jul 19, 2022 at 7

Re: Added new column to model and run migrations but not applied to database table

2022-07-03 Thread Thomas Lockhart
Sorry that you are having continued problems. Your first report was almost a year ago and did not end up getting resolved but all the history on your thread is missing here so we can’t help with this information. “Migrations were not added” might indicate that your development server is out of

Re: Please criticise use of global keyword in Admin

2022-05-18 Thread Michael Thomas
ong, in my opinion at least! Kind Regards, Michael Thomas On Thu, May 19, 2022 at 9:34 AM Mike Dewhirst wrote: > The code below appears to work perfectly but it worries me because I > have never used the global keyword before. > > Is there a generous guru who will criticise the code c

Re: Django 1.5 app had subclasses without tables without proxy and now 1.6 won't sync with proxy

2022-04-05 Thread Thomas Lockhart
(Used 1.5 but don’t remember a thing :) ) Yes, what Steven says. If you try moving through each version then you will end up understanding a *lot* more about the application, but it sounds painful. Your specific question seems to indicate that you would want your subclasses to actually share

Re: Search & replace an object in the database

2022-01-21 Thread Thomas Lockhart
Yes this exactly. A couple of possible additions: I’ve had great luck using python and SQL queries to manipulate a database including converting from other schemas and merging duplicate records. Make a test database from your backup, and beat it up with your scripted code until you are happy

Re: Running tests fails in the test runner call_command

2021-12-22 Thread Thomas
fwiw there is a call to the wrapping method django.test.DiscoverRunner.run_checks() in the celery python package. And I've got django_celery_beat in my list of apps which might be bringing it in??? On Tuesday, December 21, 2021 at 4:01:10 PM UTC-8 Thomas wrote: > I’ve got a 3.2

Running tests fails in the test runner call_command

2021-12-21 Thread Thomas Lockhart
I’ve got a 3.2.10 installation and haven’t run my unit tests in a long time. When I try now, I get a failure which seems to trace back to the test runner itself: TypeError: Unknown option(s) for check command: databases. Valid options are: all, debug, force_color, help, names, no_color,

Re: get country from IP_addres.

2021-12-15 Thread Michael Thomas
://docs.djangoproject.com/en/4.0/intro/tutorial02/#playing-with-the-api Kind Regards, Michael Thomas On Thu, Dec 16, 2021 at 3:08 PM Amor Zamora wrote: > Can you help me? > I need to obtain the country of where the users access from the IP and > insert that information into the sqlite3 database. &

Re: Declarative mechanism for Django model rows

2021-12-08 Thread Thomas Lockhart
I may be completely misunderstanding your use case, but just in case… You can have different views in your application, and if you don’t want to expose the data as separate pages then you might consider django-rest-framework to provide data in various ways, including across models. You’ll end

Re: __init__() got an unexpected keyword argument 'on delete' when make migrations

2021-12-05 Thread Thomas Lockhart
Please use polite language. Thank you. - Tom > On Dec 5, 2021, at 5:21 PM, Anurag Agarwal wrote: > > Why are you fucking passing the args > On_delete in manytomany . Class > >promotion = models.ManyToManyField(Promotions, on_delete=models.CASCADE) > > > On Sun, Dec 5, 2021, 21:09 Samuel

Re: TypeError: 'str' object is not callable

2021-08-30 Thread Thomas Lockhart
Just guessing that you need to write messages.success = “Your ad is successfully posted” But without more information from you that is only a guess. How is messages.success defined? - Tom > On Aug 30, 2021, at 8:57 PM, Salima Begum > wrote: > > Hi all, > In my project for each

get_changeform_initial_data with ManyToMany

2021-07-09 Thread Thibault Thomas
Hello, How can I use admin's get_changeform_initial_data function to prepopulate a many to many relationship widget ? I have the following models in models.py : ___ *class Piece(models.Model):* vehicules = models.ManyToManyField(Vehicule,

Re: how does Django handle outbound requests?

2021-06-27 Thread Thomas Lockhart
It is quite often recommended to keep it simple and then optimize if you need to. The optimization woiuld be to decouple the external request using a queue, then provide a response to the client separately. Just as you suggest. You can also design your API to allow this optimization, without

Re: CSS not linking with HTML

2021-06-02 Thread Michael Thomas
is invaluable in the long run. Kind Regards, Michael Thomas On Wed, Jun 2, 2021 at 8:16 PM sukhy gill wrote: > Dear frnd, > I am getting stuck at same point with static with new project. > May I get setting for settings.py ? > > Regards > > On Sat, May 29, 2021, 18:

Re: How does django-admin work?

2021-05-31 Thread Thomas Lockhart
Welcome to Django! Django does not add django-admin to your path. Rather, when Django is installed it (sometimes) happens to be installed into a place which is already in your path. Otherwise, you need to add it to your path or use a packaging system such as anaconda which helps do that for

Re: How to fix this error

2021-05-24 Thread Thomas Lockhart
A “not null constraint failed” is in the error message. So you have a field which is not being set and the database itself is complaining. It looks like you have extended the user profile to include a foreign key to “babyinfo” and that is empty apparently. Either change the model to allow a

Re: Creating dynamic chart / graphs with Django

2021-05-15 Thread Thomas Lockhart
Django integration is fairly easy with Bokeh. For very large datasets you will want to also use Datashader and Holoviews so that high-density data gets rendered with meaningful interpolations. hth - Tom > On Apr 12, 2021, at 7:16 AM, Lars Liedtke wrote: > > Hey, > > this is quite good

Re: Server balance

2021-05-15 Thread Thomas Lockhart
You will find a lot of useful information just by searching for “scaling Django”. Then you can ask specific questions here. hth - Tom > On May 14, 2021, at 9:29 PM, Shashank Vijendra > wrote: > > If suddenly Users are increased for our site our site capacity is lets take > 1000 > so what

Re: DRF simplejwt refresh access_token stored in httponlycookies

2021-05-08 Thread Michael Thomas
ay be better off with regular django session authentication, signed cookies, etc.. Kind Regards, Michael Thomas On Sat, May 8, 2021 at 11:02 AM narendra thapa wrote: > Thank You @Michal Thomas, i was able to refresh a token now, But i got > another confusion from your answer :D. Which is the bes

Re: DRF simplejwt refresh access_token stored in httponlycookies

2021-05-08 Thread Michael Thomas
all the refresh view to get a replacement before making the request. I hope that helps! Kind Regards, Michael Thomas On Sat, May 8, 2021 at 6:49 AM narendra...@gmail.com < narendrathapa...@gmail.com> wrote: > i'm using django as my backend and react as frontend. i'm using simplejwt > for

Re: View / Query Set not showing with filter

2021-03-19 Thread Thomas Lockhart
Why use Q? afaict simple filter syntax should get you what you want. Booking.objects.filter(organization_id=request.user.organization_id, booking_time__range= (start_date, end_date)) Not sure if this will get you closer to the query you expect. You might also find it useful to use "./manage.py

Re: View / Query Set not showing with filter

2021-03-19 Thread Thomas Lockhart
Almost certainly start_date and end_date are not what you expect. Do the types match? In any case print them out and see what you are actually getting. hth - Tom > On Mar 19, 2021, at 6:00 AM, Manuel Buri wrote: > > Hi, > > I am having this query set in my view: >

Re: Python libraries for visualisations

2021-03-15 Thread Thomas Lockhart
If you are working with larger scientific datasets then bokeh may be of interest. For my cases all of the code is done in python. hth - Tom > On Mar 14, 2021, at 9:49 PM, GEETHANJALI S P > wrote: > > Hi..How to build a dashboard using django and python libraries for creating >

can I use django authentication in already created mysql database with user data?

2021-03-10 Thread Kevin Thomas
I am creating a web app and I need to authenticate the login. The username and password is already stored in mysql database. Can I use django for authentication of existing data? It will be great help if anyone knows the answer. -- You received this message because you are subscribed to the

Re: Library for calculating distance between ZIP codes

2021-02-16 Thread Thomas Lockhart
Pre-calculating is pretty expensive: 81939*81938/2 = 3,356,958,891 entries make a pretty big table. Calculating on the fly is probably not horribly expensive and you could calculate and save, thereby caching values which have been used before. Anyway, geodjango might be what you need. Plus the

Re: Problem with Postgresql-11.9 ??

2020-10-12 Thread Thomas Lockhart
No one has answered yet, so here is some useless info… I’ve been using various combinations of Postgres and Django (currently 12.4 and 3.1.2, respectively) and would think I would have stumbled on this at some point when using postgresql-11. But I probably haven’t tried 11.x with 3.1.2

Re: HELP With Scraping and Storing Data to DB from a Search Engine!!

2020-09-13 Thread Thomas Lockhart
Use Python and Beautiful Soup for scraping in an external program. Then send the results to your Django app using the Django Rest Framework JSON API. If you need your scraping program to get candidate sites from your app, then use the DRF API to get those. hth - Tom > On Sep 13, 2020, at

Re: django beginner

2020-08-05 Thread Thomas POKAM
Hi Jose, Did you when throw this introduction guide ? https://docs.djangoproject.com/en/3.1/intro/ Le 03/08/2020 à 11:10, jose AVOM a écrit : hi all. i am new in django i, i want to improve my skill... need for help en challenge ... thks -- You received this message because you are

Re: Django 3.1 release candidate 1 released

2020-08-04 Thread Thomas Lockhart
Mariusz announced the final release a few hours before you posted this. To this same email list ;) - Tom > On Aug 3, 2020, at 10:14 PM, 'Nikhilanj Venkata Pelluri (Software > Development)' via Django users wrote: > > Hi, > Has the final version for v3.1 been released ? > > On Monday,

Re: 'Sandboxed' Template engine/context

2020-07-10 Thread Michael Thomas
: > > Hi Michael, > > Some templates as mako, jinja, genshi... > > > > > On Fri, Jul 10, 2020, 4:23 PM Michael Thomas > wrote: > >> Hi all, >> >> Does anyone know of a straightforward way to create an independent >> template engin

'Sandboxed' Template engine/context

2020-07-10 Thread Michael Thomas
Hi all, Does anyone know of a straightforward way to create an independent template engine instance with a subset of the tags/filters/etc. defined? The use-case is for allowing user-supplied template content, while preventing said users from being able to use features that could be dangerous,

Re: python manage.py runserver error

2020-06-18 Thread Thomas Furtado
Hii, thanks for answering but it didn't work Now it showed: no module named 'django.contrib.statics' Em qui, 18 de jun de 2020 22:03, chaitanya orakala escreveu: > Hi Thomas, > Please run the following commands to solve this problem, before running > the server. > > p

Re: python manage.py runserver error

2020-06-18 Thread Thomas Furtado
Hi, I've seen you sent this last year and I'm having the same error message at my pycharm... Did you solve this?? could you help me with this please?? Em sábado, 13 de julho de 2019 08:35:31 UTC-3, Jack Bergemann escreveu: > > (venv) C:\Users\Chas\rp-portfolio\personal_portfolio>python manage.py

The syntax of the file name, directory name or volume label is incorrect: ''

2020-06-18 Thread Thomas Furtado
Microsoft Windows [versão 10.0.18362.900] (c) 2019 Microsoft Corporation. Todos os direitos reservados. (venv) C:\Users\User\PycharmProjects\curso-udemy-master>python manage.py runserver Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent

Re: Python 3.8 Installed, yet Django 1.11 is Automatically Being Installed on Mac

2020-06-08 Thread Thomas Lockhart
virtualenv or (probably even better) conda (Anaconda) will be easier environments to manage. I know that MacPorts will also have the packages you’ll need. hth - Tom > On Jun 8, 2020, at 7:37 PM, arhoon io wrote: > > Hello, > > I have installed and successfully confirmed that Python 3.8

Re: Why is "Hello World!" alternating with Django welcome page after following tutorial?

2020-05-30 Thread Thomas G. McNeill
Well, never mind. I changed some stuff, and then I changed it all back, as far as I know. But now it is working correctly. I have no idea what I changed. On Saturday, May 30, 2020 at 5:41:52 PM UTC-6, Thomas G. McNeill wrote: > > I just followed this tutorial to create the simplest po

Why is "Hello World!" alternating with Django welcome page after following tutorial?

2020-05-30 Thread Thomas G. McNeill
I just followed this tutorial to create the simplest possible Django application: https://aws.amazon.com/getting-started/hands-on/deploy-python-application/ I used *campaign* instead of *tutorial* and *app* instead of *hello_world* because I intend to transform the tutorial into a simple

Re: gdal installed still

2020-05-12 Thread Thomas Lockhart
It looks like you are running on Windows which I’m not familiar with. But most likely your gdal installation is in a different Python installation than your django installation. - Tom > On May 12, 2020, at 3:53 AM, mick wrote: > > django.core.exceptions.ImproperlyConfigured: Could not find

Re: Creating test databases in parallel

2020-04-01 Thread Thomas Lockhart
If you are trying to optimize the test flow, then you may want to spend some time shrinking your test databases to a more manageable size. Or have two sets; abbreviated and full, with the larger one to exercise your (unknown) edge cases. hth - Tom > On Apr 1, 2020, at 2:25 AM, cool-RR wrote:

Re: Error running Django tutorial

2020-03-25 Thread Thomas Pittman
Kyle D, This is why I stay in this thread. Thanks for the heads up. I remember being so lost when I tried to start teaching myself Django. What's the class for? Regards On Tue, Mar 24, 2020 at 10:46 PM kyle D wrote: > I'm using Django for a class, and came across this thread and thought I'd

Re: Django server is slow after moving database to remote VM

2020-02-11 Thread Michael Thomas
1500kbps is horrendously slow too, really.. If you're seeing a significant difference between small transfers vs large, you might be stumbling into an incorrect MTU size for the network. This has popped up a little more often in recent years with the rise of vxlans over public connections.

Re: SPA websites with Django

2019-11-14 Thread Michael Thomas
Django is a backend platform - it's agnostic as to what type of front end you build with it. On Thu, Nov 14, 2019 at 4:27 PM Inna Reddy wrote: > Hi, > > Can we build Single page web applications with Django ? > > -- > You received this message because you are subscribed to the Google Groups >

Re: Postgre sql problem

2019-09-06 Thread Thomas Lockhart
You need the python-devel package installed for the version of python you are running. - Tom > On Sep 6, 2019, at 12:49 PM, Elmaco7 wrote: > > Hello, I'm trying to use Postresql with my django project, but when i try to > install psycopg2(with this command 'pip3 install psycopg2') this

Re: form.is_valid() is always return false please help

2019-08-22 Thread Thomas Lockhart
Post your form code please. - Tom > On Aug 22, 2019, at 12:56 PM, Shubham Chauhan > wrote: > > form.is_valid() is always return false please help > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and

Re: Help

2019-06-29 Thread Thomas POKAM
Can you give more details please ? Le 29/06/2019 à 15:34, pramod a écrit : How to get the input from the user in table -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: Print data from Database in Django

2019-05-05 Thread Thomas Lockhart
Your context variable for all students is “stud”. Try changing that to “Student” as you refer to it in your template. - Tom > On May 5, 2019, at 7:09 AM, anchal agarwal wrote: > > I want to display the name of all the students from the Student model using > cards , i have set it all up but

Re: Complex query on inner join - case for __ne?

2019-04-12 Thread Michael Thomas
Naimur: I am - that SQL was in response to Aldian's question :) On Fri, Apr 12, 2019 at 8:23 PM naimur rahman wrote: > use ORM istead of SQL > > On Fri, Apr 12, 2019, 7:42 PM Michael Thomas < > michael.thomas.s...@gmail.com> wrote: > >> SELECT >> "

Re: Complex query on inner join - case for __ne?

2019-04-12 Thread Michael Thomas
IN ( SELECT U1."foo_id" FROM "app_bar" U1 WHERE U1."attribute_1" = 1 ) ) AND "app_bar"."attribute_2" = 2 ) On Fri, Apr 12, 2019 at 6:59 PM Aldian Fazrihady wrote: > What's th

Re: not getting desired output

2019-04-12 Thread Michael Thomas
You're not using a template, nor generating HTML in your views - where are you expecting bullets to come from? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Complex query on inner join - case for __ne?

2019-04-12 Thread Michael Thomas
or attribute_1=1 and attribute_2=2 works as expected, so it would be trivial to do this with a __ne operator (if it existed), without any other changes to the ORM: print(Foo.objects.filter(bar__attribute_1=1, bar__attribute_2=2).query) SELECT "app_foo"."id",

Blog application

2019-04-01 Thread Thomas Mathias
Hello guys i have a django blog app and wanted to fetch all the post of the logged in user such that he is able to delete them.help guys -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: Having problem with first page of first tutorial

2019-03-23 Thread Thomas POKAM
You should make sure you import the module polls in the site01/urls.py file by adding this line: from polls import views Le 23/03/2019 à 19:47, Ben Edwards a écrit : Ive not done https://docs.djangoproject.com/en/2.1/intro/tutorial01/ 3 times and cant get past the first page.  Its kind of

Re: test if model object fits into QuerySet without executing SQL?

2019-03-18 Thread Thomas Klopf
> qs2 = Table.objects.filter(color='blue') > > > mo1 = qs1[0] > > > Are you trying to determine if mo1 is in qs2? > > Best > > On Friday, March 15, 2019 at 7:46:14 AM UTC-4, Thomas Klopf wrote: >> >> Hi all, >> Please I have a question, couldn'

test if model object fits into QuerySet without executing SQL?

2019-03-15 Thread Thomas Klopf
Hi all, Please I have a question, couldn't find any answer for it.. Let's say I have 2 QuerySets: 1) Select all records from table 2) Select all records from table where color = "blue" So QuerySet #2 is more restricted than QuerySet #1 So question is - if I get a model object from

Re: websites building

2019-03-05 Thread Thomas POKAM
And Usually, working on your computer, the address to connect to in your browser will be http://127.0.0.1:8000 or you can  use but http://localhost:8000 . The result on the page will be a welcomming page to tells you that you successfully setup your environment et you first app. After this

Re: MySQL CRUD

2019-02-25 Thread Thomas Lockhart
A good way to get started is to follow the Django tutorial on the polling app. The mailing list will be happy to answer specific questions you might have. Good luck! - Tom > On Feb 25, 2019, at 10:12 AM, Darshan Gohel > wrote: > > How to Create tables using Django ? > And how to insert

Re: Migration Issues when updating model's default primary key from id to uuid

2019-02-19 Thread Thomas Leo
I'm running django 1.11, have this same issue. Has this issue been fixed in later versions of django? Is there a workaround for 1.11? On Sunday, November 12, 2017 at 7:30:45 AM UTC-5, Liuyang Wan wrote: > > Thanks for the link. It’s interesting that two years past the bug is still > unresolved.

Re: Django timezone problem

2019-02-06 Thread Thomas Lockhart
If you want this to happen without the user registering and giving you an address, you could use a geolocation and ip address database. I think yahoo and google both provide these services (I used yahoo because their terms of service were less restrictive). If the user allows the browser to

Re: Django + OrientDB

2018-08-14 Thread Thomas Kennedy
Thanks Jason, There is not much detail on that post Does anybody else have any experience on using Orientdb with django? On Sunday, 12 August 2018 21:32:40 UTC+1, Jason wrote: > > This is focused on Neo4J > https://medium.com/@webchad/neo4j-and-django-c12c7a1581a3, but that's a > graph db

Django + OrientDB

2018-08-12 Thread Thomas Kennedy
I was wondering if anybody has used Django with OrientDB. I am particularly interested in using PyOrient OGM but I am unable to figure out how to get it to work. Are there any example projects out there can help get me kickstarted? Tom -- You received this message because you are subscribed

Re: Weighing Scale & TCP IP connectivity

2018-07-12 Thread Thomas G Lockhart
You can use Django REST framework to get data into Django and a separate Python (or other) program to feed it in. Have the Python program connect to the scale and use whatever mechanisms are required there to get your data. If the scale has a browser interface, then use urllib to read a page

Re: I plan to have lots of data tables with similar structure. How do you recommend I model them?

2018-01-11 Thread Thomas G Lockhart
You may want to have several tables linked by foreign keys. A Census Tract table, a County table, a State table, etc. That reduces the amount of duplicate data and the chances for inconsistent entries. The downside is a bit more work on the part of the computer to do lookups, but particularly

Having issue getting django working on shared hosting account

2017-08-29 Thread Thomas Campion
I tried following vendor instructions for installing located at https://support.ehost.com/articles/employees/django-with-fastcgi and cant seem to get anything to display. This is a cheap hosting account and support is non existent, though they do advise I should be able to run django here. Can

Re: How to handle nested backward lookups in a template for a generic detail view?

2017-08-09 Thread Thomas Hughes
r, you can move your image to ProjectDetail model > (add field `image = models.ImageField(...)`) and use it like so: > > {% for detail in project.projectdetail_set.all %} > > {% endfor %} > > On 9 Aug 2017, at 15:33, Thomas Hughes <ezero.te...@gmail.com > > wrote: > >

Re: How to handle nested backward lookups in a template for a generic detail view?

2017-08-09 Thread Thomas Hughes
Just FYI - the issue was with using 'image.url' rather than 'image.image.url' in code labeled with 'do something with image' in the HTML template above. On Monday, August 7, 2017 at 3:52:15 PM UTC-4, Thomas Hughes wrote: > > I have a generic detail view serving content for 'project' to a

How to handle nested backward lookups in a template for a generic detail view?

2017-08-07 Thread Thomas Hughes
I have a generic detail view serving content for 'project' to an HTML template with the following code: {% for detail in project.projectdetail_set.all %} {% for image in detail.projectdetailimage_set.all %} do something with image {% endfor %} {% endfor %} and my models look

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Thomas Lockhart
> On Jul 4, 2017, at 8:39 PM, tay...@cedar.com wrote: > > I am having some trouble figuring out the best way to remove model fields in > Django. If I remove a field from a model and then run makemigrations, it > creates a RemoveField operation in a migration. That is great, but if I > decide

Re: Pre-loading static data into database table

2017-06-29 Thread John Thomas
Hi Rich, 419 is not that many. I'd probably do that via a Python shell. import models.Cities for item in lists_of_lists_of_419 temp = Cities(city+name=item[0], county_name=item[1]) temp.save() John Thomas 310-947-8572 On Thu, Jun 29, 2017 at 11:16 AM, Rich Shepard <rshep...@appl-ecosys.

Re: Adding a lookup table

2017-06-28 Thread John Thomas
Could you create a City model and a County model and relate them one County to many Cities? I'm not sure how to populate those tables. As an aside, where do you get your City to County data. I've been meaning to look for that data. Do all cities cleanly break into one county? John Thomas 310

Non-primary auto-incrementing field with Postgres

2017-06-19 Thread Thomas Hauk
I am working on a project that uses Django 1.10.5 with Postgres 9.6 (and Python 3.6.1). I am currently migrating historical data from an old system into the new system. This historical data has a table with a (non-primary key) "ID" column. I would like to migrate these rows into the new

Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-02 Thread F. Nikita Thomas
your help, you've made a rough time go a lot smoother. On Thursday, June 1, 2017 at 1:53:37 PM UTC-4, F. Nikita Thomas wrote: > > Hi! > I'm having a problem with configuring uWSGI with Django, when I run the > development server everything 'seems' okay, except that I am missing > styl

Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-02 Thread F. Nikita Thomas
he correct version which *python3.6*, which is different from the system wide version, Cent OS uses it for yum I believe. Please notice my directory layout is different from what was quoted by Melvyn, could this be the issue? Thanks! On Thursday, June 1, 2017 at 1:53:37 PM UTC-4, F. Nikita Thomas wr

Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread F. Nikita Thomas
https://www.digitalocean.com/community/tutorials/how-to-use-mysql-or-mariadb-with-your-django-application-on-ubuntu-14-04 On Thursday, June 1, 2017 at 5:47:25 PM UTC-4, F. Nikita Thomas wrote: > > No such thing as a dumb question, how do I check? > > On Thursday, June 1, 2017 at 5:36:23 PM UTC-

Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread F. Nikita Thomas
No such thing as a dumb question, how do I check? On Thursday, June 1, 2017 at 5:36:23 PM UTC-4, James Schneider wrote: > > *** Operational MODE: single process *** >> Traceback (most recent call last): >> File "./project/wsgi.py", line 12, in >> from django.core.wsgi import

Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread F. Nikita Thomas
aven't had this much fun since I had my wisdom teeth removed Thanks again! On Thursday, June 1, 2017 at 2:27:28 PM UTC-4, Melvyn Sopacua wrote: > > On Thursday 01 June 2017 10:47:05 F. Nikita Thomas wrote: > > > Hi! > > > I'm having a problem with configuring uWSGI with Django

uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread F. Nikita Thomas
Hi! I'm having a problem with configuring uWSGI with Django, when I run the development server everything 'seems' okay, except that I am missing styling on the html, and when I test run uWSGI from the command line I get: (projectenv) [user@echo project]$ uwsgi --http :8000 --chdir

  1   2   3   4   5   6   7   8   9   10   >