Re:

2022-09-26 Thread Tom Lafferty
814-380-6157 Thank you -Tom On Mon, Sep 26, 2022 at 4:12 PM Giovanni Silva wrote: > +5531995321877 > > > Em 26 de set. de 2022, à(s) 15:31, Daniel Joseph < > ogooluwawealth.jo...@gmail.com> escreveu: > > Daniel Joseph > +2348036267282 > > On Mon, 26 Sep

Re: controlling stdout

2020-12-05 Thread Tom Sgouros
Thank you. Now I guess I'll work on figuring out *where* it was redirected. But the "dunder" version of sys.stdout is an excellent clue -- I did not know about that, and bonus gratitude points for giving me a new word to use. -Tom On Sat, Dec 5, 2020 at 9:06 AM Shaheed Haque wr

Re: controlling stdout

2020-12-05 Thread Tom Sgouros
ption to use python scripts because that's what I prefer.) But the fact remains that I have no trouble capturing stdout when I run this python on the command line and it doesn't work when I run it as part of a Django views.py and I don't where to begin trying to understand why not.

Re: controlling stdout

2020-12-04 Thread Tom Sgouros
Anybody have any random thoughts about this? I have run out of ideas to test. Thank you, -Tom On Wed, Dec 2, 2020 at 10:32 PM Tom Sgouros wrote: > Hello all: > > I have a Django application that dispatches processing to a matlab script > using exec. How can I capture the stdout a

controlling stdout

2020-12-02 Thread Tom Sgouros
; Inside a Django method, the exec seems to function properly, but the out and err variables remain empty. Where's my output? Did the logging system snatch it? I assume I'm missing something obvious here but any pointers would be welcome. Thank you, -Tom -- You received this message b

Re: How to best secure environment variables (secret key, passwords etc.) stored in .yml files?

2020-02-07 Thread Tom Moore
Thanks everyone for responding to this question. Nice to know (in a way) that I'm not overthinking it.. although now I'm worried about all the different ways a key could be compromised. Your suggestions for separating out a .env file and using gitignore is really helpful. Tom O

Re: What's a recommended/common approach to staging and production apps in Heroku, using Docker containers?

2020-02-07 Thread Tom Moore
Hi Alvaro, Thanks very much for the suggestion, nice to understand how two containers can be set up to interact with each other. Tom On Thursday, January 30, 2020 at 1:10:02 PM UTC, Álvaro Durán wrote: > > Hi Tom, > I had a similar problem a while ago using React and Django as

How to best secure environment variables (secret key, passwords etc.) stored in .yml files?

2020-01-30 Thread Tom Moore
Hi there, I'm following the guidelines by making sure the environment variables are stored outside of the settings.py files. The project is "dockerised" and so the environment variables have been stored in files *docker-compose.yml* and *docker-compose-prod.yml*. This includes things like the p

What's a recommended/common approach to staging and production apps in Heroku, using Docker containers?

2020-01-30 Thread Tom Moore
Hi there, I'm trying to set up *staging* and *production* apps in Heroku. Nothing fancy, just a way to test the app is running okay on Heroku's platform before it gets pushed to production. The project is containerised in Docker. I've tried setting up a pipeline in Heroku, but when I cli

How to filter a Window query?

2020-01-01 Thread Tom J. Wassing
.annotate(row=row_number) .filter(row_number__range=(1, 10))) Best, Tom -- 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...@g

Django is not working

2019-08-22 Thread Tom Gertin
/apps/config.py", line 120, in create mod = import_module(mod_path) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) ImportError: No module named contrib Help would be appreciated. Also, what is odd is that if I enter the pytho

django-webpack-loader problem

2019-03-04 Thread Tom Zhang
nk/.vscode/extensions/ms-python.python-2019.2.5433/pythonFiles', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/var/www/ocr/venv/lib/python3.6/site-packages'] Server time: Mon, 4 Mar 2019 07:32:14 + Does an

Re: Django template

2019-02-08 Thread Tom Zhang
home.html* (bolded ones is the code you need to connect to your > views.py) > > *{% for news in worlddata %}* > *{{ news.title }}* > > *{% endfor %}* > > -Mikko > > > la 9. helmik. 2019 klo 8.15 Tom Zhang (compute...@gmail.com ) > kirjoitti: > >> Thanks. B

Re: Django template

2019-02-08 Thread Tom Zhang
ate you html files to your templates folder, and in the end you are >> basically using just html. Django can just find your html file from >> templates folder. >> >> Im just learning javascript and I assume i can save my js-file to >> templates folder as well

Re: Django template

2019-02-08 Thread Tom Zhang
just html. Django can just find your html file from > templates folder. > > Im just learning javascript and I assume i can save my js-file to > templates folder as well and connect it to my html. > > -Mikko > > pe 8.2.2019 klo 21.07 Tom Zhang > > kirjoitti: &

Django template

2019-02-08 Thread Tom Zhang
e, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'd

Django template

2019-02-08 Thread Tom Zhang
.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] Thanks, Tom -- You received this message because you are subscribed to the G

Re: New to Django

2018-12-16 Thread tom riddle
Thanks for the responses. I was able to figure this out - I believe my issue was that I did not activate the virtual environment and cd into the folder containing the Django-admin exec file. Once I did that the command worked. On Sun, Dec 16, 2018 at 5:47 AM Okware Aldo wrote: > I can remotely h

Re: Multiple Database Setup problem !?

2018-11-02 Thread &#x27;Tom Evans' via Django users
things, this router doesn't care. Similarly, for allow_relations() you should be returning False when the models should not be related. Incidentally, all python functions return None if the end of the function is reached without an explicit return value, so you never have to end

Re: Help.... Django : Change Backend as mysql and create sample example using django ORM

2018-08-30 Thread Tom Forbes
, August 29, 2018 at 7:26:09 PM UTC+5:30, Tom Forbes wrote: > > What version of MySQL are you running? > > On Tuesday, 28 August 2018 07:00:52 UTC+1, Sonali Vighne wrote: >> >> I will paste full error and stack trace here. >> >> This is occurred when I am givin

Re: Help.... Django : Change Backend as mysql and create sample example using django ORM

2018-08-29 Thread Tom Forbes
What version of MySQL are you running? On Tuesday, 28 August 2018 07:00:52 UTC+1, Sonali Vighne wrote: > > I will paste full error and stack trace here. > > This is occurred when I am giving “python manage.py migrate” command > > > > Operations to perform: > > Apply all migrations: admin, aut

New Uvicorn release. (Alternative to Daphne for Django Channels)

2018-08-14 Thread Tom Christie
Hi folks, I've been putting a lot of work into Uvicorn lately. It's an ASGI server, similar to Daphne, and can be used as the server to run Django channels (amongst other things). https://www.uvicorn.org/ It's got lots of nice behavior around resource limiting, graceful restarts, support for p

SMTPRecipientsRefused: Sender address rejected: not owned by user

2018-05-15 Thread Tom Tanner
I have a Django app running on a server with uWSGI and nginx. In my `local_settings.py` file I have this: ### # EMAIL SETUP # ### EMAIL_HOST = 'smtp.privateemail.com' EMAIL_HOST_USER = 'supp...@mydomain.com' EMAIL_HOST_PASSWORD = 'MY EMAIL PASSWORD

Password reset in Django on nginx server writes to log file instead of sending email

2018-05-14 Thread Tom Tanner
I have a Django app running on a server with uWSGI and nginx. In my `local_settings.py` file I have this: ### # EMAIL SETUP # ### EMAIL_HOST = 'smtp.privateemail.com' EMAIL_HOST_USER = 'supp...@mydomain.com' EMAIL_HOST_PASSWORD = 'MY EMAIL PASSWORD

IOError when trying to send email in Django app

2018-05-11 Thread Tom Tanner
I have a Django app running on a server with uWSGI and nginx. In my `local_settings.py` file I have this: ### # EMAIL SETUP # ### EMAIL_HOST = 'smtp.privateemail.com' EMAIL_HOST_USER = 'supp...@mydomain.com' EMAIL_HOST_PASSWORD = 'MY EMAIL PASSWORD

Re: 400 error, nginx debug log confusion, Django app

2018-05-11 Thread Tom Tanner
I ran `sudo reboot` and `sudo service nginx configtest && sudo service nginx restart`. Now the site loads just fine. I don't know which of those two commands did it. On Friday, May 11, 2018 at 12:22:11 PM UTC-4, Tom Tanner wrote: > > Note: `mydomain.com` is not my real doma

400 error, nginx debug log confusion, Django app

2018-05-11 Thread Tom Tanner
Note: `mydomain.com` is not my real domain name. When I go to `test.mydomain.com`, I get a page that just says `Bad Request (400)`. I'm running a Django app located at `/home/django/product_blog`. Here are the contents of my nginx file at `/etc/nginx/sites-available/BRBR2`. server {

committing migration files

2018-04-30 Thread Tom Scrace
ts against the idea of not committing migration files. I feel like I am missing something. What are some reasons we should go the route of committing migration files? Thanks, Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

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

Trying to understand two messages from `manage.py check --deploy`

2018-04-23 Thread Tom Tanner
I get these two messages after running `python manage.py check --deploy` ?: (security.W001) You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_BROWSER_XSS_FILTER, and SECURE_SSL_REDIRECT sett

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-confirm-html-with-a

Re: Get data from an external api into my database.

2018-03-20 Thread &#x27;Tom Evans' via Django users
l format and store in it and later on use them as when queried. I am > clueless as I am quite new in this development system. Please help if > possible. > Adjust for your needs: data = requests.get(url).json() for datum in data: MyModel.objects.save(**datum) Cheers Tom -- You

Re: Trouble deploying Django/wagtail on Ubuntu 14.04

2018-03-20 Thread &#x27;Tom Evans' via Django users
ROOT to make that in to an absolute path, as the example settings.py tells you to do. Cheers Tom PS - there is very little point anonymising your username when you share the full error report. On Tue, Mar 20, 2018 at 4:14 PM, drone4four wrote: > Thank you, Andreas. I added the python-pa

Re: Running makemigrations in pluggable nested app using AppConfig

2018-03-19 Thread &#x27;Tom Evans' via Django users
nd so this obviously isn't correct. I didn't mention it in the first post, this is for py{27,34,35,36}-dj{108,109,110,111,200}, and developing against py36-dj200 Cheers Tom On Mon, Mar 19, 2018 at 3:35 PM, Tom Evans wrote: > Hi all > > I'm writing a small library whi

Running makemigrations in pluggable nested app using AppConfig

2018-03-19 Thread &#x27;Tom Evans' via Django users
If I replace the path to the appconfig with the dotted path to the module, and then use "makemigrations django_app", then the migrations get created, but obviously that seriously sucks. Furthermore, even with the migration files in place, they are not actually acted upon when running m

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

2018-03-13 Thread Tom Tanner
I'm working on a web page with AngularJS v1.5.6. This page has other forms. I want to add a "Reset password" form to this page. I've seen this Django password reset for tutorial: https://simpleisbetterthancomplex.com/tutorial/2016/09/19/how-to-create-password-reset-view.html. But I'm unsure ho

Re: UUIDs eventually choke as primary key

2018-02-23 Thread &#x27;Tom Evans' via Django users
pull from both places. That would happen if you created your virtualenv with --use-site-packages, it, er, puts the path to the site packages in the pythonpath. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsu

StaticLiveServerTestCase: database emptied after first test after upgrading to Django 1.11

2018-02-23 Thread &#x27;Tom Evans' via Django users
ack[2] and with[3]. Unfortunately, I cannot share much of the code itself. Cheers Tom [1] https://docs.djangoproject.com/en/1.11/topics/testing/overview/#rollback-emulation [2] tests.functional_tests.test_search_defaults.DefaultSearchResult

Attaching `ng-model` to Select widget gives "?undefined:undefined?" `option` value attribute

2018-02-19 Thread Tom Tanner
How do I solve this problem with Django and AngularJS where the first `option` on my `select` tag displays wrong? Full info: https://stackoverflow.com/questions/48872768/attaching-ng-model-to-select-widget-gives-undefinedundefined-option-val -- You received this message because you are subscrib

Stripe problem: InvalidRequestError: This customer has no attached payment source

2018-02-18 Thread Tom Tanner
I've been following the Quickstart guides from Stripe. https://stripe.com/docs/quickstart https://stripe.com/docs/subscriptions/quickstart This is what my form looks like: {% csrf_token %} {% for field in registration_form %} {{ field }} {% if field

Noob question: Is the User model compatible with subscription-style website?

2018-02-14 Thread Tom Tanner
I'm working on a Django-powered subscription website with a Django-powered CMS backend. Can the User model, or a derived class, be made to be compatible with this idea? In my case, I want to store a user's username, password, and subscription ID. -- You received this message because you are s

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

How do I convert an existing column to Foreign Key?

2018-01-29 Thread Tom Tanner
I have two models `model_a` and `model_b`, where their tables look something like this... Table `a` looks something like this -- first row is column names, both contain characters: id | tractce | someString 2 | "0011900" | "Label here" Table `b`: id | tractFIPS 1 | "001

Re: unbound method save() must be called with MyModel instance as first argument

2018-01-23 Thread Tom Tanner
> > class_ = get_model(…) > instance = class_() > instance.save() > > I hope that make sense to you. > > Regards, > C. > > On Jan 23, 2018, at 7:43 PM, Tom Tanner > wrote: > > get_model > > > -- You received this message because you are subscribed to

unbound method save() must be called with MyModel instance as first argument

2018-01-23 Thread Tom Tanner
I'm using `setattr()` to set attributes of a new object of a Django model. obj = apps.get_model(app_label="theme", model_name="MyModel") setattr(obj,"myCol",100) obj.save() I got this error: `TypeError: unbound method save() must be called with DataPopulationTracts2016 instance as f

Re: How do I set the value of a model object's property after using `get_field()`?

2018-01-23 Thread Tom Tanner
_name, 'Test Text') > model_instance.save() > > > Dylan > > > On Mon, Jan 22, 2018 at 5:32 PM, Tom Tanner > wrote: > >> Darn, is this possible with a new object of the model? My idea is to in >> the end let the user input information that

Re: How do I set the value of a model object's property after using `get_field()`?

2018-01-22 Thread Tom Tanner
wrote: > > Hey Tom, > First you'll need to create or get a particular instance of your model > using one of it's managers `model.objects` and a query. Ex for a model > with a unique 'name' charfield: `model_obj = > model.objects.get(name='MyObject&#

How do I set the value of a model object's property after using `get_field()`?

2018-01-21 Thread Tom Tanner
I'm making a terminal command for my Django app: from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import FieldDoesNotExist from django.apps import apps class Command(BaseCommand): def add_arguments(self, parser):

Two command-line questions. How do I get a list of model names? How do I match a user-inputted string with a model name?

2018-01-17 Thread Tom Tanner
I've got the following in `management/commands/my_command.py`: from django.core.management.base import BaseCommand, CommandError from django.conf import settings import os.path, csv from theme.models import * class Command(BaseCommand): def handle(self, *args,

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

2018-01-10 Thread Tom Tanner
Hey everyone, I have a bunch of text files that each have a bunch of columns in common. I plan to import these files into PostgreSQL tables. The website user will be able to send a GET request to query a table and get back data from it. Since most of the tables will have a bunch of columns in c

Re: How do I make a Django model from a tab-delimited data file?

2018-01-10 Thread Tom Tanner
Thanks you two. I'll check out that parser. On Monday, January 8, 2018 at 9:38:44 PM UTC-5, Tom Tanner wrote: > > I have a tab-delimited data file that looks something like this: > > > NAME S1903_C02_001E state county tract State-County-Tract-ID > Census Tract 201, Autaug

How do I make a Django model from a tab-delimited data file?

2018-01-08 Thread Tom Tanner
I have a tab-delimited data file that looks something like this: NAME S1903_C02_001E state county tract State-County-Tract-ID Census Tract 201, Autauga County, Alabama 66000 01 001 020100 01001020100 Census Tract 202, Autauga County, Alabama 41107 01 001 020200 01001020200 Census Tract 203, Autau

Re: How do I use Django to execute PostGIS query to get polygons within four points?

2018-01-08 Thread Tom Tanner
; > You can find all lookups at: > https://docs.djangoproject.com/en/2.0/ref/contrib/gis/geoquerysets/ > > 8.1.2018 2.36 "Tom Tanner" > > kirjoitti: > >> I get this error when trying Jani's example: "FieldError: Unsupported >> lookup 'insi

Re: How do I use Django to execute PostGIS query to get polygons within four points?

2018-01-07 Thread Tom Tanner
I get this error when trying Jani's example: "FieldError: Unsupported lookup 'inside' for MultiPolygonField or join on the field not permitted." On Sunday, January 7, 2018 at 7:33:51 PM UTC-5, Tom Tanner wrote: > > Thanks for replying, Jani. I should mention My `g

Re: How do I use Django to execute PostGIS query to get polygons within four points?

2018-01-07 Thread Tom Tanner
ial queries, so you're looking some of those >> __inside, __within lookups. Coordinate transformations do happen >> automatically so you just need to provide srid for you "envelope". >> >> On Sun, Jan 7, 2018 at 1:48 AM, Tom Tanner > > wrote: >> >>

How do I use Django to execute PostGIS query to get polygons within four points?

2018-01-06 Thread Tom Tanner
Here's a sample PostGIS query I use to get geometries within four points: SELECT * FROM myTable WHERE ST_MakeEnvelope(-97.82381347656252, 30.250444940663296, - 97.65901855468752, 30.29595835209862, 4326) && ST_Transform(myTable.geom, 4326); With this query, I can get all rows within

Re: Hi, a little help here.

2017-12-15 Thread &#x27;Tom Evans' via Django users
Please reply with the full error message. Also, I am pretty sure that when pip fails to build something it also says "Full log message available in /foo/bar/quuz.log". If it does, please also send the contents of that log file. Cheers Tom On Fri, Dec 15, 2017 at 12:41 AM, Aaron

Re: Migrations circular dependency on upgrade to Django 1.11

2017-12-15 Thread &#x27;Tom Evans' via Django users
ch I guess was the real problem?) I now get no circular dependencies (woo!) Unfortunately they still don't run, so that's the next task :( Cheers Tom On Fri, Dec 15, 2017 at 11:37 AM, Tom Evans wrote: > Hi all > > I'm updating a project from Django 1.8 to 1.11, however th

Migrations circular dependency on upgrade to Django 1.11

2017-12-15 Thread &#x27;Tom Evans' via Django users
al complexity I have skipped over because effortless_auth used to be part of "app" and 'app' has had migrations squashed in the past, so many of these migrations have "replaces" attributes also. Cheers Tom -- You received this message because you are subscribed to th

How do I customize the "username already exists" message?

2017-12-03 Thread Tom Tanner
My `forms.py` has a custom user-creation class... class RegisterForm(UserCreationForm): error_messages= { "password_mismatch": _("Passwords do not match."), } Which error message do I need to replace for when the user chooses a username that already exists? -- You received this message beca

Re: How do I customize form error messages?

2017-12-03 Thread Tom Tanner
Nevermind, I figured out I needed to edit `forms.py`. My custom login class... class LoginForm(AuthenticationForm): error_messages= { "invalid_login": _("Incorrect %(username)s/password combo") } # more code here... } On Sunday, December 3, 2017 at 9:46:09 PM UTC

How do I customize form error messages?

2017-12-03 Thread Tom Tanner
In my login form, I have this code: {% if login_form.non_field_errors %} {{ login_form.non_field_errors.as_text|cut:"* "|escape }} {% endif %} If a user enters the wrong username/password combo, the error reads like this: 'Please enter a correct username and password. Note that both fields

Re: Login form error not showing up for wrong username/password combo

2017-12-03 Thread Tom Tanner
That did it. On Saturday, December 2, 2017 at 10:59:58 PM UTC-5, Constantine Covtushenko wrote: > > Hi Tom, > > It seems like your are trying to show error that relates to form rather to > particular field. > I see '__all__' key in example from console. > > A

Login form error not showing up for wrong username/password combo

2017-12-01 Thread Tom Tanner
I have this code in my login form. {% for field in login_form %} {{ field }} {% if field.errors %} {{ field.errors.as_text|cut:"* "|escape }} {% endif %} {% endfor %} The user must enter a valid email address in the "username" field. If the user enters a string not formatted like an e

Re: How do I customize registration form HTML?

2017-12-01 Thread Tom Tanner
ame', > 'class':'yourInputFieldClassName'})) > > > > Yingi Kem > > On 1 Dec 2017, at 1:50 AM, Tom Tanner > wrote: > > The HTML for the user registration form looks like this: > > {% csrf_token %} > {{ registration_form.as_p }} >

How do I customize registration form HTML?

2017-11-30 Thread Tom Tanner
The HTML for the user registration form looks like this: {% csrf_token %} {{ registration_form.as_p }} Register I understand that the `registration_form.as_p` line automatically gives me the form's HTML. But I'd like to customize that HTML. For instance, I'd like the label text to be placeh

Re: Why does Django say my login form is invalid? How can I find out why Django thinks it is?

2017-11-29 Thread Tom Tanner
I removed that line, but nothing changed. On Wednesday, November 29, 2017 at 11:58:28 PM UTC-5, Matemática A3K wrote: > > > > On Thu, Nov 30, 2017 at 12:35 AM, Tom Tanner > wrote: > >> What would I need to change? >> >> I tried changing the ... &

Re: Why does Django say my login form is invalid? How can I find out why Django thinks it is?

2017-11-29 Thread Tom Tanner
What would I need to change? I tried changing the ... fields= ("username",) ... to ... fields= ("username","email",) or... fields= ("email",) Nothing seemed to change. the `login_form.is_valid()` still is `False`. Sorry if the question is dumb, I'm still learning Django thru working with it.

Why does Django say my login form is invalid? How can I find out why Django thinks it is?

2017-11-28 Thread Tom Tanner
My `forms.py` looks like this. (I want user's email to be their login username. from django.utils.translation import ugettext_lazy as _ from django import forms from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.models import User class LoginForm(AuthenticationFor

Re: How do I limit my login form to just email and password?

2017-11-26 Thread Tom Tanner
Adding `exclude=["username"]` does nothing. Same if I replace "username" with "email" or "user". On Sunday, November 26, 2017 at 2:44:44 PM UTC-5, Matemática A3K wrote: > > > > On Sun, Nov 26, 2017 at 12:55 AM, Tom Tanner > wrote: > &g

How do I limit my login form to just email and password?

2017-11-25 Thread Tom Tanner
My `models.py` has this: class MyUser(AbstractBaseUser): email= models.CharField(max_length=254, unique=True) USERNAME_FIELD= "email" My `forms.py` has this: class LoginForm(AuthenticationForm): email= forms.EmailField(label=_("Email"), max_length=254) class Meta: model= MyUser fields= ("

Re: How can I learn to make a user login?

2017-11-25 Thread Tom Tanner
ter form. So how do I make the login form? On Saturday, November 25, 2017 at 3:14:25 PM UTC-5, Daniel Roseman wrote: > > On Saturday, 25 November 2017 19:59:10 UTC, Tom Tanner wrote: >> >> To put it another way: Is there something like `UserCreationForm`, but >> for loggi

Re: How can I learn to make a user login?

2017-11-25 Thread Tom Tanner
To put it another way: Is there something like `UserCreationForm`, but for logging in users? On Saturday, November 25, 2017 at 2:20:11 PM UTC-5, Tom Tanner wrote: > > I guess what I mean is... > > What’s function do I need to use that: > A) logs in the user > B) returns an

Re: How can I learn to make a user login?

2017-11-25 Thread Tom Tanner
I guess what I mean is... What’s function do I need to use that: A) logs in the user B) returns an error if there’s a problem logging in? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

How can I learn to make a user login?

2017-11-25 Thread Tom Tanner
I've read this tutorial on making a simple user registration form. But what about a form for just logging in existing users? I can make a registration form with `views.py` looking like this: regi

Re: How do I make Django show the "user already exists" message when someone tries to register with an existing username?

2017-11-24 Thread Tom Tanner
Thanks for replying. Looks like it'll be easier for me to combine these into one view. On Thursday, November 23, 2017 at 7:13:16 PM UTC-5, Tom Tanner wrote: > > My `urls.py` has this: > url("^login_register/$", views.login_register, name="login_register"), &

How do I make Django show the "user already exists" message when someone tries to register with an existing username?

2017-11-23 Thread Tom Tanner
My `urls.py` has this: url("^login_register/$", views.login_register, name="login_register"), url("^register/$", views.register, name="register"), `views.py` has this: def login_register(request, template="pages/login_register.html"): ''' Display registration and login forms ''' registration_f

Re: How do I make my form send a POST request to a specified view?

2017-11-23 Thread Tom Tanner
Thanks, k2, this helped. On Thursday, November 23, 2017 at 5:22:43 PM UTC-5, k2527806 wrote: > > login_register.html : > > > {% csrf_token %} > {{ registration_form.as_p }} > Register > > > > On Nov 24, 2017 1:42 AM, "Tom Tanner" >

How do I make my form send a POST request to a specified view?

2017-11-23 Thread Tom Tanner
My page has a registration form at `"/login_register/"`. I want the form to send a POST request to `"/register/"`. Here's my code so far. `urls.py`: url("^login_register/$", views.login_register, name="login_register"), url("^register/$", views.register, name="register"), `views.py`: def login_

Re: How do I customize a user registration form so it only requires email and password fields?

2017-11-20 Thread Tom Tanner
form and reentered the email I used, the page refreshed and put this message above the form: `"My user with this Email already exists."`. So Django makes the user, but there's a problem with processing stuff after the user's creation, I guess? On Monday, November 20, 2

Re: How do I customize a user registration form so it only requires email and password fields?

2017-11-20 Thread Tom Tanner
1:30:51 PM UTC-5, Amitesh Sahay wrote: > > Hello Tom, > > Django comes inbuilt with user authentication functions which is almost > more than enough in most of the requirements. > In your case, you just need to import User model in models.py and in > views.py under "if&qu

How do I customize a user registration form so it only requires email and password fields?

2017-11-19 Thread Tom Tanner
I'm following this [tutorial](https://simpleisbetterthancomplex.com/tutorial/2017/02/18/how-to-create-user-sign-up-view.html) on making simple registration forms in Django. I'd like to make a user registration form that requires only two fields: "Email" and "Password." No second password field

How to save user permissions from custom user edit form

2017-11-04 Thread DJ-Tom
Hi, I have created the following user form for my custom user model: class UsersForm(ModelForm): class Meta: model = UserAccount fields = ('is_active', 'is_superuser', 'is_templog', 'is_crewreg', 'is_spaceman','first_name', 'last_name', 'company', 'address1'

Re: Remove/undo a multi table inheritance

2017-11-02 Thread &#x27;Tom Evans' via Django users
o the underlying structure of the tables, and hence any performance characteristics will not change, so why bother? Cheers Tom On Thu, Nov 2, 2017 at 9:11 AM, wrote: > Hi, > > I have introduced a multi table inheritance in the past. Now I am trying to > remove it again by adding an ex

Re: CSRF and API Calls

2017-09-25 Thread Tom Gorup
y applying the @csrf_exempt decorator > to the corresponding view functions. > > Maybe you could create a view that returns only the CSRF token (through > AJAX?) that you can utilize as needed? > > > > *From:* django...@googlegroups.com [mailto: > django...@google

CSRF and API Calls

2017-09-22 Thread Tom Gorup
I'm having a bit of an issue. I'm attempting to utilize a Javascript/React App to interact with a Django backend without the use of templates (hence no {%csrftoken%} available). As I understand CSRF middleware, the CSRF token comes with the form on the GET and is provided in the POST; however,

Re: Bizarre URL behaviour after deploying

2017-08-31 Thread &#x27;Tom Evans' via Django users
raction I fear. I think you will be surprised. I'm surprised your diagnosis doesn't point you at this straight away, if the URLs are correct on one site but incorrect on another site, and both sites run the exact same python/django code, then the error is certainly in the bits that ar

Re: A lot of Problems with Migrating (conceptual)

2017-08-23 Thread &#x27;Tom Evans' via Django users
and all of them imported in the __init__. You should split your app when it is no longer cohesive (or more accurately, when the level of cohesion is upsetting and/or slows development). 2SoD is good, but its not a holy text! Cheers Tom PS Make sure you have a sensible workflow for migratio

Re: TypeError: __init__() takes 2 positional arguments but 3 were given (django-material)

2017-07-28 Thread &#x27;Tom Evans' via Django users
Your error refers to part of a class you haven't included, ClientsForm, and it has an error to do with a class called Stacked, which you haven't shown where it is imported from. Hard to diagnose further.. Cheers Tom On Thu, Jul 27, 2017 at 1:02 AM, Elias Coutinho wrote: > Tr

Re: serving over either 80 or 443

2017-07-20 Thread &#x27;Tom Evans' via Django users
80 or 443 and adjust the href accordingly? > For links within the same site, use relative URLs. For resources on other sites, use protocol relative URLs, like: //www.foo.com/foo/bar The resource will be loaded using whatever protocol the page requesting it was loaded with. Cheers Tom

Re: How to get extra data in clean_data?

2017-07-18 Thread &#x27;Tom Evans' via Django users
o/contrib/auth/forms.py#L64"; Perhaps reading some simple documentation about HTML might be more assistance than asking several thousand people to do it for you? Anyway - Anchors: http://html.com/anchors-links/ Cheers Tom -- You received this message because you are subscribed to the

Re: How to get extra data in clean_data?

2017-07-18 Thread &#x27;Tom Evans' via Django users
-validating-fields-that-depend-on-each-other Cheers Tom On Tue, Jul 18, 2017 at 10:19 AM, 李余通 wrote: > My mind is here: > > class Register(forms.Form): > passwd = > forms.CharField(max_length=20,label='密码',widget=forms.PasswordInput) > repasswd = > forms.Char

Re: How to create a fixed-length binary field with a unique constraint?

2017-07-13 Thread &#x27;Tom Evans' via Django users
tes return name, path, args, kwargs def db_type(self, connection): return "binary(%d)" % self.nbytes For more details, check out the docs on custom fields: https://docs.djangoproject.com/en/1.11/howto/custom-model-fields/ Cheers Tom -- You received this message because y

Re: django implementation group by every two hours,

2017-07-13 Thread &#x27;Tom Evans' via Django users
I > want to group by more than one hour interval. You realise your "day" parameter is actually hours, right? .extra({'day', 'TRUNC(EXTRACT(hour FROM violation_time) / 2)'}) 'day' will then be the 0-based index of the 2 hour periods, starting from midnight

Re: save cropped image with PIL to database

2017-07-13 Thread &#x27;Tom Evans' via Django users
.. > _photo.file = resized_image > _photo.save() so this doesn't work. You will need to wrap the PIL.Image file-like object with the django File class (remember appropriate imports): _photo.file = File(resized_image) _photo.save() Cheers Tom -- You re

Re: Vim plugin that does Django code completion?

2017-07-13 Thread &#x27;Tom Evans' via Django users
Hi Robert Ignore the helpful people telling you to stop using vim and use some god awful UI, the plugin you are looking for is called jedi.vim https://github.com/davidhalter/jedi-vim Debian has a package, vim-python-jedi, or you can install using Pathogen or Vundle. Cheers Tom On Fri, Jul 7

Re: value of checkbox aren't saved in the form

2017-05-31 Thread &#x27;Tom Evans' via Django users
Your checkbox fields on the form are "market" and "sector", but your "Parameters" model doesn't have fields with those names, and you aren't doing anything with the values from the form in your save() method. Where were you expecting those checkboxes t

Re: How to fix "plural forms expression could be dangerous"

2017-05-18 Thread &#x27;Tom Evans' via Django users
You need to change INTEGER and EXPRESSION for the correct values. I believe for zh you want "nplurals=1; plural=0;" Cheers Tom On Thu, May 18, 2017 at 7:41 AM, Martin Brochhaus wrote: > Hi everyone, > > in my project, I am generating my .po files like this: > > pyth

Re: Django Deployment showing list of directory

2017-05-08 Thread &#x27;Tom Evans' via Django users
__init__.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── my_virtual_env The only directory of those that should be web accessible is htdocs, and none of your code should live there. Cheers Tom -- You received this message because you are subscribed to the

Re: Unicode error in __unicode__(self) function

2017-05-08 Thread &#x27;Tom Evans' via Django users
What data is "Jón"? Is it u'J\xf3n' or something else? (print repr(self.fname)) Cheers Tom On Mon, May 8, 2017 at 5:10 PM, rmschne wrote: > I have a Django setup that has worked for a very long time. Yesterday I > upgraded from Django 1.10 to 1.11.1 and am gettin

  1   2   3   4   5   6   7   8   9   10   >