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

  • Home
  • SEARCH
  • 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 7746753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:21:32+00:00 2026-06-01T10:21:32+00:00

I tried to install django on my shared hosting environment, which has SSH access.

  • 0

I tried to install django on my shared hosting environment, which has SSH access.

I downloaded the newest version of Django using

svn export http://code.djangoproject.com/svn/django/trunk/django django

I can import Django in python shell without any error throwing.

But then I tried to start a new project using django-admin.py and it started throwing me a bunch of error, in which I tried to google for the past few hours. I still can’t find it

Below is the actual error:

k4660061@server42222:~$ django-admin.py startproject klikevent
/u/k4660061/home/local/lib/python/site-packages/django/core/management/templates.py:155: Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
  File "/u/k4660061/home/local/lib/python/site-packages/django/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/u/k4660061/home/local/lib/python/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/u/k4660061/home/local/lib/python/site-packages/django/core/management/__init__.py", line 381, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/u/k4660061/home/local/lib/python/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/u/k4660061/home/local/lib/python/site-packages/django/core/management/__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/u/k4660061/home/local/lib/python/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/u/k4660061/home/local/lib/python/site-packages/django/core/management/commands/startproject.py", line 2, in <module>
    from django.core.management.templates import TemplateCommand
  File "/u/k4660061/home/local/lib/python/site-packages/django/core/management/templates.py", line 155
    with open(old_path, 'r') as template_file:
            ^
SyntaxError: invalid syntax
k4660061@server42222:~$ 

Thanks


UPDATE

After a good night sleep, I got it working! See answer by Bernie. I have to see the stacktrace over and over, but I just need to add the import statement to multiple file

the file are

django/utils/archive.py
django/core/management/templates.py

and any file that throw the warning with_statement

Thanks @Bernie

  • 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-01T10:21:34+00:00Added an answer on June 1, 2026 at 10:21 am

    If the syntax error is related to the with statement, it could be that your prod server has an older version of Python than your dev server.

    If your prod server is running version 2.5 or higher you can do this:

    from __future__ import with_statement
    

    Please note: any from __future__ imports must be the very first import.
    Reference: http://docs.python.org/reference/simple_stmts.html#future

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to install this ipython version. infact there's a django-starter project which uses buildout
I tried to install pygtk on mac. I downloaded the pygtk file, opened up
I tried to install MonoDevelop on Suse 11.0 Enterprise, using the 1-click install on
I tried to install Ruby 1.9.3 using RVM. It seems that it installed without
I want to install some specific version of a package (in this case Django)
I tried to install django db log from here https://github.com/dcramer/django-db-log , by running python
Downloaded Django, ran install, now I need to setup a database -- And I'm
I'm working with Django for python. I've tried to install Markdown 2.0.3 for python
I tried to install Django with FastCGI but without success!. It gives me a
I tried to install Geo::Google using CPAN ( http://metacpan.org/pod/Geo::Google v0.05 ) and it failed

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.