Re: How to get two django rest framework to communicate with each other

2018-01-15 Thread cherngyorng
Oh, but the thing is i am doing 1 project, and another person is doing other part of the project. And we have to integrate with each other. So we each have our own db. On Tuesday, January 16, 2018 at 2:34:01 PM UTC+9, Shree Kant Bohra wrote: > > You can use same database for both applications,

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

2018-01-15 Thread cherngyorng
Define ip and port number is this link right : https://docs.djangoproject.com/en/dev/ref/django-admin/#examples-of-using-different-ports-and-addresses Where i have to enter this :django-admin runserver 1.2.3.4:8000 to change its port number and ip ? On Tuesday, January 16, 2018 at 4:12:50 PM UTC

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

2018-01-15 Thread cherngyorng
Then what must i do if i wanted to do it for production side? Is there any link/guide about how to change it ? On Tuesday, January 16, 2018 at 4:00:37 PM UTC+9, Antonis Christofides wrote: > > Hello, > > DATABASES['...']['PORT'] is the port to which the database server is > listening (your djan

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

2018-01-15 Thread Antonis Christofides
Hi, > 1) Write a script that just harvests the middleware token from a form > "protected" with such token and use the value of that as the csrftoken cookie. You visit web site A (the attacker). Web site A wants to send a malicious POST request to site D (a Django app). The thing is that scripts o

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

2018-01-15 Thread Antonis Christofides
Hello, DATABASES['...']['PORT'] is the port to which the database server is listening (your django app is a client of the database, and it connects to that port in order to access the database); it has nothing to do with what you want. AFAIK specifying the port number in "runserver" is the only w

Re: How to get two django rest framework to communicate with each other

2018-01-15 Thread shreekant bohra
You can use same database for both applications, so you don't have to worry about the API and interacting with each other. -- Shree Kant Bohra Co-founder Geekybuddha Technologies On Tue, Jan 16, 2018 at 9:29 AM, wrote: > Ok, maybe i'm confuse about this whole thing. > > So these are my task

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

2018-01-15 Thread Jani Tiainen
No. Development server is not meant to be final serving solution and it doesn't have any configuration besides the command line. 16.1.2018 6.37 kirjoitti: > I found another solution which is running this command > > manage.py runserver 8005 > > But is it possible to do it without writing the com

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

2018-01-15 Thread Jani Tiainen
Hi. If you want to run two devservers just define ip and port number when launching devserver. 16.1.2018 6.32 kirjoitti: > As what the title said, is it possible to run 2 django project at the same > time ? > > My task is this: > Integration of django 1 api and django 2 api, to setup two djan

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

2018-01-15 Thread cherngyorng
I found another solution which is running this command manage.py runserver 8005 But is it possible to do it without writing the command and just do it in the settings.py or other file ? On Tuesday, January 16, 2018 at 1:31:20 PM UTC+9, chern...@gmail.com wrote: > > As what the title said, is it

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

2018-01-15 Thread cherngyorng
As what the title said, is it possible to run 2 django project at the same time ? My task is this: Integration of django 1 api and django 2 api, to setup two django app, on same server / PC, with different port As far from what i know, i can change the port number in the settings.py database

Re: How to get two django rest framework to communicate with each other

2018-01-15 Thread cherngyorng
Ok, maybe i'm confuse about this whole thing. So these are my task - Integration of django 1 api and django 2 api, to setup two django app, on same server / PC, with different port - Integration of django 1 api and django 2 api, to setup two django app, on same server / PC, with different datab

Re: How to get two django rest framework to communicate with each other

2018-01-15 Thread cherngyorng
>From what i read at the django documentation, there is only combine database where user get to choose which table save to which db. As both app user table is meant for different people, django 1 is for normal user and django 2 is for staff/doctor. There is also limitation to combine database t

Clarification on __in when attribute on left is a many to many field

2018-01-15 Thread Jeff Tchang
In the documentation on this page: https://docs.djangoproject.com/en/2.0/topics/db/examples/many_to_many/ you have the following example: >>> Article.objects.filter(publications__in=[1,2]).distinct()>> [, >> Python>]> Does the __in for many to many fields mean for ANY publication in [1,2]. So

New release of django-ai: Spam Filtering systems

2018-01-15 Thread Matemática A3K
I’m very happy of announcing the second release of django-ai: Artificial Intelligence for Django. https://github.com/math-a3k/django-ai https://django-ai.readthedocs.io/en/latest/readme.html The main exciting features of this version are Spam Filtering systems and Classification with Support Vec

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

2018-01-15 Thread Stephan Doliov
Just curious, I recently went on a source code studying binge and took a look at the CSRF middleware that comes with Django. I appreciate the work and effort of the authors, but I am not sure I gain anything by deploying it to my site. Here is why: The middleware token assigned to a form and to

Re: Error when i try to run migrate for my model

2018-01-15 Thread Jason
show your models. This is something dealing with sqlite, so we'll have to see what your models are On Monday, January 15, 2018 at 11:06:40 AM UTC-5, ndu sunday wrote: > > When i run migrate i encouter datatype mismatch error. Below is the > complete information i got, what could be wrong and ho

Re: How to get two django rest framework to communicate with each other

2018-01-15 Thread Mohammad Etemaddar
Excuse me for giving advice for this change. But why don't you put these two projects in one Django project as two apps? You have two options. First you can make a ManyToMany relationship. Of course this has a problem. For example some people may not want to share his/her future information to a

Error when i try to run migrate for my model

2018-01-15 Thread ndu sunday
When i run migrate i encouter datatype mismatch error. Below is the complete information i got, what could be wrong and how do i resolve it? Applying catalog.0006_auto_20180113_1923...Traceback (most recent call last): File "/home/ndu/.local/lib/python3.5/site-packages/django/db/backends/uti

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 14

Re: How to get two django rest framework to communicate with each other

2018-01-15 Thread Jason
Since you already have DRF enabled, make a private API for both projects that will be used for inter-project communication. On Sunday, January 14, 2018 at 11:42:59 PM UTC-5, chern...@gmail.com wrote: > > So i have 2 django project. Both have its seperated database and table. I > create the djang

Re: How do I exactly change from SQLite to MySQL ?

2018-01-15 Thread graeme
On Monday, January 15, 2018 at 12:11:58 PM UTC, Mike Dewhirst wrote: snip > > > From my research it seems Postgres is probably the best option for > Django if you want stability with scalability and atomicity. > In addition Django how comes with postgres specific functionality in django.con

Re: Designing templates for database application

2018-01-15 Thread Derek
If this is your first Django app, I would try and use the built-in Django Admin as far as possible - there are numerous ways to customise and extend it (and it creates all the "grids" - by which I assume you mean table-views - and forms for you).After that you will have a better idea of how

Re: How do I exactly change from SQLite to MySQL ?

2018-01-15 Thread Daniel Hepper
Hi Daniel, you can use SQLite locally and MySQL on Heroku. On Heroku, your database settings must be loaded from an environment variable. The section on Database Configuration in Heroku's guide for setting up Django apps ( https://devcenter.heroku.com/articles/django-app-configuration#database-co

Re: How do I exactly change from SQLite to MySQL ?

2018-01-15 Thread akash . sharma
Hi, i haven't used other db's but agree with Mike. It's good enough. On 15-01-2018 05:40 PM, Mike Dewhirst wrote: > Since no-one has suggested avoiding MySQL I should say that I have a few > small websites and every time I check the logs they are full of uglies trying > to access phpmyadmin. E

I want to update records, I use View instated of UpdateView, is this right way ? can anyone tell me, is this right way or wrong?

2018-01-15 Thread Amitkumar Satpute
1. 2. 3. 4. views.py 5. --- 6. class UpdateUser(View): 7. def post(self,request,pk): 8. user=get_object_or_404(User,pk=pk) 9. userinfo=get_object_or_404(UserCreation,user=user) 10. user_form=UserUpdateForm(request.POST,in

Deprecations not listed within release notes

2018-01-15 Thread Murat Sert
There are some deprecations such as the custom_sql_for_model and couple of other methods within django.core.management.sql file which isn't listed on any of the release notes 1.8/1.9/1.11 or deprecation timeline. Does anyone know if there methods are deprecated or moved elsewhere? -- You recei

Re: How do I exactly change from SQLite to MySQL ?

2018-01-15 Thread Mike Dewhirst
Since no-one has suggested avoiding MySQL I should say that I have a few small websites and every time I check the logs they are full of uglies trying to access phpmyadmin. Every time I see that I'm glad I went for PostgreSQL. From my research it seems Postgres is probably the best option for

Re: How do I exactly change from SQLite to MySQL ?

2018-01-15 Thread Julio Biason
Hi Daniel, Well, in simple terms, all you need to do is change the DATABASE setting in your settings (here https://www.coderedcorp.com/blog/django-settings-for-multiple-environments/ is an example of way to keep two different configurations, so you can have a production setting pointing to MySQL w