Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7981027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:14:54+00:00 2026-06-04T10:14:54+00:00

I have a django 1.4 project with 2 apps: RemoteStorage and WeShouldServer (that one

  • 0

I have a django 1.4 project with 2 apps: RemoteStorage and WeShouldServer (that one was autocreated on project create and contains urls, settings, etc)

when I try to go to my admin page, I get this error:

SyntaxError at /admin
invalid syntax (views.py, line 33)

and the last line of the stacktrace is:

from RemoteStorage.views import refer 

I think it’s a general import error, because I’m importing 3 methods from RemoteStorage.views, and when I change the order I still get an import error on whatever the first import is.

My urls.py:

from django.conf.urls import patterns, include, url
from RemoteStorage.views import refer
from RemoteStorage.views import check_referrals
from RemoteStorage.views import save_item


# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'WeShouldServer.views.home', name='home'),
    # url(r'^WeShouldServer/', include('WeShouldServer.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^save-item/', save_item),
    url(r'^check-referrals/', check_referrals),
    url(r'^refer', refer),
)

my settings.py contains my app:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    **'RemoteStorage',**
)

my views.py:

# Create your views here.
from RemoteStorage.models import Item, Tag, Category, User, Referral
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
import json

def save_item(request):
        try:

                print request.GET
#               print request.user
                i = Item()
                i.user = User.objects.get_or_create(email=request.GET['user_email'])[0]
#       i.website = request.GET.get('website', "")
#       i.comment = request.GET.get('comment', "")
#       i.rating = request.GET.get('rating', "")
#       i.phone_numger = request.GET.get('phone number', "")
#               i.address = request.GET.get('address', "")      
                i.save()

                print i
        except Exception as e:
                print e.message()

        return HttpResponse()

def check_referrals(request):
        try:
                print request
                user = User.objects.get_or_create(email = request.GET.get("user_email", "")[0]
#       referrals = Referral.objects.filter(referred_to = user)
#       return HttpResponse(content = json.dumps(referrals))
                return HttpResponse()
        except Exception as e:
                print e.message()

def refer(request):
        print request
        user = User.objects.get_or_create(email = request.GET.get("user_email", "")[0]
        refer_to = request.GET.get("email_list", "")
        refer_to_list = refer_to.split(",")

        for rt in refer_to_list:
                r = Referral()
                r.data = request.GET.get("item_data", "")
                r.referred_by = user
                r.referred_to = rt
                r.save()
        return HttpResponse()

I can’t figure out what’s wrong!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:14:57+00:00Added an answer on June 4, 2026 at 10:14 am

    Check the line 32 (33 – 1)

    user = User.objects.get_or_create(email = request.GET.get("user_email", "")[0]
    

    It’s missing a right parens , and should be

    user = User.objects.get_or_create(email = request.GET.get("user_email", ""))[0]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a django project that uses a lot of 3rd party apps, so
I have a Django project set up with Jenkins. One of my apps has
I have a Django project which has two apps (one created as debug test).
I have a Django project with one app called subscribe . In root urls.py
I have a django project which has two apps, one is AppA and AppB
I have a django project which is laid out like this... myproject apps media
I have a django project that I have been working on as a solo
I have a django project that runs on a Linux server, and I've been
I have two apps in my Django project: a public-facing app, and a management
I'm starting on my first large django project and have realized that the default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.