Re: Rebuild django app table

2017-03-23 Thread max
OK I found what happen, It need to build step by step ./manage.py migrate contenttypes ./manage.py migrate auth ./manage.py migrate sites ./manage.py migrate my_app ./manage.py migrate max於 2017年3月24日星期五 UTC+8下午12時56分04秒寫道: > > I delete the table Django built(e.g. django_content_type) in my sql

Rebuild django app table

2017-03-23 Thread max
I delete the table Django built(e.g. django_content_type) in my sql server, and restart a new Django project But when I did makemigrations the table didn;t show up, only django_migrations created Somebody know what is going on? -- You received this message because you are subscribed to the Goo

Re: Testing a Django library

2017-03-23 Thread Josh Crompton
There's no Django community standard of which I'm aware for doing this. There *is* a standard way to run tests for Python projects which use setuptools (which yours should do if you want people to be able to `pip install` it) [1]. I usually do something like this blog post describes [2]. Or, y

inspectDB and 'id' can only be used as a field name if the field also sets 'primary_key=True'.

2017-03-23 Thread Camilo Torres
Hi. You should rename the "id" field in your model to something else. You can edit your models.py and put another name, like "dbid" or something. Django models reserve the "id" field for primary key; your table has another field as primary key. -- You received this message because you are sub

Re: Django Captcha or MathCaptcha application

2017-03-23 Thread Camilo Torres
May be you are missing a data base migration? -- 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, s

Re: Model's Foreign Key Id Attribute not being updated

2017-03-23 Thread Rowan Seymour
I ran into the same problem today in a script for creating large amounts of test data. It would be awkward to re-organize the code it such a way that related objects are assigned to fields only after they've been saved, so I made a utility method to a take a model instance which has fields which

class tags 'block' now working

2017-03-23 Thread jjanderson52000
Hi, The plans are to use classytags on the website at work and I'm going through the documentation and running some experimental code as I go. This is being run on with classtags 0.8.0, python 3.5.2, and django 1.10.3. I've written some templates and using classy tags, written an inclusion tag

Re: , received 404

2017-03-23 Thread Melvyn Sopacua
On Wednesday 22 March 2017 23:55:06 æ Žå¿—æ˜Ž wrote: > Ubuntu 14.04 Desktop, > apache 2.4.7, > python 3.4.3, > Djanog 1.10.6 And your WSGI config? -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Ajax call with class-based view

2017-03-23 Thread valerio orfano
I have the following template: $(document).ready(function(){ function captcha() { $.ajax({ type: "POST", url: "../captcha", data:{}, contentType: "application/json", dataType: "json",

Re: , received 404

2017-03-23 Thread Avraham Serour
Do you really have to use Apache for any reason? If not I recommend using nginx+ uwsgi to deploy django, the killer feature that convinced me to leave Apache was the simpler config file nginx have. There are plenty of tutorials on how to deploy django like this, if you don't find anything suitabl

Querying performance

2017-03-23 Thread dsfqce cwfe
Is quering Provider model significantly less efficient using this pattern? class Provider(models.Model): def __new__(cls, url, *args, **kwargs): if 'google' in url: return object.__new__(Google) elif 'bing' in url: return object.__new__(Bing) url =

, received 404

2017-03-23 Thread 李志明
--System configuration: Ubuntu 14.04 Desktop, apache 2.4.7, python 3.4.3, Djanog 1.10.6 -- Apache2 works fine and I can see its default page, but cannot view any Django page. -- Searched on Google, and found lots of documents, tried tons of them, still the same result. anyone has experienc

inspectDB and 'id' can only be used as a field name if the field also sets 'primary_key=True'.

2017-03-23 Thread Carl Brewer
G'day, Very new to Django, I'm trying to connect to an existing MySQL database that I am not familiar with. I used inspectDB to load up the database models.py file, and am seeing these errors for some of the tables : 'id' can only be used as a field name if the field also sets 'primary_key=Tru

Querying performance

2017-03-23 Thread dsfqce cwfe
Is querying Provider model significantly less efficient using this pattern? class Provider(models.Model): def __new__(cls, url, *args, **kwargs): if 'google' in url: return object.__new__(Ekino) elif 'bing' in url: print('gowno') url = models.CharFi

Re: Executing DB-Queries during import

2017-03-23 Thread guettli
Thank you tim for the link. Since on the referenced discussion someone asked for help to debug this, I published my solution here: http://stackoverflow.com/questions/42972444/django-detect-module-level-db-queries/42972445#42972445 I think it would help if you get a RuntimeException if you acces

Re: Django Captcha or MathCaptcha application

2017-03-23 Thread valerio orfano
Belowe the steps i have followed, but it doesnt work. I type in my browser : www.localhost/capthca but no image is displayeded and i get an error : no such table: captcha_captchastore I dont find it very simple as suggested from documentation. Do you have any simple tutorial? 1.pip instal