I am going through the Django REST framework tutorial found at http://www.django-rest-framework.org/ I am almost finished with it and just added authentication. Now I am getting : I have looked in several places on the web, not just StackOverflow for the solution, it seems like in general that the problem is with my database and need to delete it then
Tag: django
Create celery tasks then run synchronously
My app gathers a bunch of phone numbers on a page. Once the user hits the submit button I create a celery task to call each number and give a reminder message then redirect them to a page where they can see the live updates about the call. I am using web sockets to live update the status of each
Django Ckeditor image browser not finding images
So I’m building a simple blog to keep track of my projects. I decided to use CKeditor as the wysiwyg editor. I was able to get all of it to work except for the image portion of it. I’m not able to view the images in the server when I hit “image browse”, and whenever I upload an image, it
Loading initial data with Django 1.7+ and data migrations
I recently switched from Django 1.6 to 1.7, and I began using migrations (I never used South). Before 1.7, I used to load initial data with a fixture/initial_data.json file, which was loaded with the python manage.py syncdb command (when creating the database). Now, I started using migrations, and this behavior is deprecated : If an application uses migrations, there is
Django 1.7 – “No migrations to apply” when run migrate after makemigrations
I use Django1.7 with Mezzanine. I create simple profile (according to Mezzanine documentation) stored in separate app “profiles”: Creation of migrations returns: When I run “migrate profiles”: The issue is, when I try to open any page related to mezzanine.accounts (for example update account), it crashes with: What I have done wrong? Answer Sounds like your initial migration was faked
Installing psycopg2 in a virtualenv in ubuntu os
I using a virtualenv and I am trying to set up postgresql. I have psycopg2 installed on my system, but it appears that my virtual env does not recognize psycopg2. Is it possible to just copy the system wide psycopg2 files into my django project directory or is this a bad approach to take? This is the relevant part of
multiple execute on a single connection.cursor in django. Is it safe?
I am opening a cursor with connection.cursor executing a bunch of deletes then closing the cursor. It works, but I am not sure if it has any side effect. Would appreciate any feedback. Answer Since you are not executing these SQL statements in the transaction, you may encounter confusing states (for example, data was deleted from table_a, but not from
“Models aren’t loaded yet” error while populating in Django 1.8 or later
I am using this code to populate my database: On running It gives the error: Rest of my files are ok but getting this error. I am following the tutorial from Tango with Django book but as the book refers to Django 1.5.4 and i am using Django 1.8, so can anyone help me here? Answer I had the same
Django migration strategy for renaming a model and relationship fields
I’m planning to rename several models in an existing Django project where there are many other models that have foreign key relationships to the models I would like to rename. I’m fairly certain this will require multiple migrations, but I’m not sure of the exact procedure. Let’s say I start out with the following models within a Django app called
How to change django wagtail’s admin logo
I am working on a small project and I thought I’d give wagtail a try. I am now wondering how I could change wagtail’s admin logo in the sidebar (top left image on the picture bellow). I could change /static/wagtailadmin/images/wagtail-logo.svg directly but it’d be wrong ;). Answer Wagtail already provide the solution in the official documentation using django-overextends: To replace