Re: How Do I Authorise user using token

2021-10-06 Thread Kasper Laudrup
On 06/10/2021 18.28, Adeyemi Deji wrote: Check this out, might be of help. https://www.youtube.com/watch?v=Wq6JqXqOzCE Adeyemi, it is very much appreciated that you're trying to help, but while top-posting is already extremely annoying, I probably have to accept that. But do please try to

Re: How Do I Authorise user using token

2021-10-06 Thread Adeyemi Deji
ication. > > > https://devinsights.hashnode.dev/token-based-user-authentication-with-django > > > Every web page is showing in postman in google. > > > > I have no idea what that is supposed to mean. Please clarify. > > > how do i use headers in url > > > >

Re: How Do I Authorise user using token

2021-10-06 Thread Kasper Laudrup
lease clarify. how do i use headers in url You don't. Headers are not part of a URL. Kind regards, Kasper Laudrup -- 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 i

How Do I Authorise user using token

2021-10-06 Thread M R
Hi DRF Team, I have created tokens but i don't know how to use it for authentication. Every web page is showing in postman in google. how do i use headers in url Thanks Madhusudhan -- You received this message because you are subscribed to the Google Groups "Django users&

How do I return a queryset of all items (X) ManyToMany related to model class (Y) and include values for (Y) in the same result in each item X

2021-07-05 Thread mtp...@gmail.com
I have the following two model classes: ``` class Property(models.Model): """Represents property class model""" serial_no = models.CharField(unique=True,max_length=255,blank=True,null=True) map_no = models.CharField(max_length=255,blank=True,null=True) lr_no = models.CharField(ma

How do I make a pre-selectable city and country pairs which will be stored in a model?

2020-09-13 Thread Mislav Jurić
Hey guys, I want to make a drop-down list of all city an country pairs (such as New York, USA) where the user, upon registration, will be able to select the (city, country) pairs from all over Europe and then I want to store that in one of my models. *How do I accomplish this (both front-end and

How do I revoke JWT everytime a new token generated using django-graphql-jwt?

2020-07-28 Thread Anzhari Purnomo
/63135623/how-do-i-revoke-jwt-everytime-a-new-token-generated-using-django-graphql-jwt -- Pardon my brevity, Anzhari Purnomo Sent from mobile phone -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: How do I preload messages on django channels?

2020-06-20 Thread GBELE CEDRIC EMMANUEL
hi , i checked your code , so if you want to call all message when a users is connected , you have to create a function to call all messages when websocket is connected , Saisissez lfrom datetime import datetimee code ici...e code ici... function: Saisissez le code ici. @database_sync_to_async

How do I preload messages on django channels?

2020-06-20 Thread georgi...@gmail.com
I am making a django live chat app using django channels. I have a Message model where I store all the previous messages. Now I need to load them when an user connects to the websocket. This is my code: https://textuploader.com/1x5ve https://textuploader.com/1x50b Can you suggest me how to appr

How do I show dynamic and dependable list of values of model field on Front End using Django Forms?

2020-05-15 Thread Khubaib Khawar
have a Detail Model which has a ForeignKey() of User Model. I want to show the list of subject (which is a field of Detail Model) associated with a single user, at the Front End in Template. It should be a dropdown menu and user should be able to select the subject from the list and submit the

Re: How do I create a GEO management system using django as back-end and react as front-end?

2020-03-31 Thread Christian Ledermann
have a look at https://github.com/cleder/os-opendata-edubase On Thu, 12 Mar 2020 at 09:55, Philip Mitchell wrote: > I want to work on a project where a user is able to mark and locate > objects on a map as in the https://www.openstreetmap.org/ > I don't know how to go about it, I have tried Geo

Re: How do I use Daphne without websocket "secure"?

2020-01-30 Thread Jeremy Wai
Nevermind. heroku has SSL on by default. There's no option to turn it off. On Thursday, January 30, 2020 at 12:04:05 AM UTC-8, Jeremy Wai wrote: > > I have a embedded system that doesn't support the 'secure' part of > websocket secure, how do i disable the websock

Re: How do I use Daphne without websocket "secure"?

2020-01-30 Thread Jeremy Wai
t 3:06 PM Jeremy Wai > wrote: > >> My procfile has this line: >> web: daphne APbackend.asgi:application --port $PORT --bind 0.0.0.0 >> >> On Thursday, January 30, 2020 at 12:04:05 AM UTC-8, Jeremy Wai wrote: >>> >>> I have a embedded system that

Re: How do I use Daphne without websocket "secure"?

2020-01-30 Thread Aldian Fazrihady
January 30, 2020 at 12:04:05 AM UTC-8, Jeremy Wai wrote: >> >> I have a embedded system that doesn't support the 'secure' part of >> websocket secure, how do i disable the websocket "secure" part of my daphne >> application? I don't see it anyw

Re: How do I use Daphne without websocket "secure"?

2020-01-30 Thread Jeremy Wai
My procfile has this line: web: daphne APbackend.asgi:application --port $PORT --bind 0.0.0.0 On Thursday, January 30, 2020 at 12:04:05 AM UTC-8, Jeremy Wai wrote: > > I have a embedded system that doesn't support the 'secure' part of > websocket secure, how do i disab

How do I use Daphne without websocket "secure"?

2020-01-30 Thread Jeremy Wai
I have a embedded system that doesn't support the 'secure' part of websocket secure, how do i disable the websocket "secure" part of my daphne application? I don't see it anywhere in my code that i've actually set it up. -- You received this message becau

Re: How do I make my webhook object run a websocket function?

2020-01-09 Thread Jeremy Wai
going to answer my own question for the sake of anyone who runs into things while learning python: I needed channel redis that can pass messages from one process to another. redis is just a key/value storage server that you can install in ubuntu. On Wednesday, January 8, 2020 at 8:22:11 PM UTC-

How do I make my webhook object run a websocket function?

2020-01-08 Thread Jeremy Wai
I got a heroku server running on one web processing, in the routing.py I have application = ProtocolTypeRouter({ 'websocket': backEndConsumer, 'http': frontEndConsumer, }) my frontEndConsumer handles the http webhook requests and my backEndConsumer handles all my websock

How do I make my webhook run a function in websocket?

2020-01-08 Thread Jeremy Wai
theisnfksdnflksd why does this not work when i have my actual post? -- 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 django-users+unsubscr...@googlegroups.com. T

Re: How do i add style to my django admin

2019-12-19 Thread ramadhan ngallen
Did you override settings.py Debug=False? Best Regards Ramadhan Ngallen Software Consultant Phone: +255 715 200 997 | ngall...@gmail.com On 19 Dec 2019, 21:16 +0300, amin ghaemi , wrote: > hi , first you need to reinstall django : > type this command in cmd: > > pip uninstall django > pip insta

Re: How do i add style to my django admin

2019-12-19 Thread amin ghaemi
hi , first you need to reinstall django : type this command in cmd: pip uninstall django pip install django and for runserver type this command : python maange.py runserver if you have problem get screenshot and send to me On Thu, Dec 19, 2019 at 6:02 PM Lasisi Habeeb wrote: > when i ran my dj

How do i add style to my django admin

2019-12-19 Thread Lasisi Habeeb
when i ran my django server using django manage.py runserver and ran 127.0.0.1:8000/admin on my web browser it prompt the django admin site but without styles -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and s

Re: How do I populate a table with data from a list file?

2019-12-05 Thread Dominick Del Ponte
I'm pretty new to django but, I think you'll need a view that fetches all of the rows from your model. This can be done with either a listView or in with something like model.objects.all() to return the context data from your view. Then in the template you could do: {% for item in data %} {{ i

How do I populate a table with data from a list file?

2019-12-04 Thread Dick Arnold
I have created a table by using css examples (similar to a spread sheet). However, all the examples that I have found populate the table manually by typing td entries in the html file. How can i accomplish this with django/Python code? I have looked everywhere I can find, but no luck so far

Re: Hello, please i'm facing this errors , how do i solve it?

2019-11-02 Thread Kasper Laudrup
Hi Sullivan, One of the fields in one of your models cannot be null, but one of your views tries to update one of your models without specifying a value for that field or is explicitly setting it to null. Without any further context it's impossible to help you solve it. Consider adding a bit

Re: How do I setup email from address from logging to the admins?

2019-08-09 Thread אורי
configured a from address > (DEFAULT_FROM_EMAIL) and other emails I receive from Django is from the > from address (which is different for the staging server, currently < > webmas...@speedy.net.2.speedy-technologies.com>) > > > https://github.com/speedy-net/speedy-net/blob/

How do I setup email from address from logging to the admins?

2019-08-09 Thread אורי
me from , although I configured a from address (DEFAULT_FROM_EMAIL) and other emails I receive from Django is from the from address (which is different for the staging server, currently < webmas...@speedy.net.2.speedy-technologies.com>) https://github.com/speedy-net/speedy-net/blob/staging/speedy/

Re: How do I override default date formats per locale in Django?

2019-07-25 Thread אורי
ettings.DATE_FORMAT }} > {% elif can_view_dob_day_month %} > {{ user.date_of_birth|date:settings.MONTH_DAY_FORMAT }} > {% elif can_view_dob_year %} > {{ user.date_of_birth|date:settings.YEAR_FORMAT }} > {% endif

How do I override default date formats per locale in Django?

2019-07-24 Thread אורי
{{ user.date_of_birth|date:settings.YEAR_FORMAT }} {% endif %} {% endif %} {% endif %} And I want it to display the dates in these formats in each language. How do I do it? אורי u...@speedy.net -- You received this message because you are subscribed to the Google Grou

Re: how do I create a slug in Django 2.2

2019-04-09 Thread Robin Riis
def save(self, *args, **kwargs): self.slug = slugify(self.title) super(name, self).save(*args, **kwargs) Den tis 9 apr. 2019 12:24AMI FIDELE skrev: > I have tried to create a slug watch here and please tell the problem > > this is model.py > > from django.db import models > > # this is m

how do I create a slug in Django 2.2

2019-04-09 Thread AMI FIDELE
I have tried to create a slug watch here and please tell the problem this is model.py from django.db import models # this is my models class Article(models.Model): title = models.CharField(max_length=100) slug = models.SlugField() body = models.TextField() date = models.DateTimeF

Re: How do I store details securely with django?

2018-11-14 Thread Lance Haig
egroups.com <mailto:django-users@googlegroups.com> mailto:django-users@googlegroups.com>> on behalf of Lance Haig mailto:lnh...@gmail.com>> *Sent:* Monday, November 12, 2018 4:45:50 PM *To:* django-users@googlegroups.com <mailto:django-users@googlegroups.com>

Re: How do I store details securely with django?

2018-11-14 Thread Lance Haig
Eric *From:* django-users@googlegroups.com on behalf of Lance Haig *Sent:* Monday, November 12, 2018 4:45:50 PM *To:* django-users@googlegroups.com *Subject:* Re: How do I store details securely with django? Hi Eric, I am s

Re: How do I store details securely with django?

2018-11-14 Thread Lance Haig
Thanks I will take a look at that Lance On 11/13/18 6:29 AM, Mike Dewhirst wrote: Another thought Django admin has a built-in mechanism for password management. It includes forms with password widgets.Perhaps you could hack your own encryption of the cloud credentials based on the Django a

Re: How do I store details securely with django?

2018-11-12 Thread Mike Dewhirst
Another thought Django admin has a built-in mechanism for password management. It includes forms with password widgets.Perhaps you could hack your own encryption of the cloud credentials based on the Django approach to passwords. It is possible to add forms to the Admin and include your own log

Re: How do I store details securely with django?

2018-11-12 Thread Devender Kumar
--- > *From:* django-users@googlegroups.com on > behalf of Lance Haig > *Sent:* Monday, November 12, 2018 4:45:50 PM > *To:* django-users@googlegroups.com > *Subject:* Re: How do I store details securely with django? > > > Hi Eric, > > I am s

Re: How do I store details securely with django?

2018-11-12 Thread PASCUAL Eric
users@googlegroups.com Subject: Re: How do I store details securely with django? Hi Eric, I am sure I have not explained myself properly. The app does the following. It presents a user the ability to sign up to a cloud platform for a sandbox / playground account. The number of cloud services tha

Re: How do I store details securely with django?

2018-11-12 Thread Lance Haig
Hi Mike, Thank you for taking the time to read this. I have highlighted these sentences in your response *The bottom line question: What is lost if temporary creds are compromised?* The credentials have high level access to the backed system think e.g  kubernetes admin so compromise would m

Re: How do I store details securely with django?

2018-11-12 Thread Lance Haig
opic. Best Eric *From:* django-users@googlegroups.com on behalf of Lance Haig *Sent:* Monday, November 12, 2018 9:07:30 AM *To:* django-users@googlegroups.com *Subject:* Re: How do I store details securely with django? Hi Eric, Thanks for the response. This idea has an end go

Re: How do I store details securely with django?

2018-11-12 Thread Pradeep Singh
me as environment variables. > > > Maybe I've misunderstood your need and sorry in this case if my answer is > off topic. > > > Best > > > Eric > -- > *From:* django-users@googlegroups.com on > behalf of Lance Haig > *Sent:

Re: How do I store details securely with django?

2018-11-12 Thread PASCUAL Eric
googlegroups.com on behalf of Lance Haig Sent: Monday, November 12, 2018 9:07:30 AM To: django-users@googlegroups.com Subject: Re: How do I store details securely with django? Hi Eric, Thanks for the response. This idea has an end goal of being deployed in a resilient way so most probably dock

Re: How do I store details securely with django?

2018-11-12 Thread Mike Dewhirst
On 12/11/2018 7:02 PM, Lance Haig wrote: Hi, Thanks for responding. My answers inline On 11/11/18 11:07 PM, Mike Dewhirst wrote: On 12/11/2018 12:47 AM, Lance Haig wrote: Hi, I have a project I am working on https://github.com/lhaig/usery/ and part of the roadmap of the project is to add

Re: How do I store details securely with django?

2018-11-12 Thread Lance Haig
Eric *From:* django-users@googlegroups.com on behalf of Mike Dewhirst *Sent:* Sunday, November 11, 2018 11:07:14 PM *To:* django-users@googlegroups.com *Subject:* Re: How do I store details securely with django? On 12/11/2018 12:47 AM, Lance Haig wrote: > Hi, > > I have

Re: How do I store details securely with django?

2018-11-12 Thread Lance Haig
Hi, Thanks for responding. My answers inline On 11/11/18 11:07 PM, Mike Dewhirst wrote: On 12/11/2018 12:47 AM, Lance Haig wrote: Hi, I have a project I am working on https://github.com/lhaig/usery/ and part of the roadmap of the project is to add more cloud types to the list. I wanted

Re: How do I store details securely with django?

2018-11-11 Thread PASCUAL Eric
@googlegroups.com on behalf of Mike Dewhirst Sent: Sunday, November 11, 2018 11:07:14 PM To: django-users@googlegroups.com Subject: Re: How do I store details securely with django? On 12/11/2018 12:47 AM, Lance Haig wrote: > Hi, > > I have a project I am working on https://github.com/lhaig/u

Re: How do I store details securely with django?

2018-11-11 Thread Mike Dewhirst
On 12/11/2018 12:47 AM, Lance Haig wrote: Hi, I have a project I am working on https://github.com/lhaig/usery/ and part of the roadmap of the project is to add more cloud types to the list. I wanted to allow admins for these services to login and create records for their different clouds in

How do I store details securely with django?

2018-11-11 Thread Lance Haig
Hi, I have a project I am working on https://github.com/lhaig/usery/ and part of the roadmap of the project is to add more cloud types to the list. I wanted to allow admins for these services to login and create records for their different clouds in the DB and then use these when people requ

how do i use the save method in multi step form

2018-11-09 Thread Tosin Ayoola
hallo developers i Created a multi step form but the issues is that i can't save the data to the database and that the purpose of creating the form, please how can i fix this or can anyone help me? , below is my views code class add_School(SessionWizardView): template_name = 'schoolprofil

Re: How do I make a field optional to enter, in a django ModelForm?

2018-09-12 Thread Ryan Gedwill
There may be a better way, but I’d set ‘required=False’ for the field. Then on the template where it is actually required, hardcode validation logic in either JS or with the template tags, by simply checking if the field is empty and displaying an error if it is empty, and submitting the form if

How do I make a field optional to enter, in a django ModelForm?

2018-09-12 Thread Joel Mathew
Scenario: I instantiate a ModelForm and pass it to a template which displays the form. When POST is submitted, code tries to search the database by any of the given inputs. I dont require all inputs to be entered as in the Model. I just need one (or more, if user desires to do an AND search) to be

Re: How do I display the human readable name of a choice?

2018-09-06 Thread Joel
This is clearly described in the polls application tutorial. https://docs.djangoproject.com/en/2.1/intro/tutorial01/ On Thu 6 Sep, 2018, 9:38 PM Ousseynou Diop, wrote: > Hi friend , > > use this function to display the choices field. > > models.py > > > class Article(models.Model): > > ARTIC

Re: How do I display the human readable name of a choice?

2018-09-06 Thread Ousseynou Diop
Hi friend , use this function to display the choices field. models.py class Article(models.Model): ARTICLE_CHOICES = ( ) status = models.CharField(max_length=120, choices=ARTICLE_CHOICES, ) in your templates {% article in articles %} {{artcile.get_status_display}} {% end

Re: How do I patch django.core.mail.send_mail for testing?

2018-08-23 Thread scloutier
I solved the problem by wrapping the imports of the test-file inside a context manager, as follow: with patch('django.core.mail.send_mail') as mocked_send_mail: from ModuleToTest.File import functionToTest That forced the patch to occur before the tested function was actualy imported. --

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-07-02 Thread Vinicius Assef
Maybe this other article helps you understand the essence of a virtualenv: http://blog.aprendapython.com.br/articles/entendendo-virtualenv-1fr69/ Again, Google Translator is your friend. On 2 July 2018 at 09:28, Vinicius Assef wrote: > I second Melvyn. > > On top of what he wrote, Bruce, I wo

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-07-02 Thread Vinicius Assef
I second Melvyn. On top of what he wrote, Bruce, I work in an environment with exactly this limitation: a shared hosting running Apache where I don't have access to ssh. I build my environment (install libs, for that matter) locally and transfer all my pack through ftp in one shot. As Melvyn to

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-07-01 Thread Melvyn Sopacua
On donderdag 28 juni 2018 17:46:42 CEST Bruce Whealton wrote: > In all cases, a virtualenv is recommended for any Python > deployment. In both cases, I have Apache as the web server with mod_wsgi. > Obviously, I need the server, Apache, to activate the > Django environment. I can ssh

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-06-29 Thread Kunal Grover
and googled for an answer to something so >> basic to deploying into production an isolated Python environment for >> Django (or any Python application) for that matter. So, here is my best >> effort >> to ask the question clearly. How do I deploy into production a Django &

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-06-28 Thread Gerardo Palazuelos Guerrero
he virtual environment and keep it activated as an isolated > virtual environment. > I have googled and googled for an answer to something so basic > to deploying into production an isolated Python environment for Django (or > any Python application) for that matter. So, here

Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-06-28 Thread Bruce Whealton
any Python application) for that matter. So, here is my best effort to ask the question clearly. How do I deploy into production a Django application following the best practice of using an isolated virtual environment that is activated even after I close my ssh session? Regardin

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 Ju

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 Avitab Ayan Sarmah
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 Jun, 2018, 7:23 PM Mario R. Osorio, wrote: > Looks like you skiped a huge part of the tutorial. you might to go back... > > On

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 Mario R. Osorio
Looks like you skiped a huge part of the tutorial. you might to go back... On Thursday, June 7, 2018 at 11:08:15 AM UTC-4, Avitab Ayan Sarmah wrote: > > In windows powershell: > > ERRORS: > : (admin.E108) The value of > 'list_display[0]' refers to 'question_text', which is not a callable, an > a

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-07 Thread Avitab Ayan Sarmah
In windows powershell: ERRORS: : (admin.E108) The value of 'list_display[0]' refers to 'question_text', which is not a callable, an attribute of 'QuestionAdmin', or an attribute or method on 'polls.Question'. : (admin.E108) The value of 'list_display[1]' refers to 'pub_date', which is not a cal

Re: How do I move my development data tables to production server?

2018-04-23 Thread Mike Dewhirst
On 24/04/2018 8:57 AM, Anthony Flury wrote: You can use manage.py dumpdata and manage.py loaddata And you can do this per app - or even per table. Thank you Anthony I had totally forgotten that. In fact I actually script dumpdata for dumping test data (ie fixtures) but loaddata never worked

Re: How do I move my development data tables to production server?

2018-04-23 Thread Mike Dewhirst
On 24/04/2018 5:50 AM, Tom Tanner wrote: Hey all, I have a bunch of tables on my local Django project. I set up the project on my production server and ran `manage.py migrate`. That set up the tables, but now I want to move the rows from my local tables to the ones on the production server. Bot

How do I move my development data tables to production server?

2018-04-23 Thread Tom Tanner
Hey all, I have a bunch of tables on my local Django project. I set up the project on my production server and ran `manage.py migrate`. That set up the tables, but now I want to move the rows from my local tables to the ones on the production server. Both local and production server use Postgre

How do I use `password_reset_confirm.html` with AngularJS?

2018-03-21 Thread Tom Tanner
I want to integrate AngularJS in my custom password_reset_confirm.html template in Django. But when I fill out a new password and hit "submit," nothing happens. Here's more info in better formatting: https://stackoverflow.com/questions/49396333/how-do-i-use-password-reset-co

How do I set up an AngularJS-driven form to work with Django password reset functionality?

2018-03-13 Thread Tom Tanner
ml. But I'm unsure how I'd apply it to my situation. My questions is how would I set up urls.py and views.py to handle this? Here's the example code on StackOverflow: https://stackoverflow.com/questions/49265097/how-do-i-set-up-an-angularjs-driven-form-to-work-with-django-passwor

Re: How do I transmit any changes to databases(i.e. creates and updates pertaining to a particular user) using Django Channels?

2018-03-08 Thread Andrew Godwin
Hi Alexis, You'll need to do some work yourself - hook into database changes (either via signals or overriding the save method) to send change notifications to a different Group for each user (maybe use group names like "user-123213", where the number is their ID). Then, when someone connects via

How do I transmit any changes to databases(i.e. creates and updates pertaining to a particular user) using Django Channels?

2018-03-08 Thread Alexis Candelaria
My goal is to send send any database updates to the relevant users. I was thinking of utilizing the views of the post and patch requests to do this but am not sure if there is better or more documented way. -- You received this message because you are subscribed to the Google Groups "Django u

Re: How do I get dynamic choices to a select widget at render time?

2018-02-22 Thread Mike Dewhirst
'E', 'E - Continously as changes are made?')] It is available before the the answer form is instantiated ... class AnswerSingleForm(forms.ModelForm): class Meta: model = Answer fields = [ 'answer',

Re: How do I get dynamic choices to a select widget at render time?

2018-02-20 Thread Andy
class Meta: > model = Answer > fields = [ > 'answer', > 'score' > ] > > So how do I get that set of choices into the Answer form? > > I can see from the docs that the form Meta class can ha

Re: How do I get dynamic choices to a select widget at render time?

2018-02-20 Thread Mike Dewhirst
stion.get_choices()     if len(choices) > 0:     self.fields['answer'] = forms.ChoiceField(     choices=choices             )     class Meta:     model = Answer     fields = [     'answer',     'score'   

How do I get dynamic choices to a select widget at render time?

2018-02-19 Thread Mike Dewhirst
, 'E - Continously as changes are made?')] It is available before the the answer form is instantiated ... class AnswerSingleForm(forms.ModelForm):     class Meta:         model = Answer     fields = [     'answer',     'score'     ] So how do I get t

Re: How do I move a project from one computer to another?

2018-02-12 Thread Mike Dewhirst
On 13/02/2018 11:09 AM, Tom Tanner wrote: I have a Django project that I want to work on with another computer. Do I need to backup my current project's Postgres database and restore it on the other computer's Postgres database to get my project up and running there? Or is there a Django way to

Re: How do I move a project from one computer to another?

2018-02-12 Thread Ramez Kabbani
You should be using some kind of git system. Push your code to the repo and pull it on the new machine. There should be no really concern switching machines. If your current DB has data that you need, export them and then import. You need to know how to do this for production code, so you migh

Re: How do I move a project from one computer to another?

2018-02-12 Thread sum abiut
It depends on where you want to house your app.if you need to house your app on the new machine. Just pip install from your requirements.txt file, then copy your django project to your new machine. On 13/02/2018 11:10 AM, "Tom Tanner" wrote: > I have a Django project that I want to work on with

Re: How do I move a project from one computer to another?

2018-02-12 Thread Etienne Robillard
Hi, you can use rsync for your project's source code. Etienne Le 2018-02-12 à 19:09, Tom Tanner a écrit : I have a Django project that I want to work on with another computer. Do I need to backup my current project's Postgres database and restore it on the other computer's Postgres database

How do I move a project from one computer to another?

2018-02-12 Thread Tom Tanner
I have a Django project that I want to work on with another computer. Do I need to backup my current project's Postgres database and restore it on the other computer's Postgres database to get my project up and running there? Or is there a Django way to do this? -- You received this message be

Re: how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-30 Thread Melvyn Sopacua
On vrijdag 26 januari 2018 22:25:55 CET eil...@themaii.org wrote: > well, you certainly got me correct! I'm fairly new to python - didn't do > much coding to learn. Trial by fire, sort of. and the original person who > put this together is now gone from the company and won't answer any > outstandin

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Andréas Kühne
Hi, No, year__in should be for a list. For example you can write: Profile.objects.filter(year__in=[2017, 2016, 2015]) so in your case it would be Profile.objects.filter(year=user.birthday.year) You should checkout how selection works in the django documentation: https://docs.djangoproject.com/en

How do I convert an existing column to Foreign Key?

2018-01-29 Thread Tom Tanner
b` so that the `tractFIPS` field is a foreign key referencing `model_a`. Something like this I guess... class model_b(models.Model): tractFIPS_FK = models.ForeignKey(model_a) And the table for `model_b` would look something like this in the end: id | tractFIPS_FK_id 1

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Travis Pickle
Hiya -- Thanks. This is sort of what I was looking for. user = User.objects.get(pk=pk) cars = Car.objects.filter(year=user.birthday.year).all() UserRelatedProfiles or user_related_profiles = Profile.objects.filter(year__in=user.birthday.year) ? On Monday, January 29, 2018 at 8:40:13 AM UTC-5,

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Andréas Kühne
Hi, It's really hard to understand what you exactly want. Without showing your code it'll be even harder to understand how / what you want to do. We have to guess from the little information you are giving However. if you want to query cars with the same year as the user for example, you coul

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Travis Pickle
I'm assuming not a single person has read what is in my body of my message and has only read the subject. I know bots have read the body. if http://somesite.com/user/ *1 ,where 1 is the pk,* i want to use in the view pk relation to gather all fields, and use fields

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-29 Thread Daniel Roseman
On Sunday, 28 January 2018 19:01:35 UTC, Travis Pickle wrote: > > I am using django 1.8. > > I read though the docs, however, i not seeing how I can get the PK other > attributes to use in model searching. > As others have stated, this is *fully* covered in the tutorial, specifically in part 3.

Re: how do I make django search for male or female without needing to specify an age?

2018-01-28 Thread Andy
Why do you make a POST request for displaying a list? Use GET parameters like its done for admin filters. And for building an API that returns JSON Data use DjangoRestFramework and you will just need to define your serializer fields .. the rest is taken care of for you. That code above looks ove

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-28 Thread Travis Pickle
I am using django 1.8. I read though the docs, however, i not seeing how I can get the PK other attributes to use in model searching. On Saturday, January 27, 2018 at 3:47:05 PM UTC-5, Matemática A3K wrote: > > https://docs.djangoproject.com/en/2.0/intro/tutorial01/ > > On Sat, Jan 27, 2018 at

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-27 Thread Matemática A3K
https://docs.djangoproject.com/en/2.0/intro/tutorial01/ On Sat, Jan 27, 2018 at 8:19 AM, Travis Pickle wrote: > Andy, > > Do you have a link for this? Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this grou

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-27 Thread Travis Pickle
Andy, Do you have a link for this? Thanks -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send

Re: how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-26 Thread eileen
well, you certainly got me correct! I'm fairly new to python - didn't do much coding to learn. Trial by fire, sort of. and the original person who put this together is now gone from the company and won't answer any outstanding questions. Plus, I *think* he got most of the code from 3rd party s

Re: how do I handle a dropdown in Django whose only purpose is to get data.

2018-01-26 Thread Melvyn Sopacua
There are a bunch of issues with this code: 1) Spell Physical correctly: > 2 - Phyiscal > if form.data['handicapped'] is 'Physical' or 'Mental': > handicapped = forms.ChoiceField(choices=[(x, x) for x in ('---', > 'Mental', 'Physcal')], required=False) Comparison of non

Re: how do I make django search for male or female without needing to specify an age?

2018-01-26 Thread Julio Biason
Hi Eileen, Your problem seems to be the line if form.is_valid() and form.data['gender'] != '-': It seems it will only accept the form if the gender is not "-"; if you change that (say, removing the part after the and), it should solve it. ... although you should have a better

Re: how do I make django search for male or female without needing to specify an age?

2018-01-26 Thread eileen
I should add that this initally loads a list of children without specifying either gender or age On Friday, January 26, 2018 at 12:05:04 PM UTC-5, eil...@themaii.org wrote: > > I have a file: views.py which refers to two main fields on the page: age > and gender > Right now, the search requires

how do I make django search for male or female without needing to specify an age?

2018-01-26 Thread eileen
I have a file: views.py which refers to two main fields on the page: age and gender Right now, the search requires that an age to be chosen whether or not the gender is, and I'd like to make the age optional as well. I.e get all the children. Additionally, I'd like to search for only males or fe

Re: Get request, has PK, how do I access the PK data with in the model

2018-01-26 Thread Andy
Travis have a look the very cool and complete django tutorial which explaining how you query models in part2. Once you have create the admin views, watch closely at how the list filters work to get an idea of what you have to do. :) -- You received this message because you are subscribed to th

Get request, has PK, how do I access the PK data with in the model

2018-01-25 Thread Travis Pickle
Lets say I have a model called Users. I request(get) http://www.google.com/user/*id* * (pk)* The users has age but finds to find other users with in same range, as well as other items that might be different ages. Lets say I want to find similar interest for this

Re: django 2 - How do I make search box?

2018-01-25 Thread Jani Tiainen
Hi, If you feel that Django official tutorial was too packed, Django Girls do have excellent tutorial that goes things in more depth: https://tutorial.djangogirls.org/en/ On 25.1.2018 14.51, Carl Brubaker wrote: I did go through the tutorial. I'm reading through the the forms section of the

Re: django 2 - How do I make search box?

2018-01-25 Thread Carl Brubaker
I did go through the tutorial. I'm reading through the the forms section of the documentation now. I'm more of a visual learner, so sometimes I have to read things 10 times til it makes sense. Thanks for your help! -- You received this message because you are subscribed to the Google Groups "D

Re: django 2 - How do I make search box?

2018-01-25 Thread harsh sharma
i think you can create a form for this and integrate in your template. through which u can search in your database . and for more details check https://docs.djangoproject.com/en/2.0/topics/forms/ On Tuesday, January 23, 2018 at 5:04:48 PM UTC+5:30, Carl Brubaker wrote: > > I am trying to make a

  1   2   3   4   5   6   7   8   9   10   >