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 3429748
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:07:12+00:00 2026-05-18T07:07:12+00:00

I am still in the development phase of a Django App. Before even writing

  • 0

I am still in the development phase of a Django App. Before even writing my views.py, I test them out to see if my models are correctly defined. This I do it in the terminal by invoking

python manage.py shell

But oh so often I make some syntax error prompting me to abort the shell ctrl-D & retype everything. This process is taking forever. It would be better if I could write all this in some file just for my trials & if all’s well copy it to views.py.

What’s the process for this? Is it as simple as creating a trial.py in my app directory. Won’t I have to import the Django env? What’s the best way to do this?

  • 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-05-18T07:07:12+00:00Added an answer on May 18, 2026 at 7:07 am

    By all means create a trial.py for simple experimentation, then after doing

    python manage.py shell
    

    you can do

    >>> import trial
    

    and then invoke the code in trial, directly from the prompt, e.g.

    trial.myfunc()
    

    If you need to change things you can just save your changed trial.py and do

    reload(trial)
    

    Of course, you may need to recreate any existing objects in the interactive session in order to make use of your changes.

    This should be seen as complementary to writing unit tests (as per Jani’s answer), but I do find this approach useful for trying things out using iterative refinement.

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

Sidebar

Related Questions

I'm absolutely new to iOS App development (I haven't actually started yet, still in
I've got a test site here (still in development) and I'm trying to get
My app is still in development so I am not trying to do anything
Hello good morning everyone, i have an iphone app which is still in development
not much of a programming question, but development related still, I'm starting Android development
I'm still rather new to iPhone development and I tried something I didn't it
I'm still uncertain about how best to use Mocks when doing development from the
After two years of Android development I'm still not 100% sure about what resources
I'm still relatively new to Java and Android development, so I'm still unfamiliar with
Is it still possible to find the 3.1.3 SDK (w/ Xcode) for iPhone development

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.