How to use different templates for different sites/domains

2024-05-28 Thread Antonis Christofides
Hello, I use the sites framework for a Django project that serves many different domains. But each of those domains has some templates overridden. If I used a different instance of Django (i.e. a different gunicorn service) for each domain, I'd have different settings for each site. But I'm

Re: How to roll back related objects if any error happened.

2022-07-05 Thread Antonis Christofides
y bad request at the serializer validation level is avoided and there is no need to go back. Anyway, If you think that my claim above is false, I would like to hear your opinion. Kind regards, Sencer HAMARAT On Tue, Jul 5, 2022 at 3:49 PM Antonis Christofides wrote: Could you show the

Re: How to roll back related objects if any error happened.

2022-07-05 Thread Antonis Christofides
Could you show the code with your attempt to use atomic? On 05/07/2022 14.45, Sencer Hamarat wrote: Hi, I tried that but, when child_serializer.save() throws an exception, the row created by parent_serializer.save() at the database is not rolled back. Kind regards, Sencer HAMARAT On

Re: server can't connect in browser

2022-06-22 Thread Antonis Christofides
Hello, If you insist on working this way, there are two things you need to do: 1. You need to run it with "python manage.py runserver 0.0.0.0:8002". 2. 127.0.0.1 is the wrong address. Find the IP address of the server and use that one. Typically, when developing (and especially when we're

Re: variable inside a template

2022-06-16 Thread Antonis Christofides
What you are trying to do is very unusual, and any solution to exactly what you are asking is going to be an ugly hack. So, why do you want to do this? What are these static files that you have in mylist? On 16/06/2022 14.09, luca72.b...@gmail.com wrote: Hello i have a list like: mylist = 

Re: static file serve nothing is load in deployment

2022-06-15 Thread Antonis Christofides
6/2022 13.54, luca72.b...@gmail.com wrote: no i'm not in production i'm running with runserver Il giorno mercoledì 15 giugno 2022 alle 12:45:54 UTC+2 Antonis Christofides ha scritto: Is this in production? Are you using apache or something? if yes, please take a look at https://dja

Re: static file serve nothing is load in deployment

2022-06-15 Thread Antonis Christofides
Is this in production? Are you using apache or something? if yes, please take a look at https://djangodeployment.readthedocs.io/en/latest/_images/how-static-files-work-apache.png. Otherwise, please explain in more detail what your deployment environment looks like. On 15/06/2022 13.08,

Re: I can't use accented letters in my model

2022-06-14 Thread Antonis Christofides
ble, say titolo, and I want to write book.title = titolo. It gives error. How can I do, when the assignment on the right is not a constant ? Thanks in advance Il giorno venerdì 10 giugno 2022 alle 15:25:51 UTC+2 Antonis Christofides ha scritto: Hello, try this:

Re: I can't use accented letters in my model

2022-06-10 Thread Antonis Christofides
It is highly recommended that you instead just switch your application to Unicode strings. Il giorno giovedì 9 giugno 2022 alle 23:17:16 UTC+2 Antonis Christofides ha scritto: Please read my email again. Antonis Christofides +30-6979924665(mobile) On 09/06/2022 22.2

Re: I can't use accented letters in my model

2022-06-09 Thread Antonis Christofides
Please read my email again. Antonis Christofides +30-6979924665 (mobile) On 09/06/2022 22.27, Virgilio Ravagli wrote: All right. class Book(models.Model):        code = models.PositiveIntegerField(primary_key=True)        title = models.CharField(max_length=60,blank=False,null=False) book

Re: I can't use accented letters in my model

2022-06-08 Thread Antonis Christofides
Please provide the minimum code that reproduces the problem, and the full traceback. Regards, Antonis On 08/06/2022 18.24, Virgilio Ravagli wrote: ou must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings -- You received this message because you

Re: Need help

2022-06-01 Thread Antonis Christofides
Hello, If, as I understand, you don't know anything about deployment, a possible starting point is the book at https://djangodeployment.com (disclaimer: I am the author). It doesn't cover docker, and it also doesn't cover continuous development with gitlab. But you can start with the basics

Re: Please criticise use of global keyword in Admin

2022-05-19 Thread Antonis Christofides
Hi, First of all, you should type REC_FIELDS and CONS_FIELDS, in capitals, as these are constants (this is not a Python language requirement but widely used style, also suggested by PEP8 iirc). Then, it seems to me that most of the times you don't need the "global" keyword in your code,

Re: Virtualenv steup

2022-05-12 Thread Antonis Christofides
Is Python working? If you type "python", does Python start? If yes, you can try reading about virtualenv here: https://djangodeployment.com/2016/11/01/virtualenv-demystified/ Regards, Antonis On 12/05/2022 13.42, Priyanshu Ganwani wrote: Hy is any one there as a beginner i  have install

Re: Django 3.0 -> 3.1 performance degradation

2022-05-05 Thread Antonis Christofides
Hi! This is a very interesting problem, and I'm afraid I'm not qualified to answer it. What I'd like to point out is that, if I had done all the work that you seem to have done, I would be tempted to start bisecting in between versions 3 and 3.1 in order to find the exact commit that causes the

Re: SMTP Authentification error

2022-05-02 Thread Antonis Christofides
If some emails are emails are disappearing, you may get ideas on how to fix it from https://djangodeployment.com/2017/01/18/why-does-django-not-email-me-the-500-internal-server-error/ On 02/05/2022 07.33, 'Delvin Alexander' via Django users wrote: Improvements! i fixed my settings.py file and

Re: 'ascii' codec can't encode character

2022-04-29 Thread Antonis Christofides
Hi, could you post the full traceback? And if some part of this traceback refers to your code, it would be a good idea to also show us that part of your code. On 29/04/2022 03.01, Thiago Luiz Parolin wrote: Hi, i have a model with 2 charfields for givenname, surname:    nome =

Re: SMTP Authentification error

2022-04-28 Thread Antonis Christofides
In my experience, Gmail does not allow (or does not support) using it as a smarthost if all you have is a free account, and even if you get it to work it will eventually cause you headaches. I don't know if this has changed the last few years, but I feel it hasn't. It's much better to use

Re: simple command line ./manage.py shell puzzle

2022-04-25 Thread Antonis Christofides
LTS Django version: 2:2.2.12-1ubuntu0.11 Django shell version: Python 3.8.10 Chris On Friday, April 22, 2022 at 2:00:17 AM UTC-5 Antonis Christofides wrote: It works fine here. I entered your commands exactly and the second one does not provide any output. What shell do you have

Re: Connection timeout error with Postgres

2022-04-24 Thread Antonis Christofides
is on a difference machine than Django. I have noticed that initial connections are successful but it fails in the later connections mainly in long running jobs. Thanks, Disha On Friday, April 22, 2022 at 12:19:27 PM UTC+5:30 Antonis Christofides wrote: Hi! I shall assume that PostgreSQL is listening

Re: SMTPConnectError

2022-04-24 Thread Antonis Christofides
Indeed, I don't know how it is nowadays, but a few years ago Gmail did not allow (or did not support) using it as a smarthost if all you had was a free account. This means that even if you get it to work it will stop working the next day or month. On 24/04/2022 16.15, Jason wrote: how many

Re: simple command line ./manage.py shell puzzle

2022-04-22 Thread Antonis Christofides
It works fine here. I entered your commands exactly and the second one does not provide any output. What shell do you have? And what version of Python and Django? And what OS? On 21/04/2022 22.28, cseb...@gmail.com wrote: Yes I agree.  But why does it complain that datetime doesn't exist

Re: Connection timeout error with Postgres

2022-04-22 Thread Antonis Christofides
Hi! I shall assume that PostgreSQL is listening on port 5432. "Connection timed out" means that the client (Django/psycopg2 in this case) is not getting any response—as if the PostgreSQL server machine did not exist. ("Connection refused", on the other hand, means that the PostgreSQL server

Re: Possible Django Admin or auth bug or Mozilla bug

2022-04-14 Thread Antonis Christofides
hat a try and see what happens. Cheers Mike On 13/04/2022 11:19 pm, Antonis Christofides wrote: It happens here as well as far as I can see (tested on a Debian 1

Re: delete button

2022-04-14 Thread Antonis Christofides
PM Antonis Christofides wrote: What is `test_func()`? In addition, if you want people to help you, it would be a good idea to help them by giving them the smallest possible amount of code that reproduces the problem. (In fact, whenever I do that, in about 50% of cases I

Re: Possible Django Admin or auth bug or Mozilla bug

2022-04-13 Thread Antonis Christofides
It happens here as well as far as I can see (tested on a Debian 11 server running Django 3.2.12). The "Chosen groups" box seems to be created by JavaScript; if I run it with JavaScript disabled then it doesn't exist. Apparently JavaScript creates the box and then populates it and accordingly

Re: delete button

2022-04-13 Thread Antonis Christofides
What is `test_func()`? In addition, if you want people to help you, it would be a good idea to help them by giving them the smallest possible amount of code that reproduces the problem. (In fact, whenever I do that, in about 50% of cases I solve the problem myself during the reduction

Re: sort by alphabet

2022-04-11 Thread Antonis Christofides
Please read the documentation of order_by(). It tells you how you can do this. On 11/04/2022 20.15, divya murugulla wrote: that is not working since my sort function is of different table On Monday, April 11, 2022 at 10:44:14 PM UTC+5:30 Antonis Christofides wrote: Same thing, use

Re: sort by alphabet

2022-04-11 Thread Antonis Christofides
(cmdty_loc_id__in=LatamLocationIds) ] how to sort these values On Monday, April 11, 2022 at 10:00:50 PM UTC+5:30 Antonis Christofides wrote: Hi, You need to replace queryset=GlobePlant.objects.all() with queryset=GlobePlant.objects.all().order_by(...) I can't tell you

Re: sort by alphabet

2022-04-11 Thread Antonis Christofides
Hi, You need to replace queryset=GlobePlant.objects.all() with queryset=GlobePlant.objects.all().order_by(...) I can't tell you what arguments to give "order_by()" without seeing your GlobePlant model, but if you read Django's documentation for order_by you should be able to determine

Re: Calculated Fields

2022-04-11 Thread Antonis Christofides
As was found out with the conversation with Mike Dewhirst, the error appears to be because of wrong understanding of operator precedence . That's easy to correct with parentheses. Except for that, I wouldn't do it that

Re: Error during template rendering

2022-04-10 Thread Antonis Christofides
Hi! The error message 'relation "curriculum_standard" does not exist' has been produced by PostgreSQL, and Django merely repeats it. In other words, Django is telling you that while it was doing what it was doing, an error occurred in the RDBMS, and it is showing you the error message that

Re: Django Foreign key field require dependent on another datetime field

2022-04-09 Thread Antonis Christofides
Hi, you can override the model's save() method . It's something that should be done in the backend. Relying on the front end is a bad idea, because then errors in the front end would lead to inconsistencies in

Re: NameError:

2022-04-08 Thread Antonis Christofides
Hi! In the line where the error occurs, Pharmacist has not been defined yet. Move your Pharmacist model before your Patients model. Regards, Antonis On 08/04/2022 20.49, tech george wrote: Hello, I've been struggling with the below error, what might be the problem? I have used the same

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

2022-04-04 Thread Antonis Christofides
This looks strange, although I'm not familiar with exactly this particular use case. I'm assuming you are referring to multi-table inheritance. Are you certain Django 1.5 wasn't creating these tables? Was it using migrations or South maybe? (Obviously I don't remember when Django started

Re: Is Overriding widget templates buggy?

2022-04-03 Thread Antonis Christofides
Hi, I'm not really an expert in that part. From what I can read in the documentation, TemplatesSetting isn't a template backend, so why do you think you can specify it in TEMPLATES[x]['BACKEND']? It appears to be a form renderer, which means you can specify it in FORM_RENDERER. But of

Re: django.db.utils.OperationalError: index row requires 45344 bytes, maximum size is 8191

2022-04-02 Thread Antonis Christofides
Sorry, which model is causing the problem? Which is the model that started giving you errors when you added the Meta? Antonis Christofides +30-6979924665 (mobile) On 02/04/2022 15.00, Sunday Ajayi wrote: Hi Antonis below is my model definition: from django.db import models from

Re: django.db.utils.OperationalError: index row requires 45344 bytes, maximum size is 8191

2022-04-01 Thread Antonis Christofides
Hi, could you show the definition of your model? Antonis Christofides +30-6979924665 (mobile) On 02/04/2022 00.43, Sunday Ajayi wrote: Hi Team, Please I am having the error below from django - postgresql: django.db.utils.OperationalError: index row requires 45344 bytes, maximum size

Re: Difference in datetime with timezone

2022-03-30 Thread Antonis Christofides
Python standard library module. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 29/03/2022 17.51, Andrés Alvarez wrote: I need to save some fields in my database in the format YYY-MM-MM 00:00:00+00. So I decide to do this: # setting.py TIME_ZONE = 'America/Mexico_City' USE_I18N

Re: Difference in datetime with timezone

2022-03-28 Thread Antonis Christofides
. You can use pprint for that. If it doesn't work on OrderedDicts, convert it to a simple dictionary before pretty printing. 3. Likewise, do something so that your SQL statement is more readable, such as manually inserting newlines and indents. Regards, Antonis Antonis Christofides +30-6979924665 (mobile)

Re: Question regarding adding language support to webapp based on Django

2022-03-28 Thread Antonis Christofides
think it would be better just to experiment and see what it does. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 23/03/2022 08.32, Guan Zhang wrote: Hi all: I'm trying to help the developer of a Django-based webapp with adding additional language support and have some

Re: Supertypes, subtypes and authentication

2022-03-22 Thread Antonis Christofides
get_object do? What is an "object"? What would be a better name for "UserPassesTestMixin"? Maybe "UserIsAuthorized"? Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 22/03/2022 14.49, 'AnneVerm' via Django users wrote: I'm working on a web aplicati

Re: runserver not working

2022-03-22 Thread Antonis Christofides
pened. Try "python manage.py runserver" instead. Antonis Christofides +30-6979924665 (mobile) On 22/03/2022 07.07, 'Delvin Alexander' via Django users wrote: would anyone know why my "manage.py runserver" is not working? Every time i try running it on the command prompt,

Re: mysql 8 file creation issue

2022-03-18 Thread Antonis Christofides
client you are using) as the same operating system user as the one who will read and write the csv file later. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 18/03/2022 06.48, Aadil Rashid wrote: When I run this query on mysql 5.7: SELECT CURDATE() INTO OUTFILE '/var/lib/m

Re: How do detect if template is being viewed on mobile device?

2022-03-17 Thread Antonis Christofides
the screen into account). This problem has nothing to with Python and Django, it's merely a HTML+CSS issue. If you don't want to learn much CSS, using a CSS framework like Bootstrap can help. Regards, Antonis Antonis Christofides On 16/03/2022 22.42, Django2021 wrote: > There are many way

Re: How do detect if template is being viewed on mobile device?

2022-03-16 Thread Antonis Christofides
Hello, there are many ways to approach this problem, so it would be best to explain what you are trying to achieve. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 16/03/2022 22.28, Django2021 wrote: With Django how is it possible to detect * if template is being viewed

Re: How Important Is Writing Unit Tests For Django Applications?

2022-03-13 Thread Antonis Christofides
ence, but I always wonder whether I'm testing insufficiently or whether I'm testing too much. I didn't expect this reply to become that long, neither that I would not answer the question in the end. I hope it was helpful anyway. Good luck! Antonis Christofides +30-6979924665 (mobile) O

Re: Update to Tutorial 4 - Generic Views

2022-03-11 Thread Antonis Christofides
Hello, why do you say that importing of TemplateView is missing? I don't see TemplateView being used anywhere in that page. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 11/03/2022 07.42, Dan Cox wrote: Hi I've been searching on how I might contribute to the tutorials

Re: How to add object to users unique list?

2022-02-28 Thread Antonis Christofides
Hello! Are you using class-based views? Does your view have a post() method? I searched the web for `django "method not allowed (POST)"` and this is the first result that came up: https://stackoverflow.com/questions/52244156/method-not-allowed-post-in-django Regards, Antoni

Re: How to create dynamic models in django??

2022-02-26 Thread Antonis Christofides
doing such things—it's likely to lead to an unmanageable code mess. Keep it simple. Consider working without a relational database. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 27/02/2022 05.40, Prashanth Patelc wrote: How to create dynamic models in django rest framework

Re: Login & Register

2022-02-26 Thread Antonis Christofides
Hello, A discussion about this occurred just a few days ago (less than a week) in this list. Take a look at the archives. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 26/02/2022 17.09, Ankit Chaurasia wrote: Hey, I am new in Djnaog and I want to make Login and Register

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-26 Thread Antonis Christofides
in a more simple manner to the user (because 100 forms would be overwhelming I guess). Once I have a saner UI, the implementation details would follow naturally. Antonis Christofides +30-6979924665 (mobile) On 26/02/2022 05.43, Jacob Greene wrote: You would need to cache the queryset and pass

Re: Email verification

2022-02-23 Thread Antonis Christofides
You can try django-registration-redux . Regards, Antonis On 23/02/2022 17.10, Rushikesh Chavan wrote: I am new to django, i am working on one project which requires a feature of email verification  , how do I do it? Like , I want

Re: Need help in User log in, someone please help

2022-02-22 Thread Antonis Christofides
mail=email, password = password) but for that you need to know how to use pdb. It's quite simple though tricky at first. Eventually you will need to learn it, however, so now would be a good time. Search the web. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 22/02/2022

Re: Needs help

2022-02-22 Thread Antonis Christofides
take some time to read http://www.catb.org/~esr/faqs/smart-questions.html. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 22/02/2022 11.30, loic ngounou wrote: Please how to turn a picture into a LEGO version? A project that does this will be welcome. -- You received

Re: collectstatic files chown'ed by root

2022-02-14 Thread Antonis Christofides
root. Something else is going on. Could you share your entrypoint.sh script? Antonis Christofides +30-6979924665 (mobile) On 14/02/2022 13.14, 'Tim' via Django users wrote: Hi all, I'm deploying Django 4 via docker-compose. For security reasons, the Dockerfile creates a non-root

Re: Formsets?!?!?!?!?!?!?!?!?!?

2022-02-12 Thread Antonis Christofides
the 12-13 dropdowns had hundreds of options. Imagine this:       Antonis Christofides     Steve Smith     [... 300 more options here]   all this repeated 13 times. There wasn't that anything in there that was particularly slow, it was the sheer volume of information that made it slow. In

Re: Off topic slightly - Apache https redirect

2022-02-07 Thread Antonis Christofides
{REQUEST_STATUS} == 301" Header always set Expires "Thu, 01 Jan 1970 00:00:00 GMT" "expr=%{REQUEST_STATUS} == 301" Antonis Christofides +30-6979924665 (mobile) On 07/02/2022 23.27, Mike Dewhirst wrote: Yes ... that's almost what I went with after reading up on the topic. I

Re: Resource leaks from FieldFile's implicit open?

2022-02-02 Thread Antonis Christofides
a try-except, but I'm not certain about which exceptions you want to catch. It's probably ValueError and IOError. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 01/02/2022 21.22, Carsten Fuchs wrote: Dear group, despite a lot of reading and searching I still don't understand

Re: In django you can either obtain a `csrftoken` from a cookie or the form can generate a nonce `csrftoken`. How does django validate both?

2021-06-30 Thread Antonis Christofides
ink it would probably work. (This is not a security issue, though, since the user agrees. The problem is when malicious-site.com tries to do something to legitimate-site.com using the user's credentials without the user knowing.) Antonis Christofides +30-6979924665 (mobile) On 01/07/2021 01.48, Pa

Re: In django you can either obtain a `csrftoken` from a cookie or the form can generate a nonce `csrftoken`. How does django validate both?

2021-06-30 Thread Antonis Christofides
ies of another site, so it can't possibly read that cookie and set the hidden field to its value. Antonis Christofides +30-6979924665 (mobile) On 30/06/2021 15.14, Patrice Chaula wrote: In django you can either obtain a `csrftoken` from a cookie. Or the form can generate a nonce `csrftoken`.

Re: Diploy django on DigitalOcean

2021-06-24 Thread Antonis Christofides
Hi, you can try "Deploying Django on a single Debian or Ubuntu server" at djangodeployment.com or djangodeployment.readthedocs.io. Regards, Antonis Antonis Christofides +30-6979924665 (mobile) On 24/06/2021 10.20, Eugene TUYIZERE wrote: Hello Team, I need some tutorials

Re: os module import error

2021-05-31 Thread Antonis Christofides
Hi! Could you show exactly which command(s) you are running, and the exact error message? Regards, Antonis Christofides +30-6979924665 (mobile) On 31/05/2021 17.57, James Ndubuisi wrote: Good afternoon. It seems on creating the Django project using django-admin startproject command

Re: Newbee help on deploying Django App to Apache2

2021-05-30 Thread Antonis Christofides
: * How to setup Apache with Gunicorn <https://djangodeployment.com/2016/11/30/how-to-setup-apache-with-gunicorn/> * Detailed instructions on setting up Gunicorn <https://djangodeployment.readthedocs.io/en/latest/06-gunicorn.html> Antonis Christofides +30-6979924665 (mobile)

Re: Tables missing in SQLite but viewable in admin (confusion)

2021-05-29 Thread Antonis Christofides
(or whatever tool you have) is really the same as the one that is being read by Django. E.g. move the database file somewhere else (and restart Django) and make sure that the data in Django admin is gone. Antonis Christofides +30-6979924665 (mobile) On 29/05/2021 02.56, Ryan Kite wrote: Greetings! Am

Re: Telnet problem

2021-05-27 Thread Antonis Christofides
Google doesn't officially support using its email service as a smarthost (at least not so with free accounts). Therefore some things may be working for a time and then they might stop working. Antonis Christofides +30-6979924665 (mobile) On 27/05/2021 14.27, Mostapha Bouderka wrote: Hi. I

Re: How can I pass input value to view function without forms

2021-05-27 Thread Antonis Christofides
You have a typo somehwere; in the HTML you have "numbered", whereas in the code you have "numberid". Antonis Christofides +30-6979924665 (mobile) On 27/05/2021 13.20, Bhanu prasad Ch wrote: Hello Boris,       I was thinking of passing number from the input to view functio

Re: Best way to deal with members registration in Django apps

2021-05-25 Thread Antonis Christofides
ailing members, again I'd use an external service such as mailchimp, but I have no experience integrating such a service with a Django app. Antonis Christofides +30-6979924665 (mobile) On 25/05/2021 08.02, Ram wrote: Hi, We have members registration module where members will enter email ID as a

Re: Making a rather small web app, is Django right for it?

2021-05-24 Thread Antonis Christofides
think it's mostly a question of what you want: Why do you want to do this project? Is it commercial? Is it a hobby? Is it something you do because you find it appealing? If it's something like a hobby, pick up whatever seems more fun to you. Regards, Antonis Antonis Christofides +30

Re: django utils Integrity error

2021-05-19 Thread Antonis Christofides
Could you show the full error message? Antonis Christofides +30-6979924665 (mobile) On 19/05/2021 02.36, Peter Kirieny wrote: am adding class category in the models.py and adding it as a foreign key in the products model but i get this error while migrating somebody, please help here

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Antonis Christofides
stored in a different "deployment" repository, preferably with any secrets encrypted) in https://www.crowdcast.io/e/deploying-django, from 38m10s to 46m30s. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-03-30 13:06, PASCUAL Eric wrote: > > Hi, >

Re: Sample of GeoDjanco websites

2018-03-20 Thread Antonis Christofides
gs <https://medium.com/gis-tips> can be useful if (like me) you are an OpenLayers>=3 beginner. That's all. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-03-20 00:14, M Hashmi wrote: > I've been searching for one from last couple of weeks and after using > Djnago-ma

Re: Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-27 Thread Antonis Christofides
-x (which you can achieve with "chmod 755 cel2fah" or "chmod g-w cel2fah"). Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-27 07:20, drone4four wrote: > > The username on my droplet is ‘tranq’ but there is a line in both my vhost > config

Re: Contributing to Django

2018-01-25 Thread Antonis Christofides
the django developers irc channel. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-25 09:35, 'Anoosha Masood Keen' via Django users wrote: > Hi, >    I have assigned a ticket to myself. Now what do I need to do ? Fork django > project and create bra

Re: PostrgreSQL Inside Virtualenv

2018-01-25 Thread Antonis Christofides
could clear up some confusion as to what a virtualenv is and what it does. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-24 18:56, johnf wrote: > > I doubt it is possible to install Postgres into virtualenv???  > > At least I'm not aware that it can

Re: Strange the global variable behavior

2018-01-23 Thread Antonis Christofides
Global variables might work with runserver (because it starts threads, not processes, but I'm not certain about that so please correct me), but they're unlikely to work in production, because typically Django is run as at least two WSGI processes. Regards, Antonis Antonis Christofides http

Re: Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-21 Thread Antonis Christofides
om/2016/11/21/how-django-static-files-work-in-production/> may help. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-21 05:00, drone4four wrote: > I’ve played with a little Django (v2.0.1) locally. Now I am trying to > implement a test case on my production

Re: Is CSRF middleware to be taken seriously (from a XSRF point of view)?

2018-01-15 Thread Antonis Christofides
iphered messages. If S is the original message and C = F(S) the ciphered message, you can't reverse the function and find S given C. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-16 00:03, Stephan Doliov wrote: > Just curious, I recently went on a source code study

Re: Running 2 django project in different port number at the same time.

2018-01-15 Thread Antonis Christofides
s the only way to do what you want in development. Production is a whole another story. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-16 06:31, cherngyo...@gmail.com wrote: > As what the title said, is it possible to run 2 django project at the same > ti

Re: Deprecations not listed within release notes

2018-01-15 Thread Antonis Christofides
Hello, was custom_sql_for_model ever documented in the Django documentation? If not, then it is (or was) an internal API. Internal APIs can change without notice, and if you use them you do so at your own risk. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-15

Re: Adding Junk code to your django project

2018-01-11 Thread Antonis Christofides
le to read/modify your code in the first place? Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-11 07:58, ashish.bha...@exponentiadata.com wrote: > Hello, > I have a requirement which says that the user should not be able to > read/modify my code.I thought to

Re: varchar and text

2018-01-10 Thread Antonis Christofides
L, but in PostgreSQL the principles are the same, although the details might differ). Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-10 12:36, Rakhee Menon wrote: > Hello!!! > I am using django with postgresql.. > I am just not getting the difference between var

Re: Handling secret keys in digitalocean

2018-01-10 Thread Antonis Christofides
. deployment, I start treating this issue at 38m10s. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-10 11:34, yingi keme wrote: > I am aware that its a bad idea to put your secret keys and other API keys in > your settinggs.py file. > > In a production

Re: Managing a process from Django

2018-01-08 Thread Antonis Christofides
of Django. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018-01-09 00:00, Kasper Laudrup wrote: > Hi Antonis, > > On 2018-01-08 22:46, Antonis Christofides wrote: >> OK, but why do you need this? What functionality is this going to have? >> > >

Re: Managing a process from Django

2018-01-08 Thread Antonis Christofides
OK, but why do you need this? What functionality is this going to have? Antonis Christofides http://djangodeployment.com On 2018-01-08 23:43, Kasper Laudrup wrote: > Hi Antonis, > > On 2018-01-08 22:10, Antonis Christofides wrote: >> Hello, >> >> When you say &quo

Re: Managing a process from Django

2018-01-08 Thread Antonis Christofides
Hello, When you say "call [an instance of an object]", what exactly do you mean? Could you tell us more about what this class/object is and why you need to "call" (access?) it in an unusual way? Regards, Antonis Antonis Christofides http://djangodeployment.com On 2018

Re: Constant Invalid HTTP_HOST header spam

2017-12-19 Thread Antonis Christofides
fault_server" (usually this is somewhere like /etc/nginx/sites-available/default) that shall contain the certificate and always return 404. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-12-19 14:18, Jon Ribbens wrote: > On Tuesday, 19 December 2017 07:24:23 UT

Re: Constant Invalid HTTP_HOST header spam

2017-12-18 Thread Antonis Christofides
, but I recall having used SSL on Apache before SNI existed and I don't remember any difference with respect to that. Why does SNI affect this? Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-12-19 02:05, Jon Ribbens wrote: > On 18 Dec 2017, at 23:26, Anto

Re: Constant Invalid HTTP_HOST header spam

2017-12-18 Thread Antonis Christofides
, Antonis Antonis Christofides http://djangodeployment.com On 2017-12-18 21:44, Jon Ribbens wrote: > I'm getting spammed with constant "Invalid HTTP_HOST header: '10.9.8.7:443'. > You may need to add '10.9.8.7' to ALLOWED_HOSTS" emails, due to the Internet > being the Internet

Re: Why get "Server Error 500" instead of 404 template?

2017-12-11 Thread Antonis Christofides
atever log, i.e. in whatever program it is that runs Django. For more information, you need to show us your nginx configuration and your wsgi server configuration. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-12-10 18:42, Chris Seberino wrote: > I cannot track down

Re: memory leak in django app?

2017-12-06 Thread Antonis Christofides
production? If, for example, your app loads a whole db table in memory, and this db table has a million records in production and only a few in development, there would be a difference. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-12-06 19:38, Etienne Robillard w

Re: memory leak in django app?

2017-12-06 Thread Antonis Christofides
Does this happen only in production? What about when you run a development server? What is the memory usage of your development server? Antonis Christofides http://djangodeployment.com On 2017-12-06 15:05, Etienne Robillard wrote: > Hi Antonis, > > Thank you for your reply. I installed

Re: memory leak in django app?

2017-12-06 Thread Antonis Christofides
is your Django app consuming? You can find out by executing "top" and pressing "M" to sort by memory usage. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-12-06 14:04, Etienne Robillard wrote: > Hi all, > > I'm struggling to understand h

Re: Password reset to Gmail addresses fails

2017-12-04 Thread Antonis Christofides
Hello, could you show your EMAIL_* settings? (Meanwhile https://djangodeployment.com/2017/01/18/why-does-django-not-email-me-the-500-internal-server-error/ might help.) Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-12-04 11:22, Alastair Campbell wrote: >

Re: How to Speed up Loading the First Page of Django Project?

2017-11-19 Thread Antonis Christofides
Hello, How does the verification work? Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-11-19 02:38, flora.xiaoyun.hu...@gmail.com wrote: > Thank you for your reply. The first page always loads slowly while the rest of > the pages loads at a normal speed. Whe

Re: Django field model for HTML parser?

2017-11-19 Thread Antonis Christofides
application and turn DEBUG off, then you will need to understand how static files work in production <https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/>. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-11-19 01:38, drone4four

Re: static files in production

2017-11-07 Thread Antonis Christofides
Hello, You might find my drawings on how django static files work in production <https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/> helpful. Unfortunately they are only for nginx and apache, but the same principles apply to IIS. Regards, Antonis A

Re: tutorial site refers to a module which does not exist

2017-11-04 Thread Antonis Christofides
e you were experimenting. Try starting again from scratch. Antonis Christofides http://djangodeployment.com On 2017-11-05 00:22, Kyle Foley wrote: > But if you look at the previous page where the apps.py is created > > https://docs.djangoproject.com/en/1.11/intro/tutorial01/ > > you'

Re: tutorial site refers to a module which does not exist

2017-11-04 Thread Antonis Christofides
Hello, This is the second part of the tutorial. In the first part, at some point you were told to execute "python manage.py startapp polls". This should have created an appropriate apps.py file. Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-11-04 23:09,

Re: postgres library in django using jython

2017-11-02 Thread Antonis Christofides
Hi, apparently you are confusing sqlite with postgresql. Could you show the full stack trace and error message, and your DATABASES setting? Regards, Antonis Antonis Christofides http://djangodeployment.com On 2017-11-02 20:23, Felipe Salazar wrote: > Hi all > > I a python develop

  1   2   3   >